From 3b0b18fbeb11cd4043a6c75856826e18ce1f586a Mon Sep 17 00:00:00 2001 From: lulz1 Date: Wed, 3 Jul 2024 09:47:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A1=8C=E7=A8=8B=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E9=A2=84=E4=BC=B0=E4=BB=B7=E6=A0=BC?= =?UTF-8?q?=E4=B8=8D=E5=8F=98=E6=9B=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chint/domain/aggregates/order/Leg.java | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/chint/domain/aggregates/order/Leg.java b/src/main/java/com/chint/domain/aggregates/order/Leg.java index 4d637b0e..9548aca7 100644 --- a/src/main/java/com/chint/domain/aggregates/order/Leg.java +++ b/src/main/java/com/chint/domain/aggregates/order/Leg.java @@ -209,8 +209,7 @@ public class Leg implements Serializable, EventManageable { this.destinationId = legData.getOriginId(); } // 更新扩展字段 - if ((LEG_TYPE_OTHER == (this.legType) || LEG_TYPE_TAXI == (this.legType)) && - legData.getLegExtensionFieldData() != null) { + if (legData.getLegExtensionFieldData() != null) { updateLegExtensionFields(legData.getLegExtensionFieldData()); } return this; @@ -220,11 +219,21 @@ public class Leg implements Serializable, EventManageable { if (this.legExtensionField == null) { this.legExtensionField = new LegExtensionField(); } - this.legExtensionField.setAmountType(legExtensionFieldData.getAmountType()); - this.legExtensionField.setExpenseExplanation(legExtensionFieldData.getExpenseExplanation()); - this.legExtensionField.setOriginDescription(legExtensionFieldData.getOriginDescription()); - this.legExtensionField.setDestinationDescription(legExtensionFieldData.getDestinationDescription()); - this.legExtensionField.setEstimatedAmount(legExtensionFieldData.getEstimatedAmount()); + if (legExtensionFieldData.getAmountType() != null) { + this.legExtensionField.setAmountType(legExtensionFieldData.getAmountType()); + } + if (legExtensionFieldData.getExpenseExplanation() != null) { + this.legExtensionField.setExpenseExplanation(legExtensionFieldData.getExpenseExplanation()); + } + if (legExtensionFieldData.getOriginDescription() != null) { + this.legExtensionField.setOriginDescription(legExtensionFieldData.getOriginDescription()); + } + if (legExtensionFieldData.getDestinationDescription() != null) { + this.legExtensionField.setDestinationDescription(legExtensionFieldData.getDestinationDescription()); + } + if (legExtensionFieldData.getEstimatedAmount() != null) { + this.legExtensionField.setEstimatedAmount(legExtensionFieldData.getEstimatedAmount()); + } if (legExtensionFieldData.getLocationIds() != null) { this.legExtensionField.addLocationIdsAsString(legExtensionFieldData.getLocationIds()); }