update 电池充电报告Service

This commit is contained in:
Lemon
2025-09-23 10:44:29 +08:00
parent bd62f259ac
commit 896f69f496
4 changed files with 32 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ package com.jsowell.api.thirdparty;
import com.jsowell.common.annotation.Anonymous;
import com.jsowell.common.core.controller.BaseController;
import com.jsowell.common.response.RestApiResponse;
import com.jsowell.common.util.StringUtils;
import com.jsowell.thirdparty.platform.dto.BatteryChargeReportDTO;
import com.jsowell.thirdparty.platform.service.impl.BatteryChargeReportService;
import com.jsowell.thirdparty.platform.service.impl.ChargeAlgorithmService;
@@ -31,8 +32,12 @@ public class ChargeAlgorithmController extends BaseController {
RestApiResponse<?> response = null;
try {
// String result = chargeAlgorithmService.pushOrderInfo(orderCode);
String result = batteryChargeReportService.getTaskIdByOrderCode(dto.getOrderCode(), dto.getReportType());
response = new RestApiResponse<>(result);
String taskId = batteryChargeReportService.getTaskIdByOrderCode(dto.getOrderCode());
String url = "";
if (StringUtils.isNotBlank(taskId)) {
url = batteryChargeReportService.getUrlByTaskId(taskId, dto.getReportType());
}
response = new RestApiResponse<>(url);
}catch (Exception e) {
logger.error("算法应用推送订单信息 error, ", e);
response = new RestApiResponse<>(e);

View File

@@ -86,6 +86,7 @@ import com.jsowell.thirdparty.parking.common.bean.QcyunParkCouponDTO;
import com.jsowell.thirdparty.parking.service.LTYTService;
import com.jsowell.thirdparty.parking.service.QcyunsService;
import com.jsowell.thirdparty.platform.service.ThirdPartyPlatformService;
import com.jsowell.thirdparty.platform.service.impl.BatteryChargeReportService;
import com.jsowell.thirdparty.platform.util.Cryptos;
import com.jsowell.thirdparty.platform.util.Encodes;
import com.jsowell.thirdparty.platform.util.GBSignUtils;
@@ -292,6 +293,9 @@ public class SpringBootTestController {
@Autowired
private OrderSplitRecordService orderSplitRecordService;
@Autowired
private BatteryChargeReportService batteryChargeReportService;
@Qualifier("zhongDianLianPlatformServiceImpl")
private ThirdPartyPlatformService platformLogic;
@@ -305,6 +309,21 @@ public class SpringBootTestController {
private final ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(10, JsowellThreadFactory.forName("test-thread-factory"));
@Test
public void testBatteryReport() throws InterruptedException {
String orderCode = "C25787997784";
String taskId = batteryChargeReportService.getTaskIdByOrderCode(orderCode);
// String taskId = "f46d86c5fc9942c3a4806aa97120d279";
String url = batteryChargeReportService.getUrlByTaskId(taskId, Constants.TWO);
if (StringUtils.isBlank(url)) {
Thread.sleep(2000);
url = batteryChargeReportService.getUrlByTaskId(taskId, Constants.TWO);
}
System.out.println(url);
}
@Test
public void testThread() {
threadFactory.newThread(() -> System.out.println("testThread:"+ Thread.currentThread().getName()));