bugfix 空指针异常

This commit is contained in:
Lemon
2026-03-09 15:53:42 +08:00
parent c012a9fd25
commit 0b191bed06
2 changed files with 6 additions and 5 deletions

View File

@@ -21,9 +21,6 @@ import org.springframework.web.bind.annotation.*;
@RequestMapping("/chargealgorithm") @RequestMapping("/chargealgorithm")
public class ChargeAlgorithmController extends BaseController { public class ChargeAlgorithmController extends BaseController {
@Autowired
private ChargeAlgorithmService chargeAlgorithmService;
@Autowired @Autowired
private BatteryChargeReportService batteryChargeReportService; private BatteryChargeReportService batteryChargeReportService;

View File

@@ -129,11 +129,15 @@ public class ChargeAlgorithmRecordServiceImpl implements ChargeAlgorithmRecordSe
String reportType = dto.getReportType(); String reportType = dto.getReportType();
if (StringUtils.equals(Constants.ONE, reportType)) { if (StringUtils.equals(Constants.ONE, reportType)) {
// 1-web 端 // 1-web 端
if (StringUtils.isNotBlank(record.getWebUrl())) {
return record.getWebUrl(); return record.getWebUrl();
}
}else if (StringUtils.equals(Constants.TWO, reportType)) { }else if (StringUtils.equals(Constants.TWO, reportType)) {
// 2-pdf 端 // 2-pdf 端
if (StringUtils.isNotBlank(record.getPdfUrl())) {
return record.getPdfUrl(); return record.getPdfUrl();
} }
}
return ""; return "";
} }