Showing
1 changed file
with
8 additions
and
5 deletions
| ... | ... | @@ -177,13 +177,16 @@ public class DelayedShipmentServiceImpl extends BaseMpServiceImpl<DelayedShipmen |
| 177 | 177 | LocalDate deliveryDate = createDelayedShipmentDetailVo.getDeliveryDate(); |
| 178 | 178 | applyShipmentDate = createDelayedShipmentDetailVo.getApplyShipmentDate(); |
| 179 | 179 | if (deliveryDate != null && applyShipmentDate != null) { |
| 180 | + ShipmentsPlanDetail shipmentsPlanDetail = shipmentsPlanDetailService.findById(createDelayedShipmentDetailVo.getShipmentsPlanDetailId()); | |
| 180 | 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 | 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 | } | ... | ... |