Commit ea158c302e3ff9cbf1b7a4a809a138a8152e849f

Authored by 房远帅
1 parent 0b4c30ab

延期发货:区分发货单延期和发货计划延期

@@ -177,13 +177,16 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen @@ -177,13 +177,16 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen
177 LocalDate deliveryDate = createDelayedShipmentDetailVo.getDeliveryDate(); 177 LocalDate deliveryDate = createDelayedShipmentDetailVo.getDeliveryDate();
178 applyShipmentDate = createDelayedShipmentDetailVo.getApplyShipmentDate(); 178 applyShipmentDate = createDelayedShipmentDetailVo.getApplyShipmentDate();
179 if (deliveryDate != null && applyShipmentDate != null) { 179 if (deliveryDate != null && applyShipmentDate != null) {
  180 + ShipmentsPlanDetail shipmentsPlanDetail = shipmentsPlanDetailService.findById(createDelayedShipmentDetailVo.getShipmentsPlanDetailId());
180 long daysBetween = Math.abs(ChronoUnit.DAYS.between(deliveryDate, applyShipmentDate)); 181 long daysBetween = Math.abs(ChronoUnit.DAYS.between(deliveryDate, applyShipmentDate));
181 - if (daysBetween > 1) {  
182 - ids.add(createDelayedShipmentDetailVo.getShipmentsPlanDetailId());  
183 - delayedExceedOneDay = true;  
184 - } else {  
185 - //延期等于1天的自动加入后日预发 182 + if (daysBetween == 1 && StringUtil.isBlank(shipmentsPlanDetail.getShipmentOrderId())) {
  183 + // 延期1天且不是发货单:自动加入后日预发(发货计划)
186 shipmentsPlanDetailService.updateShipmentDate(createDelayedShipmentDetailVo.getShipmentsPlanDetailId(), applyShipmentDate); 184 shipmentsPlanDetailService.updateShipmentDate(createDelayedShipmentDetailVo.getShipmentsPlanDetailId(), applyShipmentDate);
  185 + } else {
  186 + ids.add(createDelayedShipmentDetailVo.getShipmentsPlanDetailId());
  187 + if (daysBetween > 1) {
  188 + delayedExceedOneDay = true;
  189 + }
187 } 190 }
188 } 191 }
189 } 192 }