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