diff --git a/src/main/java/com/chint/application/services/OrderApplicationService.java b/src/main/java/com/chint/application/services/OrderApplicationService.java index ac42f029..bf1af66b 100644 --- a/src/main/java/com/chint/application/services/OrderApplicationService.java +++ b/src/main/java/com/chint/application/services/OrderApplicationService.java @@ -134,10 +134,8 @@ public class OrderApplicationService { .reloadStatus(); Leg oldLeg = leg.deepClone(); - oldLeg.setRouteId(null); // 对 leg 进行更新 leg.update(legData); - // 对更新的行程补充地理信息 legDomainService.queryLocation(List.of(oldLeg, leg)); 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 23120d37..4e14a468 100644 --- a/src/main/java/com/chint/domain/aggregates/order/Leg.java +++ b/src/main/java/com/chint/domain/aggregates/order/Leg.java @@ -121,6 +121,7 @@ public class Leg implements Serializable, EventManageable { if (this.legExtensionField != null) { clonedLeg.legExtensionField = new LegExtensionField(); BeanUtils.copyProperties(this.legExtensionField, clonedLeg.legExtensionField); + clonedLeg.legExtensionField.setLocationList(null); } // 深克隆 orderDetails if (this.orderDetails != null) { @@ -133,15 +134,9 @@ public class Leg implements Serializable, EventManageable { .toList(); } // 深克隆 originLocation - if (this.originLocation != null) { - clonedLeg.originLocation = new Location(); - BeanUtils.copyProperties(this.originLocation, clonedLeg.originLocation); - } - // 深克隆 destinationLocation - if (this.destinationLocation != null) { - clonedLeg.destinationLocation = new Location(); - BeanUtils.copyProperties(this.destinationLocation, clonedLeg.destinationLocation); - } + clonedLeg.originLocation = null; + clonedLeg.destinationLocation = null; + clonedLeg.setRouteId(null); return clonedLeg; } @@ -206,7 +201,9 @@ public class Leg implements Serializable, EventManageable { } // 更新起点和终点 this.originId = legData.getOriginId(); + this.originLocation = null; this.destinationId = legData.getDestinationId(); + this.destinationLocation = null; // 如果是酒店类型,起点和终点相同 if (LEG_TYPE_HOTEL == (this.legType)) { this.destinationId = legData.getOriginId(); @@ -238,6 +235,7 @@ public class Leg implements Serializable, EventManageable { this.legExtensionField.setEstimatedAmount(legExtensionFieldData.getEstimatedAmount()); } if (legExtensionFieldData.getLocationIds() != null) { + this.legExtensionField.setLocationList(new ArrayList<>()); this.legExtensionField.addLocationIdsAsString(legExtensionFieldData.getLocationIds()); } }