|
|
|
@ -1719,6 +1719,22 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.data(pageList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public R startCarsBefore(Long loadId, Long warehouseId) { |
|
|
|
|
QueryWrapper<TrunklineCarsLoadScanEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("load_id",loadId); |
|
|
|
|
|
|
|
|
|
List<TrunklineCarsLoadScanEntity> carsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper); |
|
|
|
|
Integer loadingNum = carsLoadScanEntityList.stream().mapToInt(t -> Objects.nonNull(t.getNum()) ? t.getNum() : 0).sum(); |
|
|
|
|
Integer unloadNum = carsLoadScanEntityList.stream().mapToInt(t -> Objects.nonNull(t.getUnloadNum()) ? t.getUnloadNum() : 0).sum(); |
|
|
|
|
|
|
|
|
|
Map<String,Integer> map = new HashMap<>(); |
|
|
|
|
map.put("loadingNum",loadingNum); |
|
|
|
|
map.put("unloadNum",unloadNum); |
|
|
|
|
|
|
|
|
|
return R.data(map); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
@Override |
|
|
|
@ -2355,10 +2371,65 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
try { |
|
|
|
|
trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.FIRST_START_CARS_LOAD.getValue()); |
|
|
|
|
|
|
|
|
|
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId); |
|
|
|
|
openOrderAsyncService.saveTripartiteStartCarLog(carsLoadLineEntity, AuthUtil.getNickName(), AuthUtil.getUserId()); |
|
|
|
|
|
|
|
|
|
List<String> orderPackageCodes = new ArrayList<>(); |
|
|
|
|
List<String> noUnloadOrderPackageCodes = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
//处理三方中转未卸车数据
|
|
|
|
|
QueryWrapper<TrunklineCarsLoadScanEntity> queryWrapper = new QueryWrapper<>(); |
|
|
|
|
queryWrapper.eq("load_id",loadId); |
|
|
|
|
List<TrunklineCarsLoadScanEntity> carsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper); |
|
|
|
|
//把carsLoadScanEntityList中所有元素通过type进行分组
|
|
|
|
|
//通过type分组区分零担和包件
|
|
|
|
|
Map<Integer, List<TrunklineCarsLoadScanEntity>> carsLoadScanEntityMap = carsLoadScanEntityList.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getType)); |
|
|
|
|
carsLoadScanEntityMap.keySet().forEach(type -> { |
|
|
|
|
List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities = carsLoadScanEntityMap.get(type); |
|
|
|
|
if(type == 1){ |
|
|
|
|
//包件
|
|
|
|
|
trunklineCarsLoadScanEntities.forEach(trunklineCarsLoadScanEntity -> { |
|
|
|
|
String scanCode = trunklineCarsLoadScanEntity.getScanCode(); |
|
|
|
|
Integer num = trunklineCarsLoadScanEntity.getNum(); |
|
|
|
|
Integer unloadNum = trunklineCarsLoadScanEntity.getUnloadNum(); |
|
|
|
|
Integer isData = trunklineCarsLoadScanEntity.getIsData(); |
|
|
|
|
if(unloadNum == num){ |
|
|
|
|
orderPackageCodes.add(scanCode); |
|
|
|
|
}else{ |
|
|
|
|
//未卸车包件
|
|
|
|
|
if(isData == 1){ |
|
|
|
|
noUnloadOrderPackageCodes.add(scanCode); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}else if(type == 2){ |
|
|
|
|
//零担
|
|
|
|
|
//把trunklineCarsLoadScanEntities通过orderCode进行分组
|
|
|
|
|
//通过orderCode分组
|
|
|
|
|
Map<String, List<TrunklineCarsLoadScanEntity>> orderCodeMap = trunklineCarsLoadScanEntities.stream().collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getOrderCode)); |
|
|
|
|
orderCodeMap.keySet().forEach(orderCode -> { |
|
|
|
|
List<TrunklineCarsLoadScanEntity> trunklineCarsLoadScanEntities1 = orderCodeMap.get(orderCode); |
|
|
|
|
Integer loadingNum = trunklineCarsLoadScanEntities1.stream().mapToInt(t -> Objects.nonNull(t.getNum()) ? t.getNum() : 0).sum(); |
|
|
|
|
Integer unloadNum = trunklineCarsLoadScanEntities1.stream().mapToInt(t -> Objects.nonNull(t.getUnloadNum()) ? t.getUnloadNum() : 0).sum(); |
|
|
|
|
int i = loadingNum - unloadNum; |
|
|
|
|
|
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if(!Objects.isNull(stockArticleEntity)){ |
|
|
|
|
distributionStockArticleClient.addHandQuantity(stockArticleEntity.getId(), i); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(orderPackageCodes)){ |
|
|
|
|
String content = "包件在 " + warehouseEntity.getName() + "三方中转发车"; |
|
|
|
|
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.TRIPARTITE_TRANSFER_DEPART.getCode(), content); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(CollUtil.isNotEmpty(noUnloadOrderPackageCodes)){ |
|
|
|
|
String content = "包件在 " + warehouseEntity.getName() + "三方中转取消装车"; |
|
|
|
|
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), noUnloadOrderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.CANCEL_INITIAL_WAREHOUSE_LOADING.getCode(), content); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.warn("#############startCarByLoadId: 存入日志失败"); |
|
|
|
@ -2493,6 +2564,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.END_ARRIVE_CARS_LOAD.getValue()); |
|
|
|
|
List<String> orderPackageCodes = trunklineCarsLoadScanService.findPackageListByLoadId(loadId); |
|
|
|
|
|
|
|
|
|
openOrderAsyncService.saveTripartiteArriveCarLog(carsLoadLineEntity,AuthUtil.getNickName(),AuthUtil.getUserId()); |
|
|
|
|
|
|
|
|
|
String content = "包件在 " + warehouseEntity.getName() + "三方中转到达"; |
|
|
|
|
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.ARRICE_TRIPARTITE_TRANSFER_DEPART.getCode(), content); |
|
|
|
|
|
|
|
|
@ -2535,27 +2608,30 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
throw new CustomerException(400, "三方中转节点不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
carsLoadEntity.setSignTime(new Date()); |
|
|
|
|
carsLoadEntity.setLoadStatus("90"); |
|
|
|
|
updateById(carsLoadEntity); |
|
|
|
|
|
|
|
|
|
trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3", new Date(),AuthUtil.getNickName()); |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SIGN.getValue()); |
|
|
|
|
List<Long> scanLoadIds = trunklineCarsLoadScanService.findAllIdListByLoadIdAndNoScanStatus(loadId,"3"); |
|
|
|
|
|
|
|
|
|
List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodes(loadId); |
|
|
|
|
return signLoadScanByIds(scanLoadIds,warehouseId); |
|
|
|
|
|
|
|
|
|
String content = "包件在" + warehouseEntity.getName() + "被三方中转整车签收"; |
|
|
|
|
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode(), content); |
|
|
|
|
// 推送签收数据给工厂
|
|
|
|
|
sendFactorySignTriparite(warehouseId, orderPackageCodes, warehouseEntity); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.warn("###########存入日志失败"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.success("签收成功"); |
|
|
|
|
// carsLoadEntity.setSignTime(new Date());
|
|
|
|
|
// carsLoadEntity.setLoadStatus("90");
|
|
|
|
|
// updateById(carsLoadEntity);
|
|
|
|
|
//
|
|
|
|
|
// trunklineCarsLoadScanService.updateScanStatusByLoadId(loadId, "3", new Date(),AuthUtil.getNickName());
|
|
|
|
|
//
|
|
|
|
|
// try {
|
|
|
|
|
// trunklineCarsLoadLogService.saveLog(carsLoadEntity, carsLoadLineEntity, CarsLoadLogTypeConstant.TRIPARTITE_TRANSFER_SIGN.getValue());
|
|
|
|
|
//
|
|
|
|
|
// List<String> orderPackageCodes = trunklineCarsLoadScanService.findSignListOrderPackageCodes(loadId);
|
|
|
|
|
//
|
|
|
|
|
// String content = "包件在" + warehouseEntity.getName() + "被三方中转整车签收";
|
|
|
|
|
// packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_TRIPARTITE_TRANSFER_DEPART.getCode(), content);
|
|
|
|
|
// // 推送签收数据给工厂
|
|
|
|
|
// sendFactorySignTriparite(warehouseId, orderPackageCodes, warehouseEntity);
|
|
|
|
|
// } catch (Exception e) {
|
|
|
|
|
// log.warn("###########存入日志失败");
|
|
|
|
|
// }
|
|
|
|
|
// return R.success("签收成功");
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -3647,6 +3723,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
log.warn("##########addZeroSupple: 配载计划信息不存在 loadId={}", loadId); |
|
|
|
|
return R.fail(405, "配载计划信息不存在"); |
|
|
|
|
} |
|
|
|
|
String carsNo = carsLoadEntity.getCarsNo(); |
|
|
|
|
String carNumber = carsLoadEntity.getCarNumber(); |
|
|
|
|
String driverName = carsLoadEntity.getDriverName(); |
|
|
|
|
String driverMobile = carsLoadEntity.getDriverMobile(); |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadLineEntity carsLoadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); |
|
|
|
|
if (Objects.isNull(carsLoadLineEntity)) { |
|
|
|
@ -3654,6 +3734,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.fail(405, "配载计划节点信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); |
|
|
|
|
if(Objects.isNull(warehouseEntity)){ |
|
|
|
|
log.warn("##########addZeroSupple: 仓库信息不存在 warehouseId={}", warehouseId); |
|
|
|
|
return R.fail(405, "仓库信息不存在"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
String warehouseName = warehouseEntity.getName(); |
|
|
|
|
|
|
|
|
|
for (ZeroSuppleVO zeroSuppleVO : zeroSuppleList) { |
|
|
|
|
String waybillNo = zeroSuppleVO.getWaybillNo(); |
|
|
|
|
String orderCode = zeroSuppleVO.getOrderCode(); |
|
|
|
@ -3666,6 +3754,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
log.warn("##########addZeroSupple: 运单信息不存在 loadId={} waybillNo={}", loadId, waybillNo); |
|
|
|
|
return R.fail(405, "运单信息不存在"); |
|
|
|
|
} |
|
|
|
|
Long waybillId = warehouseWaybillEntity.getId(); |
|
|
|
|
|
|
|
|
|
DistributionStockArticleEntity zeroStockArticleEntity = distributionStockArticleClient.findZeroByOrderCodeAndWarehouseId(orderCode, warehouseId); |
|
|
|
|
if (Objects.isNull(zeroStockArticleEntity)) { |
|
|
|
@ -3707,6 +3796,11 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
distributionStockArticleClient.saveOrUpdate(zeroStockArticleEntity); |
|
|
|
|
|
|
|
|
|
waybillPackageService.updateWaybillStatus(warehouseWaybillEntity); |
|
|
|
|
|
|
|
|
|
String operationRemark = "运单 补录装车"+enterNum+"件 干线批次号:"+carsNo+",车牌号:"+carNumber+",司机姓名:"+driverName+",司机手机:"+driverMobile; |
|
|
|
|
openOrderAsyncService.saveLog(waybillId,waybillNo,"30",warehouseName+" 干线补录装车",operationRemark,AuthUtil.getNickName(),AuthUtil.getUserId(),warehouseId,warehouseName); |
|
|
|
|
|
|
|
|
|
if(!Objects.isNull(signOrderId)){ |
|
|
|
|
updateSignOrderNumBySignOrderId(signOrderId); |
|
|
|
|
// TrunklineLoadSignOrderEntity signOrderEntity = trunklineLoadSignOrderService.getById(signOrderId);
|
|
|
|
@ -5202,6 +5296,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
log.warn("##############signScanPackageCode: 仓库信息不存在 warehouseId={}", warehouseId); |
|
|
|
|
return R.fail(405, "仓库信息不存在"); |
|
|
|
|
} |
|
|
|
|
String warehouseName = warehouseEntity.getName(); |
|
|
|
|
|
|
|
|
|
TrunklineCarsLoadEntity carsLoadEntity = baseMapper.selectById(loadId); |
|
|
|
|
if (Objects.isNull(carsLoadEntity)) { |
|
|
|
@ -5211,6 +5306,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
String carsNo = carsLoadEntity.getCarsNo(); |
|
|
|
|
|
|
|
|
|
Long waybillId = null; |
|
|
|
|
|
|
|
|
|
Date date = new Date(); |
|
|
|
|
TrunklineCarsLoadScanEntity carsLoadScanEntity = trunklineCarsLoadScanService.findEntityByLoadIdAndOrderPackageCode(loadId, orderPackageCode); |
|
|
|
|
if (Objects.isNull(carsLoadScanEntity)) { |
|
|
|
@ -5230,6 +5327,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
inComingService.incomingPackage(inComingDTO); |
|
|
|
|
|
|
|
|
|
String orderCode = trunklineAdvanceDetail.getOrderCode(); |
|
|
|
|
String waybillNo = trunklineAdvanceDetail.getWaybillNo(); |
|
|
|
|
waybillId = trunklineAdvanceDetail.getWaybillId(); |
|
|
|
|
|
|
|
|
|
DistributionParcelListEntity distributionParcelList = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId); |
|
|
|
|
if(!Objects.isNull(distributionParcelList)){ |
|
|
|
@ -5248,6 +5347,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
carsLoadScanEntity.setLoadCode(carsNo); |
|
|
|
|
carsLoadScanEntity.setWarehouseId(warehouseId); |
|
|
|
|
carsLoadScanEntity.setWarehouseName(warehouseEntity.getName()); |
|
|
|
|
carsLoadScanEntity.setOrderCode(orderCode); |
|
|
|
|
carsLoadScanEntity.setWaybillId(waybillId); |
|
|
|
|
carsLoadScanEntity.setWaybillNo(waybillNo); |
|
|
|
|
carsLoadScanEntity.setScanCode(orderPackageCode); |
|
|
|
|
carsLoadScanEntity.setScanStatus("3"); |
|
|
|
|
carsLoadScanEntity.setNum(1); |
|
|
|
@ -5294,7 +5396,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Long wid = parcelListEntity.getWarehouseId(); |
|
|
|
|
String wName = parcelListEntity.getWarehouse(); |
|
|
|
|
String waybillNumber = parcelListEntity.getWaybillNumber(); |
|
|
|
|
Long waybillId = parcelListEntity.getWaybillId(); |
|
|
|
|
waybillId = parcelListEntity.getWaybillId(); |
|
|
|
|
String orderCode = parcelListEntity.getOrderCode(); |
|
|
|
|
Long stockArticleId = parcelListEntity.getStockArticleId(); |
|
|
|
|
DistributionStockArticleEntity stockArticleEntity = distributionStockArticleClient.findEntityByStockArticleId(stockArticleId); |
|
|
|
@ -5399,6 +5501,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
carsLoadScanEntity.setSignAbnormal(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
waybillId = carsLoadScanEntity.getWaybillId(); |
|
|
|
|
|
|
|
|
|
// Long wid = carsLoadScanEntity.getWarehouseId();
|
|
|
|
|
// if (!wid.equals(warehouseId)) {
|
|
|
|
|
// log.warn("##############signScanPackageCode: 包件不在签收计划中 loadId={},orderPackageCode={} scanStatus={}", loadId, orderPackageCode, scanStatus);
|
|
|
|
@ -5426,6 +5530,26 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
List<String> orderPackageCodes = new ArrayList<>(); |
|
|
|
|
try { |
|
|
|
|
// if(!Objects.isNull(waybillId)){
|
|
|
|
|
// WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId);
|
|
|
|
|
// waybillPackageService.updateWaybillStatus(waybillEntity);
|
|
|
|
|
// WaybillLogDTO waybillLogDTO = new WaybillLogDTO();
|
|
|
|
|
// waybillLogDTO.setWarehouseId(warehouseId);
|
|
|
|
|
// waybillLogDTO.setWarehouseName(warehouseName);
|
|
|
|
|
// waybillLogDTO.setWaybillNo(waybillEntity.getWaybillNo());
|
|
|
|
|
// waybillLogDTO.setTrainNumber(carsLoadEntity.getCarsNo());
|
|
|
|
|
// waybillLogDTO.setCarNumber(carsLoadEntity.getCarNumber());
|
|
|
|
|
// waybillLogDTO.setSignUser(AuthUtil.getNickName());
|
|
|
|
|
// waybillLogDTO.setSignTime(date);
|
|
|
|
|
// waybillLogDTO.setDriverName(carsLoadEntity.getDriverName());
|
|
|
|
|
// waybillLogDTO.setNum(unloadNum);
|
|
|
|
|
// waybillLogDTO.setSignOrderCode(carsLoadEntity.getCarsNo());
|
|
|
|
|
// waybillLogDTO.setType(1);
|
|
|
|
|
// waybillLogDTO.setUserId(AuthUtil.getUserId());
|
|
|
|
|
// waybillLogDTO.setNickName(AuthUtil.getNickName());
|
|
|
|
|
// waybillTrackService.addSignWaybillLog(waybillLogDTO);
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
orderPackageCodes.add(orderPackageCode); |
|
|
|
|
String content = "包件在 " + warehouseEntity.getName() + "直发商家签收"; |
|
|
|
|
packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseEntity.getName(), WorkNodeEnums.SIGN_DIRECT_SHIPPER.getCode(), content); |
|
|
|
@ -5473,10 +5597,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
if (signNum >= loadingNum) { |
|
|
|
|
signOrderEntity.setSignStatus("20"); |
|
|
|
|
signOrderEntity.setSignTime(new Date()); |
|
|
|
|
} else { |
|
|
|
|
if(signNum == 0){ |
|
|
|
|
signOrderEntity.setSignStatus("0"); |
|
|
|
|
}else{ |
|
|
|
|
signOrderEntity.setSignStatus("10"); |
|
|
|
|
signOrderEntity.setSignTime(new Date()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
trunklineLoadSignOrderService.updateById(signOrderEntity); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
@ -5528,6 +5656,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
return R.fail(405, "签收数量不能大于当前数据的装车数量"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
carsLoadScanEntity.setScanStatus("3"); |
|
|
|
|
carsLoadScanEntity.setUnloadNum(enterNum); |
|
|
|
|
carsLoadScanEntity.setUnloadAbnormal(0); |
|
|
|
@ -5550,6 +5680,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
//重新计算签收单的数量
|
|
|
|
|
updateSignOrderNumBySignOrderId(signOrderId); |
|
|
|
|
|
|
|
|
|
Long waybillId = carsLoadScanEntity.getWaybillId(); |
|
|
|
|
if(!Objects.isNull(waybillId)){ |
|
|
|
|
WarehouseWaybillEntity waybillEntity = warehouseWaybillClient.findByWaybillId(waybillId); |
|
|
|
|
waybillPackageService.updateWaybillStatus(waybillEntity); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// return Resp.scanSuccess("签收成功",enterNum+"件");
|
|
|
|
|
return R.success("签收成功"); |
|
|
|
|
|
|
|
|
@ -6028,6 +6164,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer realLoadingNumber = carsLoadEntity.getRealLoadingNumber(); |
|
|
|
|
String deliveryType = carsLoadEntity.getDeliveryType(); |
|
|
|
|
|
|
|
|
|
BasicdataWarehouseEntity warehouseEntity = basicdataWarehouseClient.getEntityWarehouseId(warehouseId); |
|
|
|
|
if (Objects.isNull(warehouseEntity)) { |
|
|
|
@ -6067,9 +6204,14 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
Map<String, List<TrunklineCarsLoadScanEntity>> map = trunklineCarsLoadScanEntities.stream().filter(t -> Objects.nonNull(t.getWaybillNo())).collect(Collectors.groupingBy(TrunklineCarsLoadScanEntity::getWaybillNo)); |
|
|
|
|
map.keySet().forEach(waybillNo -> { |
|
|
|
|
List<TrunklineCarsLoadScanEntity> list = map.get(waybillNo); |
|
|
|
|
//把list中所有元素的unloadNum求和,没有值就取0
|
|
|
|
|
Integer unloadNum = list.stream().mapToInt(t -> Objects.nonNull(t.getUnloadNum()) ? t.getUnloadNum() : 0).sum(); |
|
|
|
|
Integer signNum = 0; |
|
|
|
|
if("1".equals(deliveryType)){ |
|
|
|
|
signNum = list.stream().mapToInt(t -> Objects.nonNull(t.getNum()) ? t.getNum() : 0).sum(); |
|
|
|
|
}else if("2".equals(deliveryType)){ |
|
|
|
|
signNum = list.stream().mapToInt(t -> Objects.nonNull(t.getUnloadNum()) ? t.getUnloadNum() : 0).sum(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(signNum > 0){ |
|
|
|
|
WaybillLogDTO waybillLogDTO = new WaybillLogDTO(); |
|
|
|
|
waybillLogDTO.setWarehouseId(warehouseId); |
|
|
|
|
waybillLogDTO.setWarehouseName(warehouseName); |
|
|
|
@ -6079,14 +6221,15 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
waybillLogDTO.setSignUser(AuthUtil.getNickName()); |
|
|
|
|
waybillLogDTO.setSignTime(date); |
|
|
|
|
waybillLogDTO.setDriverName(carsLoadEntity.getDriverName()); |
|
|
|
|
waybillLogDTO.setNum(unloadNum); |
|
|
|
|
waybillLogDTO.setNum(signNum); |
|
|
|
|
waybillLogDTO.setSignOrderCode(carsLoadEntity.getCarsNo()); |
|
|
|
|
waybillLogDTO.setType(1); |
|
|
|
|
waybillLogDTO.setUserId(AuthUtil.getUserId()); |
|
|
|
|
waybillLogDTO.setNickName(AuthUtil.getNickName()); |
|
|
|
|
waybillTrackService.addSignWaybillLog(waybillLogDTO); |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
log.warn("###########存入日志失败"); |
|
|
|
@ -6395,7 +6538,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl<TrunklineCarsL
|
|
|
|
|
List<WaybillLogDTO> waybillLogDTOList = new ArrayList<>(); |
|
|
|
|
|
|
|
|
|
QueryWrapper<TrunklineCarsLoadScanEntity> queryWrapper1 = new QueryWrapper<>(); |
|
|
|
|
queryWrapper1.eq("load_id",warehouseId) |
|
|
|
|
queryWrapper1.eq("load_id",loadId) |
|
|
|
|
.eq("sign_order_id",signOrderId) |
|
|
|
|
.eq("scan_status","3"); |
|
|
|
|
List<TrunklineCarsLoadScanEntity> signCarsLoadScanEntityList = trunklineCarsLoadScanService.list(queryWrapper1); |
|
|
|
|