Commit aec902553dc1b6fbe60d078a8da0045be123e4cf

Authored by yeqianyong
1 parent 394b4ee9

楚江erp:1、生成发货单增加发货时点校验;2、核对数据校验逻辑调整

@@ -40,6 +40,7 @@ import com.lframework.xingyun.sc.vo.shipments.car.CreateDraftRequestCarTicketVo; @@ -40,6 +40,7 @@ import com.lframework.xingyun.sc.vo.shipments.car.CreateDraftRequestCarTicketVo;
40 import com.lframework.xingyun.sc.vo.shipments.car.CreateRequestCarTicketVo; 40 import com.lframework.xingyun.sc.vo.shipments.car.CreateRequestCarTicketVo;
41 import com.lframework.xingyun.sc.vo.shipments.order.*; 41 import com.lframework.xingyun.sc.vo.shipments.order.*;
42 import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo; 42 import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo;
  43 +import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanDetailVo;
43 import lombok.extern.slf4j.Slf4j; 44 import lombok.extern.slf4j.Slf4j;
44 import org.apache.commons.collections4.CollectionUtils; 45 import org.apache.commons.collections4.CollectionUtils;
45 import org.apache.commons.collections4.MapUtils; 46 import org.apache.commons.collections4.MapUtils;
@@ -339,6 +340,17 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr @@ -339,6 +340,17 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr
339 if (CollectionUtils.isEmpty(detailList)) { 340 if (CollectionUtils.isEmpty(detailList)) {
340 throw new DefaultClientException("发货明细数据不存在!"); 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 List<List<ShipmentsPlanDetail>> batchList = CommonUtil.partition(detailList, 8); 354 List<List<ShipmentsPlanDetail>> batchList = CommonUtil.partition(detailList, 8);
343 handleBatchData(batchList, planId); 355 handleBatchData(batchList, planId);
344 } 356 }
@@ -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 }