Merge branch 'dev-zza' into dev

# Conflicts:
#	jsowell-admin/src/main/java/com/jsowell/service/OrderService.java
This commit is contained in:
Lemon
2025-09-23 10:46:38 +08:00
29 changed files with 1304 additions and 90 deletions

View File

@@ -3,12 +3,12 @@ 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;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
/**
* 算法应用Controller
@@ -24,12 +24,20 @@ public class ChargeAlgorithmController extends BaseController {
@Autowired
private ChargeAlgorithmService chargeAlgorithmService;
@GetMapping("/pushOrderInfo/{orderCode}")
public RestApiResponse<?> pushOrderInfo(@PathVariable("orderCode") String orderCode) {
@Autowired
private BatteryChargeReportService batteryChargeReportService;
@PostMapping("/pushOrderInfo")
public RestApiResponse<?> pushOrderInfo(@RequestBody BatteryChargeReportDTO dto) {
RestApiResponse<?> response = null;
try {
String result = chargeAlgorithmService.pushOrderInfo(orderCode);
response = new RestApiResponse<>(result);
// String result = chargeAlgorithmService.pushOrderInfo(orderCode);
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);