|
|
@ -612,6 +612,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
//不存在配送计划中,这里进行客户的判断
|
|
|
|
//不存在配送计划中,这里进行客户的判断
|
|
|
|
} |
|
|
|
} |
|
|
|
} else if (distrilbutionloadingscanDTO.getType() == 2) { |
|
|
|
} else if (distrilbutionloadingscanDTO.getType() == 2) { |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 000000000 type={}",distrilbutionloadingscanDTO.getType()); |
|
|
|
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(distrilbutionloadingscanDTO.getBarcode()); |
|
|
|
TrayTypeDataVO trayTypeDataVO = warehouseTrayTypeClient.selectListByTrayCode(distrilbutionloadingscanDTO.getBarcode()); |
|
|
|
if (Func.isNotEmpty(trayTypeDataVO)) { |
|
|
|
if (Func.isNotEmpty(trayTypeDataVO)) { |
|
|
|
List<WarehouseTrayGoodsEntity> voGoodsLsit = trayTypeDataVO.getGoodsLsit(); |
|
|
|
List<WarehouseTrayGoodsEntity> voGoodsLsit = trayTypeDataVO.getGoodsLsit(); |
|
|
@ -626,37 +627,45 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
//判断该货物都属于同一客户才能进行装车
|
|
|
|
//判断该货物都属于同一客户才能进行装车
|
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId()); |
|
|
|
boolean isBelongToReservation = parcelListEntities.stream().allMatch(tp -> parcelListEntityList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(tp.getId())); |
|
|
|
boolean isBelongToReservation = parcelListEntities.stream().allMatch(tp -> parcelListEntityList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()).contains(tp.getId())); |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 111111111 isBelongToReservation={}",isBelongToReservation); |
|
|
|
if (isBelongToReservation) { |
|
|
|
if (isBelongToReservation) { |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 222222222"); |
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
List<DistributionLoadscanEntity> loadscanEntityList = distributionLoadscanService.list(Wrappers.<DistributionLoadscanEntity>query().lambda() |
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) |
|
|
|
.eq(DistributionLoadscanEntity::getDeliveryId, distrilbutionloadingscanDTO.getDeliveryId()) |
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, 1) |
|
|
|
.ne(DistributionLoadscanEntity::getScanStatus, 1) |
|
|
|
.eq(DistributionLoadscanEntity::getTrayNo, distrilbutionloadingscanDTO.getBarcode())); |
|
|
|
.eq(DistributionLoadscanEntity::getTrayNo, distrilbutionloadingscanDTO.getBarcode())); |
|
|
|
boolean trayLoadingStatus = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); |
|
|
|
boolean trayLoadingStatus = parcelListEntities.stream().allMatch(p -> p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 333333333 trayLoadingStatus={} loadscanEntityList={}",trayLoadingStatus,loadscanEntityList); |
|
|
|
if (Func.isNotEmpty(loadscanEntityList) && loadscanEntityList.size() > 0 && trayLoadingStatus) { |
|
|
|
if (Func.isNotEmpty(loadscanEntityList) && loadscanEntityList.size() > 0 && trayLoadingStatus) { |
|
|
|
return Resp.scanFail("重复扫描", "重复扫描"); |
|
|
|
return Resp.scanFail("重复扫描", "重复扫描"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 444444444 parcelListEntities={}",parcelListEntities); |
|
|
|
if (Func.isEmpty(parcelListEntities) || parcelListEntities.size() <= 0) { |
|
|
|
if (Func.isEmpty(parcelListEntities) || parcelListEntities.size() <= 0) { |
|
|
|
return Resp.scanFail("操作失败", "该托盘上无货物信息"); |
|
|
|
return Resp.scanFail("操作失败", "该托盘上无货物信息"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 55555555555 distrilbutionloadingscanDTO={}",distrilbutionloadingscanDTO); |
|
|
|
if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())) { |
|
|
|
if (Func.isNotEmpty(distrilbutionloadingscanDTO.getReservationId())) { |
|
|
|
//存在客户 这里就是针对客户进行的整托装车
|
|
|
|
//存在客户 这里就是针对客户进行的整托装车
|
|
|
|
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
|
|
|
|
// List<DistributionParcelListEntity> parcelListEntityList = distributionReservationMapper.selectPackageListByReservationId(distrilbutionloadingscanDTO.getReservationId());
|
|
|
|
Map<Long, DistributionParcelListEntity> parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2)); |
|
|
|
Map<Long, DistributionParcelListEntity> parcelListEntityMap = parcelListEntityList.stream().collect(Collectors.toMap(DistributionParcelListEntity::getId, Function.identity(), (k1, k2) -> k2)); |
|
|
|
boolean reservationFlag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(parcelListEntityMap.get(p.getId()))); |
|
|
|
boolean reservationFlag = parcelListEntities.stream().allMatch(p -> Func.isNotEmpty(parcelListEntityMap.get(p.getId()))); |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 6666666666 reservationFlag={}",reservationFlag); |
|
|
|
if (reservationFlag) { |
|
|
|
if (reservationFlag) { |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
warehouseUpdownTypeClient.downTray(distrilbutionloadingscanDTO.getBarcode(),myCurrentWarehouse.getId()); |
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
|
|
log.error("#################货物下架错误:{}",distrilbutionloadingscanDTO.getBarcode()); |
|
|
|
|
|
|
|
// return Resp.scanFail("装车失败", "装车失败");
|
|
|
|
|
|
|
|
} |
|
|
|
List<DistributionLoadscanEntity> reservationLoadscanEntities = new ArrayList<>(); |
|
|
|
List<DistributionLoadscanEntity> reservationLoadscanEntities = new ArrayList<>(); |
|
|
|
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { |
|
|
|
for (DistributionParcelListEntity parcelListEntity : parcelListEntities) { |
|
|
|
try { |
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 88888888888 parcelListEntities={}",parcelListEntities); |
|
|
|
warehouseUpdownTypeClient.downTray(parcelListEntity.getOrderPackageCode(),myCurrentWarehouse.getId()); |
|
|
|
|
|
|
|
}catch (Exception e){ |
|
|
|
|
|
|
|
log.error("#################货物下架错误:{}",parcelListEntity.getOrderPackageCode()); |
|
|
|
|
|
|
|
return Resp.scanFail("装车失败", "装车失败"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) { |
|
|
|
if (parcelListEntity.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.weizhuancghe.getValue())) { |
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); |
|
|
|
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); |
|
|
|
parcelListEntity.setOrderPackageStatus(OrderPackageStatusConstant.yichuku.getValue()); |
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
distributionParcelListService.updateById(parcelListEntity); |
|
|
|
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
DistributionLoadscanEntity loadscanEntity = new DistributionLoadscanEntity(); |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 77777777777 distributionDeliverySelfEntity={}",distributionDeliverySelfEntity); |
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) { |
|
|
|
if (Func.isNotEmpty(distributionDeliverySelfEntity.getDeliveryId())) { |
|
|
|
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
loadscanEntity.setDriverId(distributionDeliverySelfEntity.getDriverId()); |
|
|
|
} |
|
|
|
} |
|
|
@ -685,7 +694,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); |
|
|
|
loadscanEntity.setLoadingId(distrilbutionloadingscanDTO.getLoadingId()); |
|
|
|
loadscanEntity.setOneClick(1); |
|
|
|
loadscanEntity.setOneClick(1); |
|
|
|
loadscanEntity.setScanType("2"); |
|
|
|
loadscanEntity.setScanType("2"); |
|
|
|
loadscanEntity.setScanStatus("1"); |
|
|
|
loadscanEntity.setScanStatus("2"); |
|
|
|
loadscanEntity.setIsInsert(1); |
|
|
|
loadscanEntity.setIsInsert(1); |
|
|
|
loadscanEntity.setMsg("司机按照预约整托装车"); |
|
|
|
loadscanEntity.setMsg("司机按照预约整托装车"); |
|
|
|
loadscanEntity.setTrayNo(trayTypeDataVO.getTrayCode()); |
|
|
|
loadscanEntity.setTrayNo(trayTypeDataVO.getTrayCode()); |
|
|
@ -700,14 +709,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
distributionLoadscanService.saveBatch(reservationLoadscanEntities); |
|
|
|
distributionLoadscanService.saveBatch(reservationLoadscanEntities); |
|
|
|
//这里则进行整托装车的数据构建
|
|
|
|
//这里则进行整托装车的数据构建
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 101010101010 存在其他客户货物"); |
|
|
|
return Resp.scanFail("整托装车失败", "存在其他客户货物"); |
|
|
|
return Resp.scanFail("整托装车失败", "存在其他客户货物"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 101010101010 存在其他客户货物"); |
|
|
|
return Resp.scanFail("整托装车失败", "存在其他客户货物"); |
|
|
|
return Resp.scanFail("整托装车失败", "存在其他客户货物"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}else { |
|
|
|
}else { |
|
|
|
|
|
|
|
log.info("#########!!!!!!!!!!!!!!!!!--------- 101010101010 查询托盘货物失败"); |
|
|
|
return Resp.scanFail("查询托盘货物失败", "查询托盘货物失败"); |
|
|
|
return Resp.scanFail("查询托盘货物失败", "查询托盘货物失败"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -5614,6 +5626,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) { |
|
|
|
for (DistributionReservationEntity distributionReservationEntity : distributionReservationEntityList) { |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
Map<String, Object> map = new HashMap<>(); |
|
|
|
log.debug(">>>> distributionReservationEntity {}", distributionReservationEntity); |
|
|
|
log.debug(">>>> distributionReservationEntity {}", distributionReservationEntity); |
|
|
|
|
|
|
|
map.put("车次号", byId.getTrainNumber()); |
|
|
|
map.put("配送单号", distributionReservationEntity.getReservationCode()); |
|
|
|
map.put("配送单号", distributionReservationEntity.getReservationCode()); |
|
|
|
String fileTypeName = QRCodeUtil.createCodeToFile(distributionReservationEntity.getReservationCode()); |
|
|
|
String fileTypeName = QRCodeUtil.createCodeToFile(distributionReservationEntity.getReservationCode()); |
|
|
|
map.put("配送单二维码", QRCodeUtil.getEmpAutograph(fileTypeName)); |
|
|
|
map.put("配送单二维码", QRCodeUtil.getEmpAutograph(fileTypeName)); |
|
|
@ -5621,8 +5634,14 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl<Distrib |
|
|
|
// todo 查询运单的收货人电话
|
|
|
|
// todo 查询运单的收货人电话
|
|
|
|
map.put("商场名称", distributionReservationEntity.getMallName()); |
|
|
|
map.put("商场名称", distributionReservationEntity.getMallName()); |
|
|
|
map.put("商场电话", distributionReservationEntity.getReservationCode()); |
|
|
|
map.put("商场电话", distributionReservationEntity.getReservationCode()); |
|
|
|
|
|
|
|
String taskTime = byId.getTaskTime(); |
|
|
|
|
|
|
|
log.info("#############送货日期: id={} taskTime={}",id,taskTime); |
|
|
|
|
|
|
|
String periodOfTime = distributionReservationEntity.getPeriodOfTime(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String period = DictBizCache.getValue("period_of_time", periodOfTime); |
|
|
|
|
|
|
|
|
|
|
|
map.put("送货日期", DateUtil.format(distributionReservationEntity.getReservationDate(), "yyyy-MM-dd") + " 全天"); |
|
|
|
map.put("预约单创建时间", DateUtil.format(distributionReservationEntity.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); |
|
|
|
|
|
|
|
map.put("预约单送货日期", DateUtil.format(distributionReservationEntity.getReservationDate(), "yyyy-MM-dd") + " " +period); |
|
|
|
|
|
|
|
|
|
|
|
map.put("客户名称", distributionReservationEntity.getConsignee()); |
|
|
|
map.put("客户名称", distributionReservationEntity.getConsignee()); |
|
|
|
|
|
|
|
|
|
|
|