Commit 5eb40b11db4266a70eeca56bd4919eb57576ee63

Authored by yeqianyong
2 parents e323ce29 aec90255

Merge branch 'master_after20' into master_cj_zq

... ... @@ -41,6 +41,7 @@ import com.lframework.xingyun.sc.vo.shipments.car.CreateDraftRequestCarTicketVo;
41 41 import com.lframework.xingyun.sc.vo.shipments.car.CreateRequestCarTicketVo;
42 42 import com.lframework.xingyun.sc.vo.shipments.order.*;
43 43 import com.lframework.xingyun.sc.vo.shipments.plan.QueryShipmentsPlanDetailVo;
  44 +import com.lframework.xingyun.sc.vo.shipments.plan.UpdateShipmentsPlanDetailVo;
44 45 import lombok.extern.slf4j.Slf4j;
45 46 import org.apache.commons.collections4.CollectionUtils;
46 47 import org.apache.commons.collections4.MapUtils;
... ... @@ -343,6 +344,17 @@ public class ShipmentsOrderInfoServiceImpl extends BaseMpServiceImpl<ShipmentsOr
343 344 if (CollectionUtils.isEmpty(detailList)) {
344 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 358 List<List<ShipmentsPlanDetail>> batchList = CommonUtil.partition(detailList, 8);
347 359 handleBatchData(batchList, planId);
348 360 }
... ...
... ... @@ -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 }
... ...