|
|
|
@ -260,7 +260,6 @@ import java.math.BigDecimal;
|
|
|
|
|
import java.text.ParseException; |
|
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
|
import java.time.LocalDate; |
|
|
|
|
import java.time.MonthDay; |
|
|
|
|
import java.time.YearMonth; |
|
|
|
|
import java.time.format.DateTimeFormatter; |
|
|
|
|
import java.time.temporal.ChronoUnit; |
|
|
|
@ -1369,12 +1368,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
for (DistributionLoadscanEntity distributionParcelListEntity : pushNodeList) { |
|
|
|
|
|
|
|
|
|
PackageData packageData = new PackageData(); |
|
|
|
|
DistributionParcelListEntity byId = distributionParcelListService.getById(distributionParcelListEntity.getPackageId()); |
|
|
|
|
|
|
|
|
|
if(distributionParcelListEntity.getIsZero().equals(1)){ |
|
|
|
|
if(byId.getConditions().equals(3)){ |
|
|
|
|
|
|
|
|
|
//标识零担
|
|
|
|
|
packageData.setNumber(distributionParcelListEntity.getPackageNub()); |
|
|
|
|
DistributionParcelListEntity byId = distributionParcelListService.getById(distributionParcelListEntity.getPackageId()); |
|
|
|
|
if(Func.isNotEmpty(byId)){ |
|
|
|
|
packageData.setOrderCode(byId.getOrderCode()); |
|
|
|
|
if(Func.isEmpty(byId.getBrandName())){ |
|
|
|
@ -1393,7 +1392,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
packageData.setPackageCode(distributionParcelListEntity.getOrderPackageCode()); |
|
|
|
|
packageData.setPackageType(PackageTypeEnums.LTL); |
|
|
|
|
packageData.setNumber(1); |
|
|
|
|
}else if(distributionParcelListEntity.getIsZero().equals(0)){ |
|
|
|
|
}else if(byId.getConditions().equals(1)){ |
|
|
|
|
// 包件
|
|
|
|
|
packageData.setPackageCode(distributionParcelListEntity.getOrderPackageCode()); |
|
|
|
|
packageData.setPackageType(PackageTypeEnums.CMP); |
|
|
|
@ -1445,7 +1444,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
return jsonArray; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, DistributionReservationEntity reservationEntity, List<DistributionLoadscaninvnEntity> ts) { |
|
|
|
|
private NodeFanoutMsg<DistributionLoadVO> buildNodeFanoutMsgByStock(DistributionDeliveryListEntity distributionDeliveryListEntity, List<DistributionLoadscaninvnEntity> ts) { |
|
|
|
|
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = new NodeFanoutMsg(); |
|
|
|
|
nodeFanoutMsg.setBizOperation(BizOperationEnums.ADD); |
|
|
|
|
nodeFanoutMsg.setNode(WorkNodeEnums.DISTRIBUTION_LOADING); |
|
|
|
@ -1730,6 +1729,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
List<DistributionParcelListEntity> updatePackageList = new ArrayList<>(); |
|
|
|
|
List<JSONObject> logList = new ArrayList<>(); |
|
|
|
|
List<String> orderCodes = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<DistributionLoadscaninvnEntity> kucuns = new ArrayList<>(); |
|
|
|
|
List<DistributionLoadscanEntity> dingzhis= new ArrayList<>(); |
|
|
|
|
List<DistributionLoadscanEntity> lingdans = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
for (DistributionReservationStockarticleEntity reservationStockarticleEntity : reservationStockarticleEntityList) { |
|
|
|
|
switch (reservationStockarticleEntity.getIsZero()) { |
|
|
|
|
case "0": |
|
|
|
@ -1792,6 +1797,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (Func.isNotEmpty(distrilbutionloadingscanDTO.getDeliveryId())) { |
|
|
|
|
loadscanEntity.setDeliveryId(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
} |
|
|
|
|
dingzhis.add(loadscanEntity); |
|
|
|
|
distributionLoadscanService.save(loadscanEntity); |
|
|
|
|
//更新装车时间
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
@ -1873,6 +1879,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
loadscanEntity.setTrainNumber(distributionDeliveryListEntity.getTrainNumber()); |
|
|
|
|
distributionLoadscanService.save(loadscanEntity); |
|
|
|
|
|
|
|
|
|
//更新装车数量
|
|
|
|
|
Integer j = distributionSignforMapper.updateloadByReservationId(loadscanEntity.getDeliveryId(), loadscanEntity.getReservationId(), loadscanEntity.getPackageNub()); |
|
|
|
|
BigDecimal handQuantity = new BigDecimal(parcelNumberVO.getHandQuantity()); |
|
|
|
@ -1889,6 +1896,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelNumberVO.getStockArticleId()); |
|
|
|
|
stockArticleEntity.setHandQuantity(stockArticleEntity.getHandQuantity() + loadscanEntity.getPackageNub() - parcelNumberVO.getReservationNum()); |
|
|
|
|
distributionStockArticleService.updateById(stockArticleEntity); |
|
|
|
|
lingdans.add(loadscanEntity); |
|
|
|
|
} else { |
|
|
|
|
//装车数量比计划数量少,这里才会进行一键装车数据修改
|
|
|
|
|
if (loadscanServiceOne.getPackageNub() <= parcelNumberVO.getReservationNum()) { |
|
|
|
@ -1912,6 +1920,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
loadscanServiceOne.setLoadedNub(parcelNumberVO.getReservationNum()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscanService.updateById(loadscanServiceOne); |
|
|
|
|
lingdans.add(loadscanServiceOne); |
|
|
|
|
distributionParcelNumberService.updateById(parcelNumberEntity); |
|
|
|
|
//维护零担订单在库 以及维护状态
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelNumberVO.getStockArticleId()); |
|
|
|
@ -1927,6 +1936,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
BigDecimal loadedNumber = new BigDecimal(signforEntity.getLoadedNumber()); |
|
|
|
|
signforEntity.setLoadedNumber(loadedNumber.subtract(packageLoadingNub).add(reservationNum).intValue()); |
|
|
|
|
distributionSignforService.updateById(signforEntity); |
|
|
|
|
lingdans.add(loadscanServiceOne); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -1987,6 +1997,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
loadscaninvnEntity.setLoadedNub(disStockListDetailEntity.getNum()); |
|
|
|
|
} |
|
|
|
|
distributionLoadscaninvnService.save(loadscaninvnEntity); |
|
|
|
|
kucuns.add(loadscaninvnEntity); |
|
|
|
|
//更新装车时间
|
|
|
|
|
Integer i = distributionDeliveryListMapper.updateloadingTimeById(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
//更新库存品装车数量
|
|
|
|
@ -2022,6 +2033,25 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
if (!logList.isEmpty()) { |
|
|
|
|
trunklinePackageTrackLogClient.addPackageTrackLog(logList); |
|
|
|
|
} |
|
|
|
|
DistributionDeliveryListVO deliveryList = distributionDeliveryListService.getDeliveryList(distrilbutionloadingscanDTO.getDeliveryId()); |
|
|
|
|
// 发送 订制品
|
|
|
|
|
if(Func.isNotEmpty(dingzhis)){ |
|
|
|
|
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByPackage(deliveryList, dingzhis); |
|
|
|
|
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser()); |
|
|
|
|
} |
|
|
|
|
if(Func.isNotEmpty(kucuns)){ |
|
|
|
|
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryList, kucuns); |
|
|
|
|
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser()); |
|
|
|
|
} |
|
|
|
|
if(Func.isNotEmpty(lingdans)){ |
|
|
|
|
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByZeroOrder(deliveryList, lingdans); |
|
|
|
|
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return Resp.scanSuccess("操作成功", "装车成功"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -2239,8 +2269,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// DistributionDeliveryListEntity deliveryListEntity = distributionDeliveryListService.getById(distrilbutionloadingscanDTO.getDeliveryId());
|
|
|
|
|
DistributionReservationEntity reservationEntity = distributionReservationService.getById(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
|
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(distributionDeliveryListEntity, reservationEntity, ts); |
|
|
|
|
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(distributionDeliveryListEntity, ts); |
|
|
|
|
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser()); |
|
|
|
|
String msg = getLoadingMsg(distrilbutionloadingscanDTO); |
|
|
|
|
return Resp.scanSuccess("扫描成功", msg); |
|
|
|
@ -9394,7 +9423,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib
|
|
|
|
|
inventoryJsonObject.put("remark", "装车下架"); |
|
|
|
|
jsonObjects.add(inventoryJsonObject); |
|
|
|
|
if (CollUtil.isNotEmpty(ts)) { |
|
|
|
|
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryListEntity, reservationEntity2, ts); |
|
|
|
|
NodeFanoutMsg<DistributionLoadVO> nodeFanoutMsg = buildNodeFanoutMsgByStock(deliveryListEntity, ts); |
|
|
|
|
distributionNodeWorkService.nodeLoading(nodeFanoutMsg, AuthUtil.getUser()); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|