Commit aec902553dc1b6fbe60d078a8da0045be123e4cf
1 parent
394b4ee9
楚江erp:1、生成发货单增加发货时点校验;2、核对数据校验逻辑调整
Showing
2 changed files
with
16 additions
and
1 deletions
xingyun-sc/src/main/java/com/lframework/xingyun/sc/impl/shipments/ShipmentsOrderInfoServiceImpl.java
| ... | ... | @@ -40,6 +40,7 @@ import com.lframework.xingyun.sc.vo.shipments.car.CreateDraftRequestCarTicketVo; |
| 40 | 40 | import com.lframework.xingyun.sc.vo.shipments.car.CreateRequestCarTicketVo; |
| 41 | 41 | import com.lframework.xingyun.sc.vo.shipments.order.*; |
| 42 | 42 | import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; |
| 43 | +import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanDetailVo; | |
| 43 | 44 | import lombok.extern.slf4j.Slf4j; |
| 44 | 45 | import org.apache.commons.collections4.CollectionUtils; |
| 45 | 46 | import org.apache.commons.collections4.MapUtils; |
| ... | ... | @@ -339,6 +340,17 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr |
| 339 | 340 | if (CollectionUtils.isEmpty(detailList)) { |
| 340 | 341 | throw new DefaultClientException("发货明细数据不存在!"); |
| 341 | 342 | } |
| 343 | + // 校验数据完整性 | |
| 344 | + for (ShipmentsPlanDetail detail : detailList) { | |
| 345 | + LocalTime shipmentsTime = detail.getShipmentsTime(); | |
| 346 | + if (shipmentsTime == null) { | |
| 347 | + throw new DefaultClientException("发货时点不能为空!"); | |
| 348 | + } | |
| 349 | + UpdateShipmentsPlanDetailVo detailVo = new UpdateShipmentsPlanDetailVo(); | |
| 350 | + detailVo.setId(detail.getId()); | |
| 351 | + detailVo.setCanShipments(Boolean.TRUE); | |
| 352 | + shipmentsPlanDetailService.update(detailVo); | |
| 353 | + } | |
| 342 | 354 | List<List<ShipmentsPlanDetail>> batchList = CommonUtil.partition(detailList, 8); |
| 343 | 355 | handleBatchData(batchList, planId); |
| 344 | 356 | } | ... | ... |
| ... | ... | @@ -135,6 +135,9 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP |
| 135 | 135 | if (ObjectUtil.isNull(data)) { |
| 136 | 136 | throw new DefaultClientException("发货计划明细不存在!"); |
| 137 | 137 | } |
| 138 | + if (vo.getShipmentsTime() != null) { | |
| 139 | + vo.setCanShipments(Boolean.TRUE); | |
| 140 | + } | |
| 138 | 141 | |
| 139 | 142 | LambdaUpdateWrapper<ShipmentsPlanDetail> updateWrapper = Wrappers.lambdaUpdate(ShipmentsPlanDetail.class) |
| 140 | 143 | .set(vo.getShipmentsTime() != null, ShipmentsPlanDetail::getShipmentsTime, vo.getShipmentsTime()) |
| ... | ... | @@ -463,7 +466,7 @@ public class ShipmentsPlanDetailServiceImpl extends BaseMpServiceImpl<ShipmentsP |
| 463 | 466 | if (!preShipments && shipmentsTime == null) { |
| 464 | 467 | throw new DefaultClientException("发货时点不能为空!"); |
| 465 | 468 | } |
| 466 | - if (!preShipments && canShipments == null) { | |
| 469 | + if (preShipments && canShipments == null) { | |
| 467 | 470 | throw new DefaultClientException("是否可发货不能为空!"); |
| 468 | 471 | } |
| 469 | 472 | } | ... | ... |