diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml index a4ee0e5a6..cb89d8718 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockArticleMapper.xml @@ -616,28 +616,27 @@ LEFT JOIN logpm_distribution_parcel_list ldpl on ldsa.id = ldpl.stock_article_id LEFT JOIN logpm_warehouse_tray_goods lwtg on lwtg.association_id = ldpl.id LEFT JOIN logpm_warehouse_updown_goods lwug on lwug.association_id = ldpl.id - LEFT JOIN - (SELECT ldsaa.id,SUM(ldpll.quantity) AS num - FROM logpm_distribution_stock_article ldsaa - LEFT JOIN logpm_distribution_parcel_list ldpll ON ldsaa.id = ldpll.stock_article_id - WHERE ldpll.order_package_loading_status != '20' - AND ldpll.order_package_reservation_status !='20' - AND ldpll.order_package_status != '70' - AND ldpll.conditions != 2 - AND ldsaa.warehouse_id = #{par.warehouseId} - AND ldpll.warehouse_id = #{par.warehouseId} - AND ldsaa.type_service = #{par.typeService} - - and ldsaa.order_code like concat(#{par.orderCode},'%') - - GROUP BY ldsaa.id - ) - AS t ON t.id = ldsa.id ldsa.order_status in ('10','20','30','70') and ldsa.reservation_status in ('10','20') - and t.num > 0 - + AND EXISTS ( + SELECT 1 + FROM logpm_distribution_parcel_list ldpll + WHERE + ldsa.id = ldpll.stock_article_id + + AND ldpll.order_package_loading_status != '20' + AND ldpll.order_package_reservation_status != '20' + AND ldpll.order_package_status != '70' + AND ldpll.conditions != 2 + AND ldpll.warehouse_id = #{par.warehouseId} + AND ldsa.type_service = #{par.typeService} + + and ldpll.order_code like concat(#{par.orderCode},'%') + + GROUP BY ldpll.stock_article_id + HAVING SUM(ldpll.quantity) > 0 + ) AND ldsa.hand_quantity > 0 and ldsa.warehouse_id = #{par.warehouseId} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index 62d9b0ff6..950a1d84d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java @@ -114,57 +114,57 @@ import java.util.stream.Collectors; public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl implements IDistrilbutionBillLadingService { @Autowired - private IDistributionDeliveryChargeService distributionDeliveryChargeService; + private IDistributionDeliveryChargeService distributionDeliveryChargeService; @Autowired - private IDistributionDeliveryDetailsService distributionDeliveryDetailsService; + private IDistributionDeliveryDetailsService distributionDeliveryDetailsService; @Autowired - private IDistributionReservationService distributionReservationService; + private IDistributionReservationService distributionReservationService; @Autowired - private IDistributionPrintService distributionPrintService; + private IDistributionPrintService distributionPrintService; @Autowired - private IDistributionStockArticleService distributionStockArticleService; + private IDistributionStockArticleService distributionStockArticleService; @Autowired - private IDistributionParcelListService distributionParcelListService; + private IDistributionParcelListService distributionParcelListService; @Autowired - private IDistributionBillLadingScanService distributionBillLadingScanService; + private IDistributionBillLadingScanService distributionBillLadingScanService; @Autowired - private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper; + private DistrilbutionBillLadingMapper distrilbutionBillLadingMapper; @Autowired - private IDistrilbutionBillStockService distrilbutionBillStockService; + private IDistrilbutionBillStockService distrilbutionBillStockService; @Autowired - private IDistributionStockupScanService distributionStockupScanService; + private IDistributionStockupScanService distributionStockupScanService; @Autowired - private IDistributionStockListService distributionStockListService; + private IDistributionStockListService distributionStockListService; @Autowired - private DistributionStockListMapper distributionStockListMapper; + private DistributionStockListMapper distributionStockListMapper; @Autowired - private IDistributionAsyncService distributionAsyncService; + private IDistributionAsyncService distributionAsyncService; @Autowired - private IDistributionStockService distributionStockService; + private IDistributionStockService distributionStockService; @Autowired @Lazy - private IDistributionStockupService distributionStockupService; + private IDistributionStockupService distributionStockupService; @Autowired - private IDistributionStockupInfoService distributionStockupInfoService; + private IDistributionStockupInfoService distributionStockupInfoService; @Autowired - private IBasicdataWarehouseClient basicdataWarehouseClient; + private IBasicdataWarehouseClient basicdataWarehouseClient; @Autowired - private IDistributionReservationZeroPackageService distributionZeroPackageService; //零担配送记录 + private IDistributionReservationZeroPackageService distributionZeroPackageService; //零担配送记录 @Autowired - private IDistributionParcelNumberService distributionParcelNumberService; //零担配送数量记录 + private IDistributionParcelNumberService distributionParcelNumberService; //零担配送数量记录 @Autowired - private IDistrilbutionBillPackageService distrilbutionBillPackageService; + private IDistrilbutionBillPackageService distrilbutionBillPackageService; @Autowired - private IBasicdataWarehouseClient warehouseClient; + private IBasicdataWarehouseClient warehouseClient; @Autowired - private IWarehouseUpdownTypeClient warehouseUpdownTypeClient; + private IWarehouseUpdownTypeClient warehouseUpdownTypeClient; @Autowired - private IDisStockListDetailService disStockListDetailService; + private IDisStockListDetailService disStockListDetailService; @Autowired - private BladeRedis redis; + private BladeRedis redis; @Autowired private IUserClient userClient; @@ -374,15 +374,15 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl stockDTOList = distrilbutionBillLading.getStockDTOList(); - boolean flag = stockDTOList.stream().anyMatch(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity())|| distributionStockListDTO.getInventoryQuantity().equals(0)); - if (flag){ + boolean flag = stockDTOList.stream().anyMatch(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity()) || distributionStockListDTO.getInventoryQuantity().equals(0)); + if (flag) { String collect = stockDTOList.stream().filter(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity())).map(DistributionStockListDTO::getIncomingBatch).collect(Collectors.joining(",")); - log.info("自提修改库存品未填写数量>>>未填写库存品批次号:{}",collect); + log.info("自提修改库存品未填写数量>>>未填写库存品批次号:{}", collect); throw new RuntimeException("请填写正确的库存品数量"); } //全部库存品数据 @@ -410,11 +410,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl> map = null; - if (!listDetails.isEmpty()){ - map = listDetails.stream().collect(Collectors.groupingBy(DistributionDeliveryDetailsEntity::getStockListId)); + if (!listDetails.isEmpty()) { + map = listDetails.stream().collect(Collectors.groupingBy(DistributionDeliveryDetailsEntity::getStockListId)); } for (DistributionStockListDTO distributionStockListDTO : stockDTOList) { - if (!map.isEmpty()){ + if (!map.isEmpty()) { DistributionDeliveryDetailsEntity distributionDeliveryDetailsEntity = map.get(distributionStockListDTO.getId()).get(0); Integer quantity = distributionDeliveryDetailsEntity.getQuantity(); int i = quantity - distributionStockListDTO.getInventoryQuantity(); @@ -425,9 +425,9 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0){ + if (i > 0) { deliveryDetails.setQuantity(distributionDeliveryDetailsEntity.getQuantity() - i); //减少 @@ -438,11 +438,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl !Func.isEmpty(f.getStockPackageCode())).mapToInt(DisStockListDetailEntity::getNum).sum(); - log.info("自提修改库存品>>>>>>>>当前计划数量:{},备货数量:{}",deliveryDetails.getQuantity(),sum); + log.info("自提修改库存品>>>>>>>>当前计划数量:{},备货数量:{}", deliveryDetails.getQuantity(), sum); // 优先取消未备货 - if (sum > 0){ + if (sum > 0) { //存在备货 throw new RuntimeException("该库存品已备货无法减少"); // if (sum >= deliveryDetails.getQuantity()) { @@ -453,7 +453,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl ids = stockListDetailEntities.subList(0, i).stream().map(DisStockListDetailEntity::getId).collect(Collectors.toList()); disStockListDetailService.removeBatchByIds(ids); @@ -463,15 +463,15 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl ids = new ArrayList<>(); //进行删除 - map.forEach((k,v)->{ + map.forEach((k, v) -> { ids.add(v.get(0).getId()); distributionAsyncService.getInventoryNumUpdate(k, v.get(0).getQuantity(), 2); //删除 disStockListDetailService.remove(Wrappers.query().lambda() - .eq(DisStockListDetailEntity::getReservationId,distrilbutionBillLading.getId()) - .eq(DisStockListDetailEntity::getStockListId,k) - .eq(DisStockListDetailEntity::getStockPackageStatus,"2") + .eq(DisStockListDetailEntity::getReservationId, distrilbutionBillLading.getId()) + .eq(DisStockListDetailEntity::getStockListId, k) + .eq(DisStockListDetailEntity::getStockPackageStatus, "2") ); }); //删除没有的库存品 @@ -670,7 +670,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list = distrilbutionBillStockService.list(Wrappers.query().lambda() .eq(!distrilbutionBillLading.getStockArticleId().contains(","), DistrilbutionBillStockEntity::getStockArticleId, distrilbutionBillLading.getStockArticleId()) .in(distrilbutionBillLading.getStockArticleId().contains(","), DistrilbutionBillStockEntity::getStockArticleId, distrilbutionBillLading.getStockArticleId().split(",")) @@ -695,7 +695,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelLisList = distrilbutionBillLading.getParcelLisList(); - Map> packageMap =null; - if (Func.isNotEmpty( distrilbutionBillLading.getBillPackageEntityList())){ - List packageEntityList= distrilbutionBillLading.getBillPackageEntityList(); + Map> packageMap = null; + if (Func.isNotEmpty(distrilbutionBillLading.getBillPackageEntityList())) { + List packageEntityList = distrilbutionBillLading.getBillPackageEntityList(); List packageisd = packageEntityList.stream().map(DistrilbutionBillPackageEntity::getParceListId).collect(Collectors.toList()); List distributionParcelListEntities = distributionParcelListService.listByIds(packageisd); - if (Func.isNotEmpty(distributionParcelListEntities)){ + if (Func.isNotEmpty(distributionParcelListEntities)) { packageMap = distributionParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getStockArticleId)); } } Map> zeroPackageMap = null; - if (Func.isNotEmpty( distrilbutionBillLading.getParcelLisList())){ + if (Func.isNotEmpty(distrilbutionBillLading.getParcelLisList())) { List zeroPackageList = distrilbutionBillLading.getParcelLisList(); zeroPackageMap = zeroPackageList.stream().collect(Collectors.groupingBy(DistributionParcelListDTO::getStockArticleId)); } @@ -733,11 +732,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() .eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) @@ -763,7 +762,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() .eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) @@ -792,7 +791,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0 || Func.isEmpty(distributionParcelListDTO.getQuantity()) ){ + if (distributionParcelListDTO.getQuantity() > 0 || Func.isEmpty(distributionParcelListDTO.getQuantity())) { DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); distributionReservationZeroPackageEntity.setParcelListId(distributionParcelListDTO.getId()); distributionReservationZeroPackageEntity.setCategoryName(distributionParcelListDTO.getFirsts()); @@ -839,16 +838,16 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl zeroOrderDetail = distributionStockArticleService.getZeroOrderDetail(Long.parseLong(s)); - if (Func.isNotEmpty(zeroOrderDetail)){ + if (Func.isNotEmpty(zeroOrderDetail)) { for (DistributionParcelNumberVO distributionParcelNumberVO : zeroOrderDetail) { DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); distributionReservationZeroPackageEntity.setRealityQuantity(0); @@ -868,18 +867,18 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelNumberEntityList = distributionParcelNumberService.list(Wrappers.query().lambda() .in(DistributionParcelNumberEntity::getParcelListId, zeroPackageIds) ); List ids = parcelNumberEntityList.stream().filter(f -> f.getQuantity() == (f.getOutboundQuantity() + f.getDeliveryQuantity())).map(DistributionParcelNumberEntity::getParcelListId).collect(Collectors.toList()); packageIds.addAll(ids); } - if (!Func.isEmpty(packageIds)){ + if (!Func.isEmpty(packageIds)) { distributionParcelListService.update(new UpdateWrapper().lambda() - .in(DistributionParcelListEntity::getId,packageIds) - .set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.yiyueyue.getValue()) + .in(DistributionParcelListEntity::getId, packageIds) + .set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue()) ); } - distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(),stockArticleEntity.getWarehouseId()); + distributionStockArticleService.maintenanceOrderInfo(stockArticleEntity.getOrderCode(), stockArticleEntity.getWarehouseId()); } - if (Func.isNotEmpty(packageEntityList)){ + if (Func.isNotEmpty(packageEntityList)) { distrilbutionBillPackageService.saveBatch(packageEntityList); } } - - //操作图片 if (!distrilbutionBillLading.getPrintList().isEmpty()) { addPrint(distrilbutionBillLading); } if (!distrilbutionBillLading.getStockDTOList().isEmpty()) { boolean flag = distrilbutionBillLading.getStockDTOList().stream().anyMatch(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity()) || distributionStockListDTO.getInventoryQuantity().equals(0)); - if (flag){ + if (flag) { String collect = distrilbutionBillLading.getStockDTOList().stream().filter(distributionStockListDTO -> Func.isEmpty(distributionStockListDTO.getInventoryQuantity())).map(DistributionStockListDTO::getIncomingBatch).collect(Collectors.joining(",")); - log.info("自提添加库存品未填写数量>>>未填写库存品批次号:{}",collect); + log.info("自提添加库存品未填写数量>>>未填写库存品批次号:{}", collect); throw new RuntimeException("请填写正确的库存品数量"); } //没有 @@ -968,8 +965,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImplupdate().lambda() - .eq(DistributionDeliveryChargeEntity::getBillLading,distrilbutionBillLading.getId()) - .set(DistributionDeliveryChargeEntity::getIsDeleted,1) + .eq(DistributionDeliveryChargeEntity::getBillLading, distrilbutionBillLading.getId()) + .set(DistributionDeliveryChargeEntity::getIsDeleted, 1) ); List listEntity = new ArrayList<>(); distrilbutionBillLading.getFei().forEach((k, v) -> { @@ -986,8 +983,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list = Func.toLongList(distrilbutionBillLading.getPackageIds()); List distributionParcelListEntities = distributionParcelListService.listByIds(list); - if (distributionParcelListEntities.isEmpty()){ + if (distributionParcelListEntities.isEmpty()) { //查询包件信息失败 - log.error(method+"查询包件信息失败PackageIds:{}",distrilbutionBillLading.getPackageIds()); + log.error(method + "查询包件信息失败PackageIds:{}", distrilbutionBillLading.getPackageIds()); return R.fail("当前勾选存在包件数据错误,请联系管理员处理"); } //校验包件是否具备被签收的性质 - if (distributionParcelListEntities.stream().anyMatch(p-> !OrderPackageStatusConstant.yiruku.getValue().equals(p.getOrderPackageStatus()))) { + if (distributionParcelListEntities.stream().anyMatch(p -> !OrderPackageStatusConstant.yiruku.getValue().equals(p.getOrderPackageStatus()))) { String collect = distributionParcelListEntities.stream().filter(p -> !OrderPackageStatusConstant.yiruku.getValue().equals(p.getOrderPackageStatus())).map(DistributionParcelListEntity::getOrderPackageCode).collect(Collectors.joining(",")); - log.error(method+"自提签收包件失败,不在库包件进行签收orderPackageCode:{}",collect); + log.error(method + "自提签收包件失败,不在库包件进行签收orderPackageCode:{}", collect); return R.fail("当前勾选存在包件不在库,请核对和进行操作"); } //进行订制品和零担的区分 Map> packageMap = distributionParcelListEntities.stream().collect(Collectors.groupingBy(DistributionParcelListEntity::getConditions)); List ladingScanEntities = new ArrayList<>(); - if (!packageMap.isEmpty()){ + if (!packageMap.isEmpty()) { // packageMap.forEach((k,v)->{ // switch (k){ // case 1: @@ -1266,7 +1261,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl pushOldPackageSigning) { for (SignPushDataUnitDTO signPushDataUnitDTO : pushOldPackageSigning) { User user = redis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getAdministratorsId()); - log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user); + log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}", user); if (user == null) { R userT = userClient.userInfoById(signPushDataUnitDTO.getAdministratorsId()); if (userT.isSuccess()) { @@ -1377,13 +1373,13 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl>用户名称:{}",user.getName()); + } else { + log.info("用户无电话号码且账号信息为空>>用户名称:{}", user.getName()); } } } @@ -1399,7 +1395,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl customer) { for (SignPushDataContactDTO signPushDataUnitDTO : customer) { User user = redis.get(RedisKeyConstant.USER_NAME_PHONE_KEY + signPushDataUnitDTO.getSignUserId()); - log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}",user); + log.info("buildNameAndPhone >>> 获取缓存的中的用户信息{}", user); if (user == null) { R userT = userClient.userInfoById(signPushDataUnitDTO.getSignUserId()); if (userT.isSuccess()) { @@ -1410,15 +1406,15 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl>用户名称:{}",user.getName()); + } else { + log.info("用户无电话号码且账号信息为空>>用户名称:{}", user.getName()); } } } @@ -1427,12 +1423,12 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl handleSignPackage(Map> packageMap,Long id,Long warehouseId){ + public List handleSignPackage(Map> packageMap, Long id, Long warehouseId) { String method = "###################DistributionBillLadingServiceImpl.handleSignPackage"; List ladingScanEntities = new ArrayList<>(); List orderCodes = new ArrayList<>(); - packageMap.forEach((k,v)->{ - switch (k){ + packageMap.forEach((k, v) -> { + switch (k) { case 1: //定制品 for (DistributionParcelListEntity parcelListEntity : v) { @@ -1449,10 +1445,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImplupdate().lambda() - .eq(DistributionParcelListEntity::getId,parcelListEntity.getId()) - .set(DistributionParcelListEntity::getOrderPackageReservationStatus,OrderPackageReservationStatusConstant.yiyueyue.getValue()) - .set(DistributionParcelListEntity::getOrderPackageLoadingStatus,OrderPackageLoadingStatusConstant.yizhuangche.getValue()) - .set(DistributionParcelListEntity::getOrderPackageStatus,OrderPackageStatusConstant.yiqianshou.getValue()) + .eq(DistributionParcelListEntity::getId, parcelListEntity.getId()) + .set(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue()) + .set(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()) + .set(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()) ); //维护订单 orderCodes.add(parcelListEntity.getOrderCode()); @@ -1474,8 +1470,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); //将这些包件还原成可操作状态 Integer num = distributionParcelListService.restorePakcageByIds(packageIds); - log.info("######################取消自提单释放包件>>>>>:{}",num); - ids.forEach(id ->{ + log.info("######################取消自提单释放包件>>>>>:{}", num); + ids.forEach(id -> { //查询自提单存在的零担订单 List reservationZeroPackageEntities = distributionZeroPackageService.list(Wrappers.query().lambda() .eq(DistributionReservationZeroPackageEntity::getReservationId, id) .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "2") ); - if (Func.isNotEmpty(reservationZeroPackageEntities)){ + if (Func.isNotEmpty(reservationZeroPackageEntities)) { List collect = reservationZeroPackageEntities.stream().map(DistributionReservationZeroPackageEntity::getStockArticleId).distinct().collect(Collectors.toList()); //释放零担资源 - distributionZeroPackageService.recoverZeroPackage(id,collect); + distributionZeroPackageService.recoverZeroPackage(id, collect); } }); //维护订单状态 @@ -1738,21 +1734,21 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionParcelListService.listByIds(packageIds); String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).collect(Collectors.joining(",")); List warehouseIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getWarehouseId).distinct().collect(Collectors.toList()); - if (!warehouseIds.isEmpty()){ - if (warehouseIds.size() == 1){ - distributionStockArticleService.maintenanceOrderInfo(orderCodes,warehouseIds.get(0)); - }else { - log.error("#################自提订制品包件缺失warehouseId错误warehouseIds:{}",warehouseIds); + if (!warehouseIds.isEmpty()) { + if (warehouseIds.size() == 1) { + distributionStockArticleService.maintenanceOrderInfo(orderCodes, warehouseIds.get(0)); + } else { + log.error("#################自提订制品包件缺失warehouseId错误warehouseIds:{}", warehouseIds); throw new ServiceException("修改失败!!!"); } - }else { - log.error("#################自提订制品包件缺失warehouseId信息packageIds:{}",packageIds); + } else { + log.error("#################自提订制品包件缺失warehouseId信息packageIds:{}", packageIds); throw new ServiceException("修改失败!!!"); } } @@ -1795,17 +1791,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 0) { //减少了 distributionParcelNumberService.updateBillNum(i.getParcelListId(), i1, 1); } else if (i1 < 0) { //增加了 - distributionParcelNumberService.updateBillNum(i.getParcelListId(),i1, 1); + distributionParcelNumberService.updateBillNum(i.getParcelListId(), i1, 1); } else { //不做操作! iterator.remove(); @@ -1822,26 +1818,26 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distributionStockArticleEntities = collect.get(i.getStockArticleId()); - if (Func.isEmpty(distributionStockArticleEntities)){ + if (Func.isEmpty(distributionStockArticleEntities)) { longs.add(i.getParcelListId()); } } } List distributionStockArticleEntities = collect.get(i.getStockArticleId()); - if (!Func.isEmpty(distributionStockArticleEntities)){ + if (!Func.isEmpty(distributionStockArticleEntities)) { String orderCode = distributionStockArticleEntities.get(0).getOrderCode(); Long warehouseId = distributionStockArticleEntities.get(0).getWarehouseId(); - log.info("#############维护零担订单信息:{},:{}",orderCode,warehouseId); - distributionStockArticleService.maintenanceOrderInfo(orderCode,warehouseId); + log.info("#############维护零担订单信息:{},:{}", orderCode, warehouseId); + distributionStockArticleService.maintenanceOrderInfo(orderCode, warehouseId); } }); if (!longs.isEmpty()) { // distributionZeroPackageService.deleteLogic(longs); //进行零担在库数量恢复 - distributionZeroPackageService.recoverZeroPackage(distrilbutionBillLadingDTO.getId(),longs); + distributionZeroPackageService.recoverZeroPackage(distrilbutionBillLadingDTO.getId(), longs); // distributionZeroPackageService.cancelZeroPackage(longs); } @@ -1874,7 +1870,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl stockArticleList = distrilbutionBillLading.getStockArticleList(); @@ -1886,49 +1882,49 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl orderIds = new ArrayList<>(); //订制品选择包件 Map> packageMap = null; - if (Func.isNotEmpty(distrilbutionBillLading.getBillPackageEntityList())){ - packageMap = distrilbutionBillLading.getBillPackageEntityList().stream().collect(Collectors.groupingBy(DistrilbutionBillPackageEntity::getStockArticleId)); + if (Func.isNotEmpty(distrilbutionBillLading.getBillPackageEntityList())) { + packageMap = distrilbutionBillLading.getBillPackageEntityList().stream().collect(Collectors.groupingBy(DistrilbutionBillPackageEntity::getStockArticleId)); } //零担包件信息 - Map> zerpPackageMap = null; - if (Func.isNotEmpty( distrilbutionBillLading.getParcelLisList())){ - zerpPackageMap = distrilbutionBillLading.getParcelLisList().stream().collect(Collectors.groupingBy(DistributionParcelListDTO::getStockArticleId)); + Map> zerpPackageMap = null; + if (Func.isNotEmpty(distrilbutionBillLading.getParcelLisList())) { + zerpPackageMap = distrilbutionBillLading.getParcelLisList().stream().collect(Collectors.groupingBy(DistributionParcelListDTO::getStockArticleId)); } //收集需要进行维护的订单 List orderCodes = new ArrayList<>(); - stockArticleList.forEach(s->{ - if (!entityList.isEmpty()){ + stockArticleList.forEach(s -> { + if (!entityList.isEmpty()) { boolean flag = entityList.stream().anyMatch(a -> s.getId().equals(a.getStockArticleId())); - if (flag){ + if (flag) { //存在计划中 Iterator iterator = entityList.iterator(); - while (iterator.hasNext()){ + while (iterator.hasNext()) { DistrilbutionBillStockEntity next = iterator.next(); - if (next.getStockArticleId().equals(s.getId())){ + if (next.getStockArticleId().equals(s.getId())) { iterator.remove(); } } - }else { + } else { orderIds.add(s.getId()); } - }else { + } else { //整单新增 orderIds.add(s.getId()); } }); - //取消订单 - if (!entityList.isEmpty()){ + //取消订单 + if (!entityList.isEmpty()) { for (DistrilbutionBillStockEntity distrilbutionBillStock : entityList) { DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(distrilbutionBillStock.getStockArticleId()); - if (Func.isEmpty(stockArticleEntity)){ + if (Func.isEmpty(stockArticleEntity)) { //订单数据错误 - log.error(">>>>>>>>>>>>>>>>>>>>>自提取消订单错误stockArticleEntityId:{}",distrilbutionBillStock.getStockArticleId()); + log.error(">>>>>>>>>>>>>>>>>>>>>自提取消订单错误stockArticleEntityId:{}", distrilbutionBillStock.getStockArticleId()); return false; } //查询是取消零担还是取消订制品 - if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())){ + if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())) { distrilbutionBillPackageService.update(Wrappers.update() .eq("stock_article_id", distrilbutionBillStock.getStockArticleId()) .eq("bill_lading_id", distrilbutionBillStock.getBillLadingId()) @@ -1968,38 +1964,38 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl packageEntityList = new ArrayList<>(); //剩下的计划内就是需要进行取消的 //订单新增 - if (!orderIds.isEmpty()){ + if (!orderIds.isEmpty()) { List addOrderIds = new ArrayList<>(); List zeroOrderIds = new ArrayList<>(); for (Long orderId : orderIds) { DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(orderId); - if (Func.isEmpty(stockArticleEntity)){ + if (Func.isEmpty(stockArticleEntity)) { return false; } - if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())){ + if (IsOrNoConstant.no.getValue().equals(stockArticleEntity.getIsZero())) { //定制品 - if (Func.isNotEmpty(packageMap)){ + if (Func.isNotEmpty(packageMap)) { //订制品都未进行包件的选择,需要对新增的订单进行可用包件全部添加 - if (Func.isEmpty(packageMap.get(stockArticleEntity.getId()))){ + if (Func.isEmpty(packageMap.get(stockArticleEntity.getId()))) { //对该订单下所有包件进行计划的添加 addOrderIds.add(stockArticleEntity.getId()); } - }else { + } else { //对该订单下所有包件进行计划的添加 addOrderIds.add(stockArticleEntity.getId()); } - }else if (IsOrNoConstant.yes.getValue().equals(stockArticleEntity.getIsZero())){ + } else if (IsOrNoConstant.yes.getValue().equals(stockArticleEntity.getIsZero())) { //零担 - if (Func.isNotEmpty(zerpPackageMap)){ - if (Func.isEmpty(zerpPackageMap.get(stockArticleEntity.getId()))){ + if (Func.isNotEmpty(zerpPackageMap)) { + if (Func.isEmpty(zerpPackageMap.get(stockArticleEntity.getId()))) { //未进行数量录入操作 zeroOrderIds.add(stockArticleEntity.getId()); } - }else { + } else { zeroOrderIds.add(stockArticleEntity.getId()); } - }else{ - log.info("####################3订单缺失IsZero字段:{}",stockArticleEntity.getId()); + } else { + log.info("####################3订单缺失IsZero字段:{}", stockArticleEntity.getId()); return false; } DistrilbutionBillStockEntity distrilbutionBillStock = new DistrilbutionBillStockVO(); @@ -2011,7 +2007,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() @@ -2021,8 +2017,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl{ + if (!Func.isEmpty(parcelListEntities)) { + parcelListEntities.forEach(p -> { DistrilbutionBillPackageEntity billPackageEntity = new DistrilbutionBillPackageEntity(); billPackageEntity.setBillLadingId(distrilbutionBillLading.getId()); billPackageEntity.setParceListId(p.getId()); @@ -2039,23 +2035,23 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl zeroPackageEntities = new ArrayList<>(); - if (!zeroOrderIds.isEmpty()){ + if (!zeroOrderIds.isEmpty()) { //查询所有的零担信息 List parcelNumberEntityList = distributionParcelNumberService.list(Wrappers.query().lambda() .in(DistributionParcelNumberEntity::getStockArticleId, zeroOrderIds) .apply("(hand_quantity - delivery_quantity) >0") ); - if (Func.isEmpty(parcelNumberEntityList)){ - log.error("#########################无可用包件orderIds:{}",zeroOrderIds); + if (Func.isEmpty(parcelNumberEntityList)) { + log.error("#########################无可用包件orderIds:{}", zeroOrderIds); return false; } - parcelNumberEntityList.forEach(zp->{ + parcelNumberEntityList.forEach(zp -> { //查询包件 DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(zp.getParcelListId()); DistributionReservationZeroPackageEntity distributionReservationZeroPackageEntity = new DistributionReservationZeroPackageEntity(); @@ -2065,8 +2061,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>>>>>>>>>>零担品类增加计划数量getHandQuantity:{}getDeliveryQuantity:{}(zp.getHandQuantity() - zp.getDeliveryQuantity()):{}",zp.getHandQuantity(),zp.getDeliveryQuantity(),(zp.getHandQuantity() - zp.getDeliveryQuantity())); - distributionParcelNumberService.updateBillNum(zp.getParcelListId(),(zp.getHandQuantity() - zp.getDeliveryQuantity()),1); + log.info(">>>>>>>>>>>>>>>>>>>>>>>>零担品类增加计划数量getHandQuantity:{}getDeliveryQuantity:{}(zp.getHandQuantity() - zp.getDeliveryQuantity()):{}", zp.getHandQuantity(), zp.getDeliveryQuantity(), (zp.getHandQuantity() - zp.getDeliveryQuantity())); + distributionParcelNumberService.updateBillNum(zp.getParcelListId(), (zp.getHandQuantity() - zp.getDeliveryQuantity()), 1); }); List collect = parcelNumberEntityList.stream().map(DistributionParcelNumberEntity::getParcelListId).collect(Collectors.toList()); distributionParcelListService.update(Wrappers.update() @@ -2076,23 +2072,22 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distributionStockArticleEntities = distributionStockArticleService.listByIds(cancelOrderIds); - if (Func.isEmpty(distributionStockArticleEntities)){ - log.info("#####################查询订单失败,orderIds:{}",cancelOrderIds); + if (Func.isEmpty(distributionStockArticleEntities)) { + log.info("#####################查询订单失败,orderIds:{}", cancelOrderIds); } String orderCodes = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getOrderCode).collect(Collectors.joining(",")); List collect = distributionStockArticleEntities.stream().map(DistributionStockArticleEntity::getWarehouseId).distinct().collect(Collectors.toList()); - if (collect.isEmpty()){ - log.info("#####################订单列表warehouseId字段缺失,orderIds:{}",cancelOrderIds); + if (collect.isEmpty()) { + log.info("#####################订单列表warehouseId字段缺失,orderIds:{}", cancelOrderIds); return false; } - if (collect.size()>1){ - log.info("#####################自提操作多个仓库订单,orderIds:{}",cancelOrderIds); + if (collect.size() > 1) { + log.info("#####################自提操作多个仓库订单,orderIds:{}", cancelOrderIds); return false; } - distributionStockArticleService.maintenanceOrderInfo(orderCodes,collect.get(0)); + distributionStockArticleService.maintenanceOrderInfo(orderCodes, collect.get(0)); } return true; } @@ -2261,10 +2255,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl pageList(IPage page, Map distrilbutionBillLading) { DistrilbutionBillLadingDTO distrilbutionBillLadingDTO = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingDTO.class); List strs = null; - if (!Objects.isNull(distrilbutionBillLading.get("pickupBatchs"))){ + if (!Objects.isNull(distrilbutionBillLading.get("pickupBatchs"))) { String str = (String) distrilbutionBillLading.get("pickupBatchs"); - if (Strings.isNotBlank(str)){ - if (str.indexOf(",")>0){ + if (Strings.isNotBlank(str)) { + if (str.indexOf(",") > 0) { //存在中文逗号 str = str.replaceAll(",", ","); } @@ -2272,10 +2266,10 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl orderCodes = null; - if (!Objects.isNull(distrilbutionBillLading.get("orderCodes"))){ + if (!Objects.isNull(distrilbutionBillLading.get("orderCodes"))) { String str = (String) distrilbutionBillLading.get("orderCodes"); - if (Strings.isNotBlank(str)){ - if (str.indexOf(",")>0){ + if (Strings.isNotBlank(str)) { + if (str.indexOf(",") > 0) { //存在中文逗号 str = str.replaceAll(",", ","); } @@ -2291,30 +2285,67 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distrilbutionBillLadingVOIPage = baseMapper.pageList(page, distrilbutionBillLadingDTO); List records = distrilbutionBillLadingVOIPage.getRecords(); - records.forEach(i -> { - List list = distributionDeliveryChargeService.list(Wrappers.query().lambda() - .eq(DistributionDeliveryChargeEntity::getBillLading, i.getId()) - ); - list.forEach(ii -> ii.setCostName(DictBizCache.getValue(DictBizConstant.DELIVERY_COST, ii.getCost()))); - i.setList(list); - //查询是不是上传图片 - List list1 = distributionPrintService.list(Wrappers.query().lambda() - .eq(DistributionPrintEntity::getBillLadingId, i.getId()) - ); - int count = (int) list1.stream().filter(ii -> "1".equals(ii.getGenre().toString())).count(); - int count1 = (int) list1.stream().filter(ii -> "2".equals(ii.getGenre().toString())).count(); - int count2 = (int) list1.stream().filter(ii -> "3".equals(ii.getGenre().toString())).count(); - if (count1 >= 1 && count >= 1 && count2 >= 1) { - i.setPrintState(true); - } else { + + // 获取所有的提货单ID + List billIds = records.stream() + .map(DistrilbutionBillLadingVO::getId) // 假设getId()方法返回提货单ID + .collect(Collectors.toList()); + + List distributionDeliveryChargeEntityList = distributionDeliveryChargeService.list(Wrappers.query().lambda() + .in(DistributionDeliveryChargeEntity::getBillLading, billIds) + ); + Map> groupedEntities; + if (ObjectUtils.isNotNull(distributionDeliveryChargeEntityList)) { + groupedEntities = + distributionDeliveryChargeEntityList.stream() + .collect(Collectors.groupingBy(DistributionDeliveryChargeEntity::getBillLading)); + } else { + groupedEntities = null; + } + + List DistributionPrintEntitys = distributionPrintService.list(Wrappers.query().lambda() + .in(DistributionPrintEntity::getBillLadingId, billIds) + ); + + Map> groupDistributionPrintEntityEntities; + if (ObjectUtils.isNotNull(DistributionPrintEntitys)) { + groupDistributionPrintEntityEntities = + DistributionPrintEntitys.stream() + .collect(Collectors.groupingBy(DistributionPrintEntity::getBillLadingId)); + } else { + groupDistributionPrintEntityEntities = null; + } + + + records.forEach(i -> { + if(groupedEntities!=null){ + List list =groupedEntities.get(i.getId()); + list.forEach(ii -> ii.setCostName(DictBizCache.getValue(DictBizConstant.DELIVERY_COST, ii.getCost()))); + i.setList(list); + } + if(groupDistributionPrintEntityEntities!=null){ + List list1 = groupDistributionPrintEntityEntities.get(i.getId()); + if(list1!=null){ + int count = (int) list1.stream().filter(ii -> "1".equals(ii.getGenre().toString())).count(); + int count1 = (int) list1.stream().filter(ii -> "2".equals(ii.getGenre().toString())).count(); + int count2 = (int) list1.stream().filter(ii -> "3".equals(ii.getGenre().toString())).count(); + if (count1 >= 1 && count >= 1 && count2 >= 1) { + i.setPrintState(true); + } else { + i.setPrintState(false); + } + } + + }else{ i.setPrintState(false); } + }); distrilbutionBillLadingVOIPage.setRecords(records); return distrilbutionBillLadingVOIPage; @@ -2485,7 +2516,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl num = baseMapper.getCompleteNum(billLadingId); - if (Func.isNotEmpty(num)){ + if (Func.isNotEmpty(num)) { int size = num.stream().filter(f -> f.equals(true)).collect(Collectors.toList()).size(); mainVO.setCompleteNum(size); } @@ -2850,28 +2881,28 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distributionStockArticleVOS = DistributionStockArticleWrapper.build().listVO(list2); for (DistributionStockArticleVO distributionStockArticleVO : distributionStockArticleVOS) { //查询自身订单的计划数量是多少 - if (IsOrNoConstant.no.getValue().equals(distributionStockArticleVO.getIsZero())){ + if (IsOrNoConstant.no.getValue().equals(distributionStockArticleVO.getIsZero())) { //查询订制品数量 List list3 = distrilbutionBillPackageService.list(Wrappers.query().lambda() .eq(DistrilbutionBillPackageEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) .ne(DistrilbutionBillPackageEntity::getPacketBarStatus, "2") .eq(DistrilbutionBillPackageEntity::getStockArticleId, distributionStockArticleVO.getId()) ); - if (!list3.isEmpty()){ + if (!list3.isEmpty()) { distributionStockArticleVO.setReservationNum(list3.size()); - }else { + } else { distributionStockArticleVO.setReservationNum(0); } - }else { + } else { List reservationZeroPackageEntities = distributionZeroPackageService.list(Wrappers.query().lambda() .eq(DistributionReservationZeroPackageEntity::getReservationId, distrilbutionBillLadingEntity.getId()) .eq(DistributionReservationZeroPackageEntity::getStockArticleId, distributionStockArticleVO.getId()) .ne(DistributionReservationZeroPackageEntity::getZeroPackageStatus, "2") .eq(DistributionReservationZeroPackageEntity::getType, "3") ); - if (!reservationZeroPackageEntities.isEmpty()){ + if (!reservationZeroPackageEntities.isEmpty()) { distributionStockArticleVO.setReservationNum(reservationZeroPackageEntities.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum()); - }else { + } else { distributionStockArticleVO.setReservationNum(0); } @@ -2918,14 +2949,14 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl distrilbutionBillLading) { + public DistrilbutionAppBillLadingOrderMainVO getInventory(Map distrilbutionBillLading) { String method = "##################DistributionBillLadingServiceImpl.getInventory"; - if (Func.isEmpty(distrilbutionBillLading.get("id"))){ - log.error(method+"自提Id缺失"); + if (Func.isEmpty(distrilbutionBillLading.get("id"))) { + log.error(method + "自提Id缺失"); return null; } String id = (String) distrilbutionBillLading.get("id"); - DistrilbutionAppBillLadingOrderMainVO mainVO =baseMapper.getBillLadingOrderMainVO(Long.parseLong(id)); + DistrilbutionAppBillLadingOrderMainVO mainVO = baseMapper.getBillLadingOrderMainVO(Long.parseLong(id)); //查询订单数量, //查询齐套数 //查询字体件数 @@ -2933,7 +2964,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl num = baseMapper.getCompleteNum(Long.parseLong(id)); - if (Func.isNotEmpty(num)){ + if (Func.isNotEmpty(num)) { int size = num.stream().filter(f -> f.equals(true)).collect(Collectors.toList()).size(); mainVO.setCompleteNum(size); } @@ -2945,19 +2976,19 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl InventoryStockUpStatusConstant.yibeihuo.getValue().equals(f.getStockStatus()) && Func.isNotEmpty(f.getStockPackageCode())).mapToInt(DisStockListDetailEntity::getNum).sum(); - log.info(i.getDescriptionGoods()+">>>>>>>>>>>>>>自提客户备货库存数量:",sum); - if (sum == i.getQuantity()){ + log.info(i.getDescriptionGoods() + ">>>>>>>>>>>>>>自提客户备货库存数量:", sum); + if (sum == i.getQuantity()) { i.setEsauInventoryNum(sum); - }else { + } else { i.setEsauInventoryNum(-1); } - }else { + } else { i.setEsauInventoryNum(-1); } // if (i.getQuantity().equals(i.getDeliveryNum())) { - //已备货 + //已备货 // List list = distributionBillLadingScanService.list(Wrappers.query().lambda() // .eq(DistributionBillLadingScanEntity::getBillLadingId, distrilbutionBillLadingEntity.getId()) // .eq(DistributionBillLadingScanEntity::getMaterialType, '1') @@ -2966,9 +2997,8 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl Func.isEmpty(f.getStockPackageCode())); - if (flag){ + if (flag) { return Resp.scanFail("库存品备货未完成,请联系库管人员!", "库存品备货未完成,请联系库管人员"); } //校验包件李彪是否存在满足码值的包件 List collect = inventoryPackage.stream().filter(f -> coding.equals(f.getStockPackageCode())).collect(Collectors.toList()); - if (collect.size() == 1){ + if (collect.size() == 1) { //满足签收 distributionBillLadingScan.setPacketBarCode((String) coding); distributionBillLadingScan.setStockListId(collect.get(0).getStockListId()); @@ -3051,17 +3081,17 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl 1){ + if (collect.size() > 1) { //已备货库存品包件存在多条一样的 - log.info("########################PDA签收库存品包件存在多条一样的备货码值:{}",coding); + log.info("########################PDA签收库存品包件存在多条一样的备货码值:{}", coding); return Resp.scanFail("系统无此编码!", "系统无此编码"); - }else { + } else { //备货库存品不存在 return Resp.scanFail("系统无此编码!", "系统无此编码"); @@ -3075,7 +3105,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl billLadingInventoryAppVOS = stockListMap.get(stockListId); - if (Func.isNotEmpty(billLadingInventoryAppVOS)){ + if (Func.isNotEmpty(billLadingInventoryAppVOS)) { DistrilbutionBillLadingInventoryAppVO distrilbutionBillLadingInventoryAppVO = billLadingInventoryAppVOS.get(0); if (list.size() == distrilbutionBillLadingInventoryAppVO.getQuantity()) { //修改完成状态 @@ -3088,7 +3118,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl getInventoryNum(IPage page, Map distrilbutionBillLading) { DistrilbutionBillLadingEntity distrilbutionBillLadingEntity = JSONObject.parseObject(JSONObject.toJSONString(distrilbutionBillLading), DistrilbutionBillLadingEntity.class); // List inventory = baseMapper.getInventory(distrilbutionBillLadingEntity); - Page inventory = baseMapper.getInventoryPage(page,distrilbutionBillLadingEntity); + Page inventory = baseMapper.getInventoryPage(page, distrilbutionBillLadingEntity); inventory.getRecords().forEach(i -> { if (i.getQuantity().equals(i.getDeliveryNum())) { //已备货 @@ -3272,7 +3302,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl parcelListIds = new HashSet<>(); @@ -3297,23 +3327,23 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl ladingScanEntities = distributionBillLadingScanService.list(Wrappers.query().lambda().eq(DistributionBillLadingScanEntity::getBillLadingId, Long.parseLong(s))); - if (Func.isNotEmpty(ladingScanEntities)){ + if (Func.isNotEmpty(ladingScanEntities)) { int sum = ladingScanEntities.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum(); - if (integer != sum){ + if (integer != sum) { //存在资源释放操作 - distributionAsyncService.releaseBillLadingResource(Long.parseLong(s),myCurrentWarehouse.getId()); + distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId()); } parcelListIds.addAll(ladingScanEntities.stream().map(DistributionBillLadingScanEntity::getParcelListId).collect(Collectors.toSet())); for (DistributionBillLadingScanEntity ladingScanEntity : ladingScanEntities) { // 签收发送消息到工厂 // pushFactoryOrderData(myCurrentWarehouse.getId(), ladingScanEntity.getParcelListId().toString(), ladingScanEntity.getOrderSelfNumbering()); } - }else { - distributionAsyncService.releaseBillLadingResource(Long.parseLong(s),myCurrentWarehouse.getId()); + } else { + distributionAsyncService.releaseBillLadingResource(Long.parseLong(s), myCurrentWarehouse.getId()); } //修改订单状态 @@ -3360,6 +3390,7 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>>>>> 推送老系统 的自提数据 {} ", mapState); - rabbitTemplate.convertAndSend(RabbitConstant.BILL_CLERK_CHECK_PUSH_DATA_EXCHANGE, RabbitConstant.BILL_CLERK_CHECK_PUSH_DATA_ROUTING, mapState,message -> { + rabbitTemplate.convertAndSend(RabbitConstant.BILL_CLERK_CHECK_PUSH_DATA_EXCHANGE, RabbitConstant.BILL_CLERK_CHECK_PUSH_DATA_ROUTING, mapState, message -> { message.getMessageProperties() .setHeader("x-delay", 5000); return message; @@ -3806,11 +3837,11 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl completeNum = baseMapper.getCompleteNum(billLadingAppDTO.getBillLadingId()); - if (Func.isNotEmpty(completeNum)){ + if (Func.isNotEmpty(completeNum)) { int size = completeNum.stream().filter(f -> f.equals(true)).collect(Collectors.toList()).size(); billLadingOrderMainVO.setCompleteNum(size); - }else { + } else { billLadingOrderMainVO.setCompleteNum(0); } //查询订单 @@ -3864,13 +3895,13 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl list1 = distributionBillLadingScanService.list(Wrappers.query().lambda() - .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingAppDTO.getBillLadingId()) - .eq(DistributionBillLadingScanEntity::getStockArticleId, k) + .eq(DistributionBillLadingScanEntity::getBillLadingId, billLadingAppDTO.getBillLadingId()) + .eq(DistributionBillLadingScanEntity::getStockArticleId, k) // .eq(DistributionBillLadingScanEntity::getParcelListId, k) ); if (!list1.isEmpty()) { zeroOrderVO.setSignforQuantity(list1.stream().mapToInt(DistributionBillLadingScanEntity::getQuantity).sum()); - }else { + } else { zeroOrderVO.setSignforQuantity(0); } billLadingZeroOrderVOS.add(zeroOrderVO); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java index 3a20b319c..a129cafa4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/wrapper/DistributionStockArticleWrapper.java @@ -38,8 +38,8 @@ public class DistributionStockArticleWrapper extends BaseEntityWrapper