From c2897e8a8037d10c79b34a6130e0042548e2bd8b Mon Sep 17 00:00:00 2001 From: lulz1 Date: Wed, 3 Jul 2024 14:34:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=9B=A0=E6=89=93?= =?UTF-8?q?=E8=BD=A6=E8=A1=8C=E7=A8=8B=E7=BC=BA=E5=A4=B1=E5=9C=B0=E7=82=B9?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=97=A0=E6=B3=95=E6=8E=A8=E9=80=81=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../approval/platform/ApprovalPlatformAN.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java b/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java index 865767a4..45ce63c3 100644 --- a/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java +++ b/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java @@ -23,6 +23,7 @@ import java.time.LocalDateTime; import java.util.ArrayList; import java.util.List; import java.util.Optional; +import java.util.concurrent.CompletableFuture; import static com.chint.infrastructure.constant.LegConstant.*; @@ -98,7 +99,8 @@ public class ApprovalPlatformAN implements ApprovalPlatform { approvalPlatformInfo.changeUrl() .ifPresent(url -> { ApprovalScheduleParam approvalScheduleParam = createApprovalScheduleParam(approvalData); - DelayDispatch.attemptToSend(() -> postRequest.post(url, approvalScheduleParam, ANResponse.class).getSuccess(), 0); + CompletableFuture.runAsync(()-> DelayDispatch.attemptToSend(() -> postRequest.post(url, approvalScheduleParam, ANResponse.class) + .getSuccess(), 0)); }); } @@ -124,10 +126,10 @@ public class ApprovalPlatformAN implements ApprovalPlatform { ScheduleItem scheduleItem = new ScheduleItem(); scheduleItem.orderType = ANProductType(newLeg.getLegType()); // 示例值,可根据需要动态分配 scheduleItem.changeType = "2"; // 示例值,可根据需要动态分配 - scheduleItem.fromAddress = newLeg.getOriginLocation().getLocationName(); - scheduleItem.toAddress = newLeg.getDestinationLocation().getLocationName(); - scheduleItem.originalFromAddress = oldLeg.getOriginLocation().getLocationName(); - scheduleItem.originalToAddress = oldLeg.getDestinationLocation().getLocationName(); + scheduleItem.fromAddress = newLeg.getOriginLocation() != null ? newLeg.getOriginLocation().getLocationName() : null; + scheduleItem.toAddress = newLeg.getDestinationLocation() != null ? newLeg.getDestinationLocation().getLocationName() : null; + scheduleItem.originalFromAddress = oldLeg.getOriginLocation() != null ? oldLeg.getOriginLocation().getLocationName() : null; + scheduleItem.originalToAddress = oldLeg.getDestinationLocation() != null ? oldLeg.getDestinationLocation().getLocationName() : null; scheduleItem.startTime = DateTimeUtil.timeToStrCommon(newLeg.getStartTime()); scheduleItem.endTime = DateTimeUtil.timeToStrCommon(newLeg.getEndTime()); scheduleItem.originalStartTime = DateTimeUtil.timeToStrCommon(oldLeg.getStartTime()); @@ -139,8 +141,8 @@ public class ApprovalPlatformAN implements ApprovalPlatform { ScheduleItem scheduleItem = new ScheduleItem(); scheduleItem.orderType = ANProductType(leg.getLegType()); // 示例值,可根据需要动态分配 scheduleItem.changeType = "1"; // 示例值,可根据需要动态分配 - scheduleItem.fromAddress = leg.getOriginLocation().getLocationName(); - scheduleItem.toAddress = leg.getDestinationLocation().getLocationName(); + scheduleItem.fromAddress = leg.getOriginLocation() != null ? leg.getOriginLocation().getLocationName() : null; + scheduleItem.toAddress = leg.getDestinationLocation() != null ? leg.getDestinationLocation().getLocationName(): null; scheduleItem.startTime = DateTimeUtil.timeToStrCommon(leg.getStartTime()); scheduleItem.endTime = DateTimeUtil.timeToStrCommon(leg.getEndTime()); scheduleItem.amount = new BigDecimal(leg.getEstimateAmount());