Browse Source

1.修复干线bug

dist.1.3.0
zhenghaoyu 10 months ago
parent
commit
5158b58fe4
  1. 6
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java
  2. 45
      blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

6
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceServiceImpl.java

@ -980,7 +980,7 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
parcelListClient.addBatch(parcelListEntityList);
//把parcelListEntityList中所有元素以waubillId分组
Map<String,List<DistributionParcelListEntity>> parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getWaybillNumber));
Map<String,List<DistributionParcelListEntity>> parcelListEntityMap = parcelListEntityList.stream().filter(pl->!Objects.isNull(pl.getWaybillNumber())).collect(Collectors.groupingBy(DistributionParcelListEntity::getWaybillNumber));
List<WarehouseWaybillEntity> updateWaybillList = new ArrayList<>();
parcelListEntityMap.keySet().forEach(waybillNo->{
@ -997,7 +997,9 @@ public class TrunklineAdvanceServiceImpl extends BaseServiceImpl<TrunklineAdvanc
}
});
warehouseWaybillClient.updateList(updateWaybillList);
if(!updateWaybillList.isEmpty()){
warehouseWaybillClient.updateList(updateWaybillList);
}
orderCodeSet.forEach(orderCode->{
stockArticleClient.updateOrderInfo(orderCode,warehouseId);

45
blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java

@ -1442,18 +1442,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//把lineCarsOrderList中的所有运单号合并成一个集合
List<String> waybillNos = addList.stream().map(TrunklineCarsOrderDTO::getWaybillNo).collect(Collectors.toList());
if(waybillNos.isEmpty()){
log.warn("##########saveNew: 运单有变动,请重新做计划");
throw new CustomerException(400, "运单有变动,请重新做计划");
if(!waybillNos.isEmpty()){
List<WarehouseWaybillEntity> freezeOrAbolishWaybillList = warehouseWaybillClient.findFreezeOrAbolishByWaybillNos(waybillNos);
if (!CollUtil.isEmpty(freezeOrAbolishWaybillList)) {
log.warn("##########saveNew: 运单有变动,请重新做计划");
throw new CustomerException(400, "运单有变动,请重新做计划");
}
}
List<WarehouseWaybillEntity> freezeOrAbolishWaybillList = warehouseWaybillClient.findFreezeOrAbolishByWaybillNos(waybillNos);
if (!CollUtil.isEmpty(freezeOrAbolishWaybillList)) {
log.warn("##########saveNew: 运单有变动,请重新做计划");
throw new CustomerException(400, "运单有变动,请重新做计划");
}
for (TrunklineCarsOrderDTO trunklineCarsOrderDTO : addList) {
TrunklineCarsOrderEntity trunklineCarsOrderEntity = new TrunklineCarsOrderEntity();
BeanUtil.copy(trunklineCarsOrderDTO, trunklineCarsOrderEntity);
@ -2129,6 +2126,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
return R.fail(405, "包件已经装车到" + loadCode);
}
Integer realLoadingNumber = carsLoadEntity.getRealLoadingNumber();
String audio = "";
String loadCode = carsLoadEntity.getCarsNo();
Long waybillId = null;
String waybillNo = null;
@ -2178,6 +2178,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setIsData(0);
isData = 0;
remark = "无系统数据,异常装车";
audio = "系统无编码";
} else {
carsLoadScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode());
carsLoadScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo());
@ -2188,15 +2189,18 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
//未入库
log.warn("##################loadingScan: 包件暂未入库 orderPackageCode={}", orderPackageCode);
remark = "有系统数据,包件暂未入库";
audio = "包件未入库";
} else {
//已入库
String waybillNo1 = trunklineAdvanceDetailEntity.getWaybillNo();
if (StringUtil.isBlank(waybillNo1)) {
log.warn("##################loadingScan: 暂存单未开单 orderPackageCode={}", orderPackageCode);
remark = "有系统数据,暂存单未开单";
audio = "包件未开单";
} else {
log.warn("##################loadingScan: 包件暂未入到本仓 orderPackageCode={} warehouseId={}", orderPackageCode, warehouseId);
remark = "有系统数据,包件暂未入到本仓";
audio = "包件未入库";
}
}
}
@ -2246,6 +2250,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
distributionStockArticleClient.submitHandleNumByOrderId(1, articleId);
remark = "有数据,不在当前仓,异常装车";
audio = "包件未入库";
updownTypeClient.downPackageOrDelTray(orderPackageCode, fromWarehouseId, "干线装车下架解托");
}
@ -2294,6 +2299,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setLoadingAbnormal(1);
isAbnormal = 1;
remark = "有数据,在本仓,不在配载计划中,异常装车";
audio = "无计划装车";
} else {
//有计划
Integer planNum = carsOrderEntity.getPlanNum();
@ -2302,10 +2308,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
carsLoadScanEntity.setLoadingAbnormal(1);
isAbnormal = 1;
remark = "有数据,在本仓,在配载计划中,大于计划数量,异常装车";
audio = "大于计划数量装车";
} else {
carsLoadScanEntity.setLoadingAbnormal(0);
isAbnormal = 0;
remark = "正常装车";
audio = (realLoadingNumber+1)+"件";
}
Long finalNodeId = carsOrderEntity.getFinalNodeId();
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
@ -2353,7 +2361,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
}catch (Exception e){
log.error("推送数据失败",e);
}
return R.success("装车成功");
return Resp.scanFail(3001,"装车成功",audio);
// return Resp.scanSuccess("装车成功",audio);
}
private void pushFactoryOrderData(Long warehouseId, String orderPackageCode, String orderCode) {
@ -2425,6 +2434,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
log.warn("##################loadingZero: 订单信息不存在 stockArticleEntity={}", stockArticleEntity);
return R.fail(405, "订单信息不存在");
}
Integer realLoadingNumber = carsLoadEntity.getRealLoadingNumber();
Long fromWarehouseId = stockArticleEntity.getWarehouseId();
Long articleId = stockArticleEntity.getId();
Integer handQuantity = stockArticleEntity.getHandQuantity();
@ -2436,6 +2447,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
Long finalNodeId = null;
String finalNodeName = null;
String loadCode = carsLoadEntity.getCarsNo();
String audio = "";
//判断订单是否在计划当中
QueryWrapper<TrunklineCarsOrderEntity> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("load_id", loadId)
@ -2446,6 +2458,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (Objects.isNull(carsOrderEntity)) {
isAbnormal = 1;
remark = "有数据,无计划,异常装车";
audio = "无计划装车";
} else {
finalNodeId = carsOrderEntity.getFinalNodeId();
BasicdataWarehouseEntity finalNode = basicdataWarehouseClient.getEntityWarehouseId(finalNodeId);
@ -2475,6 +2488,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (enterNum + useNum > planNum) {
isAbnormal = 1;
remark = "有数据,有计划,大于计划件数,异常装车";
audio = "大于计划数量装车";
}
}
@ -2518,6 +2532,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
if (useNum - num + enterNum > planNum) {
isAbnormal = 1;
remark = "有数据,有计划,大于计划件数,异常装车";
audio = "大于计划数量装车";
}
}
@ -2527,11 +2542,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
distributionStockArticleClient.submitHandleNumByOrderId(difficult, articleId);
}
audio = (realLoadingNumber+enterNum)+"件";
trunklineCarsLoadingLogService.savaLoadingLog(warehouseId, warehouseName, loadId, loadCode, waybillId, waybillNo, orderCode, goodsName, difficult,
2, isData, isAbnormal, trayId, trayCode, trayName, fromWarehouseId, loadScanId, remark);
updateNumByLoadId(loadId);
return R.success("装车成功");
return Resp.scanFail(3001,"装车成功",audio);
}
@Override
@ -6100,6 +6117,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
newParcelListEntity.setWarehouseId(warehouseId);
newParcelListEntity.setWarehouse(warehouseName);
newParcelListEntity.setStockArticleId(orderId);
Long acceptWarehouseId = parcelListEntity.getAcceptWarehouseId();
if(warehouseId.equals(acceptWarehouseId)){
newParcelListEntity.setIsTransfer(0);
}else{
newParcelListEntity.setIsTransfer(1);
}
Long orderPackageId = distributionParcelListClient.addReturnId(newParcelListEntity);
DistributionParcelNumberEntity parcelNumberEntity = new DistributionParcelNumberEntity();

Loading…
Cancel
Save