From f55f6ec006d5d0cd3836c0102b05c159840f37e5 Mon Sep 17 00:00:00 2001 From: Lemon Date: Wed, 26 Nov 2025 10:45:19 +0800 Subject: [PATCH] =?UTF-8?q?update=20=20=E7=94=B5=E6=B1=A0=E6=8A=A5?= =?UTF-8?q?=E5=91=8A=E7=AE=97=E6=B3=95=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/test/java/PaymentTestController.java | 8 ++++---- .../impl/BatteryChargeReportService.java | 17 +++++++++++------ 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/jsowell-admin/src/test/java/PaymentTestController.java b/jsowell-admin/src/test/java/PaymentTestController.java index 58a5c7d1d..b39220367 100644 --- a/jsowell-admin/src/test/java/PaymentTestController.java +++ b/jsowell-admin/src/test/java/PaymentTestController.java @@ -423,10 +423,10 @@ public class PaymentTestController { */ @Test public void createPaymentReverseRequestTest() { - String paymentId = "002212025010720373310722683516795273216"; - BigDecimal refundAmount = new BigDecimal("1.08"); - String memberId = "48781184"; - String orderCode = "C67335843091"; + String paymentId = "002212025112213314210838178078469394432"; + BigDecimal refundAmount = new BigDecimal("49.5"); + String memberId = "67717378"; + String orderCode = "C088649732085"; // 延迟分账未确认调撤销调撤销接口退款 PaymentReverseOperation operation = new PaymentReverseOperation(); diff --git a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/BatteryChargeReportService.java b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/BatteryChargeReportService.java index fa45a3249..8af781be1 100644 --- a/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/BatteryChargeReportService.java +++ b/jsowell-thirdparty/src/main/java/com/jsowell/thirdparty/platform/service/impl/BatteryChargeReportService.java @@ -68,6 +68,7 @@ public class BatteryChargeReportService { @Autowired private PileStationInfoService pileStationInfoService; + @Autowired private ChargeAlgorithmRecordService chargeAlgorithmRecordService; /** @@ -100,12 +101,16 @@ public class BatteryChargeReportService { log.error("订单:{} 获取到 taskId 为空", orderCode); return null; } - // 存入数据库 - ChargeAlgorithmRecord record = new ChargeAlgorithmRecord(); - record.setOrderCode(orderCode); - record.setTaskId(taskId); - chargeAlgorithmRecordService.insertOrUpdateSelective(record); - + ChargeAlgorithmRecord record = chargeAlgorithmRecordService.queryRecordByOrderCode(orderCode); + if (record != null) { + record.setTaskId(taskId); + chargeAlgorithmRecordService.updateChargeAlgorithmRecord(record); + }else { + record = new ChargeAlgorithmRecord(); + record.setTaskId(taskId); + record.setOrderCode(orderCode); + chargeAlgorithmRecordService.insertOrUpdateSelective(record); + } return taskId; }