From 06e2ffe6be27ba59b909a625f650190f48030d8e Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Sat, 18 Jan 2025 17:28:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=AD=BE=E6=94=B6=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BB=A3=E7=A0=81=20=E4=BC=98=E5=8C=96=E7=AD=BE?= =?UTF-8?q?=E6=94=B6=E6=89=98=E7=9B=98=E4=B8=8B=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/DistributionSignforAppController.java | 17 +++++ .../mapper/DistributionReservationMapper.xml | 6 ++ .../mapper/DistributionSignforMapper.java | 3 +- .../mapper/DistributionSignforMapper.xml | 4 + .../impl/DistributionAsyncServiceImpl.java | 48 ++++++++---- .../DistributionDeliveryListServiceImpl.java | 20 +++-- .../DistributionReservationServiceImpl.java | 4 + .../impl/DistributionSignforServiceImpl.java | 75 ++++++++++--------- .../DistributionStockArticleServiceImpl.java | 35 ++++----- .../impl/DistributionStockupServiceImpl.java | 14 ++-- .../httpImpl/BillingDataServiceImpl.java | 6 +- .../mapper/WarehouseWaybillMapper.xml | 3 + 12 files changed, 149 insertions(+), 86 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java index 1a56e5809..c7fc1b17f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/api/DistributionSignforAppController.java @@ -53,6 +53,7 @@ public class DistributionSignforAppController { private final IBasicdataWarehouseClient warehouseClient; + /** * 签收管理 列表 */ @@ -209,6 +210,22 @@ public class DistributionSignforAppController { public R newSignfor(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) { try { R r = distributionSignforService.newSignfor(distrilbutionloadingscanDTO); + + if(r.getData()!=null){ + String orderPackageCodes = null; + List packageCodes= (List) r.getData(); + for (String packageCode : packageCodes) { + if (StringUtils.isBlank(orderPackageCodes)) { + orderPackageCodes = packageCode; + } else { + orderPackageCodes = orderPackageCodes + "," + packageCode; + } + } + // 执行下架解托盘代码 + String remark="签收下架解托"; + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); + updownTypeClient.downPackageOrDelTray(orderPackageCodes, myCurrentWarehouse.getId(), remark); + } return r; } catch (CustomerException e) { log.error("#############signfor:签收报错", e); diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 2b567acbc..aeb9d669d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -755,6 +755,12 @@ and ldpl.waybill_number like concat('%',#{param.waybillNumber},'%') + + and ldpl.order_package_stockup_status = #{param.orderPackageStockupStatus} + + + and ldpl.order_package_grounding_status = #{param.orderPackageGroundingStatus} + and ldpl.service_number like concat('%',#{param.serviceNumber},'%') diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java index 424d97e50..6f0e4164a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java @@ -479,8 +479,9 @@ public interface DistributionSignforMapper extends BaseMapper + lds.signee_name=#{user.nickName}, + lds.signee_id=#{user.userId}, + lds.received_quantity = ( SELECT IFNULL( sum( received_quantity ), 0 ) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java index ec37eecd7..dcc58e7a6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionAsyncServiceImpl.java @@ -376,33 +376,45 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { private void checkReservationAndDeliveryLoadingStatus(Long deliveryId, Long reservationId) { //判断客户是否完成装车 DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(reservationId); + if(Func.isEmpty(distributionReservationEntity)){ + log.error("##########查询客户配送对象为null"); + return ; + } + DistributionReservationEntity updateReservation =new DistributionReservationEntity(); + updateReservation.setId(distributionReservationEntity.getId()); + int reservationPackageTotal = distributionReservationEntity.getReservationNum() + distributionReservationEntity.getReservationStockListNum(); if (reservationPackageTotal != 0) { DistributionLoadingNumDTO reservationLoadingNum = distributionReservationMapper.selectReservationLoadingNum(distributionReservationEntity.getId()); if (Func.isNotEmpty(reservationLoadingNum)) { int reservationLoadingQuantity = reservationLoadingNum.getPackageLoadingQuantity() + reservationLoadingNum.getInventoryLoadingQuantity(); if (reservationLoadingQuantity == reservationPackageTotal) { - distributionReservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); + updateReservation.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); } else { - distributionReservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); + updateReservation.setLoadingStatus(ReservationLoadingStatusConstant.bufenzhuangche.getValue()); } - distributionReservationMapper.updateById(distributionReservationEntity); + distributionReservationMapper.updateById(updateReservation); } } else { log.error("##########查询客户配送数量为0"); } DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(deliveryId); + if(distributionDeliveryListEntity==null){ + return ; + } + DistributionDeliveryListEntity update = new DistributionDeliveryListEntity(); + update.setId(distributionDeliveryListEntity.getId()); int deliveryPackageTotal = distributionDeliveryListEntity.getDeliveryNumber(); if (deliveryPackageTotal != 0) { DistributionLoadingNumDTO deliveryLoadingNum = distributionDeliveryListMapper.selectDeliveryLoadingNum(distributionDeliveryListEntity.getId()); if (Func.isNotEmpty(deliveryLoadingNum)) { int deliveryLoadingQuantity = deliveryLoadingNum.getPackageLoadingQuantity() + deliveryLoadingNum.getInventoryLoadingQuantity(); if (deliveryPackageTotal == deliveryLoadingQuantity) { - distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); + update.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); } else { - distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); + update.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.bunfenzhuangche.getValue()); } - distributionDeliveryListMapper.updateById(distributionDeliveryListEntity); + distributionDeliveryListMapper.updateById(update); } } else { log.error("##########查询客户配送数量为0"); @@ -764,6 +776,12 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { return; } DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelNumberEntity.getStockArticleId()); + if(Func.isEmpty(stockArticleEntity)){ + log.error("#################stockArticleEntity参数错误:{}", stockArticleEntity); + return ; + } + DistributionStockArticleEntity updateById = new DistributionStockArticleEntity(); + updateById.setId(stockArticleEntity.getId()); if (Func.equals(stockArticleEntity.getIsZero(), IsOrNoConstant.no.getValue())) { log.error("#################查询订单异常,订单ID为:{}", parcelNumberEntity.getStockArticleId()); return; @@ -776,12 +794,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } parcelNumberEntities.forEach(p -> { DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(p.getParcelListId()); + DistributionParcelListEntity update = new DistributionParcelListEntity(); + update.setId(parcelListEntity.getId()); if (Objects.equals(p.getOutboundQuantity(), p.getQuantity())) { - parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); + update.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.yizhuangche.getValue()); } else { - parcelListEntity.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()); + update.setOrderPackageLoadingStatus(OrderPackageLoadingStatusConstant.weizhuancghe.getValue()); } - distributionParcelListService.updateById(parcelListEntity); + distributionParcelListService.updateById(update); }); List parcelListEntityList = distributionParcelListService.list(Wrappers.query().lambda() .eq(DistributionParcelListEntity::getStockArticleId, stockArticleEntity.getId())); @@ -791,14 +811,14 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { } int outboundQuantity = parcelNumberEntities.stream().mapToInt(DistributionParcelNumberEntity::getOutboundQuantity).sum(); if (outboundQuantity > 0 && outboundQuantity < stockArticleEntity.getTotalNumber()) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); - stockArticleEntity.setDeliveryQuantity( outboundQuantity); + updateById.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + updateById.setDeliveryQuantity( outboundQuantity); } if (stockArticleEntity.getTotalNumber() == outboundQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.chuku.getValue()); - stockArticleEntity.setDeliveryQuantity(outboundQuantity); + updateById.setOrderStatus(OrderStatusConstant.chuku.getValue()); + updateById.setDeliveryQuantity(outboundQuantity); } - distributionStockArticleService.updateById(stockArticleEntity); + distributionStockArticleService.updateById(updateById); //维护预约客户和配送任务装车状态 checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index b11d4c9db..ccf31b393 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -8985,7 +8985,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl info = new HashMap<>(); info.put("orderPackageCode", parcelListEntity.getOrderPackageCode()); @@ -8995,7 +8995,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda() .eq(DistributionSignforEntity::getReservationId, reservationId) ); + + DistributionSignforEntity update = new DistributionSignforEntity(); + update.setId(signforEntity.getId()); + if (Func.isEmpty(signforEntity)) { log.error("维护签收异常是否存在异常包件失败"); return; @@ -1193,9 +1197,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl p.getAuditingStatus().equals(LoadingAbnormalAuditingStatusConstant.yishenhe.getValue())); if (flag) { - signforEntity.setIsHaveAbnormalPackage(1); + update.setIsHaveAbnormalPackage(1); } else { - signforEntity.setIsHaveAbnormalPackage(2); + update.setIsHaveAbnormalPackage(2); } } //统计客户装车数 @@ -1208,8 +1212,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl().lambda() .eq(DistributionLoadscanEntity::getReservationId, signforEntity.getReservationId()) @@ -1219,9 +1223,9 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl nodeFanoutMsg = buildDistributionSignforVO(distributionDeliveryListEntity, reservationEntity, pushList, OperatModeConstant.SCAN, signforTime); @@ -6123,10 +6126,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl packageLockIds = new ArrayList<>(); List orderCodes = new ArrayList<>(); + // 签收下架的包条码 + List orderPackageCodesByUnTray = new ArrayList<>(); List pushList = new ArrayList<>(); List pushInventoryList = new ArrayList<>(); //配置项 @@ -8087,10 +8092,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl a = bladeRedis.get("warehouseId:" + myCurrentWarehouse.getId() + ":trainNumber:" + deliveryListEntity.getTrainNumber() + ":orderPackageCode:" + packageLockIds); if (Func.isNotEmpty(a)) { - boolean flag = a.stream().anyMatch(any -> packageLockIds.contains(any)); + boolean flag = a.stream().anyMatch(packageLockIds::contains); if (flag) { //正在操作,请稍后重试 throw new CustomerException("该包件正在被操作,请稍后再试!!!"); @@ -8584,11 +8589,13 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda() @@ -2141,46 +2142,46 @@ public class DistributionStockArticleServiceImpl extends BaseServiceImpl loadingQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); + t.setOrderStatus(OrderStatusConstant.bufenchuku.getValue()); } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); + t.setOrderStatus(OrderStatusConstant.ruku.getValue()); } if ((loadingQuantity + deliveryQuantity) == 0) { if (stockArticleEntity.getTotalNumber() == inWarehouseQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); + t.setOrderStatus(OrderStatusConstant.ruku.getValue()); + t.setReservationStatus(OrderReservationStatusConstant.daiyuyue.getValue()); } else if (inWarehouseQuantity > 0) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenruku.getValue()); + t.setOrderStatus(OrderStatusConstant.bufenruku.getValue()); } } else { if ((loadingQuantity + deliveryQuantity) == stockArticleEntity.getTotalNumber()) { //无在库数量则无法进行预约 - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); + t.setReservationStatus(OrderReservationStatusConstant.yiyueyue.getValue()); } else if ((loadingQuantity + deliveryQuantity) > 0) { - stockArticleEntity.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); + t.setReservationStatus(OrderReservationStatusConstant.bufenyuyue.getValue()); } } if (signingQuantity == 0) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.ruku.getValue()); + t.setOrderStatus(OrderStatusConstant.ruku.getValue()); } else { if (stockArticleEntity.getTotalNumber() == signingQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); + t.setOrderStatus(OrderStatusConstant.qianshou.getValue()); } else if (stockArticleEntity.getTotalNumber() > signingQuantity) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); + t.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); } } //维护订单的在库件数 - stockArticleEntity.setHandQuantity(inWarehouseQuantity); + t.setHandQuantity(inWarehouseQuantity); //维护订单的配送件数 - stockArticleEntity.setDeliveryQuantity(loadingQuantity); - stockArticleEntity.setSigninQuantity(signingQuantity); + t.setDeliveryQuantity(loadingQuantity); + t.setSigninQuantity(signingQuantity); if (inWarehouseQuantity > 0) { - stockArticleEntity.setGenre(1); + t.setGenre(1); } - this.updateById(stockArticleEntity); + this.updateById(t); } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java index 971d537d5..0a29b6279 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockupServiceImpl.java @@ -5633,22 +5633,18 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl Objects.isNull(a))) { + if (!packageEntityList.stream().allMatch(Objects::isNull)) { //订制品 - if (!packageEntityList.isEmpty() && packageEntityList.size() > 0) { - packageFlag = packageEntityList.stream().allMatch(a->OrderPackageStockupStatusConstant.yibeihu.getValue().equals(a.getOrderPackageStockupStatus())); - }else { - packageFlag = true; - } - } + packageFlag = packageEntityList.stream().allMatch(a -> OrderPackageStockupStatusConstant.yibeihu.getValue().equals(a.getOrderPackageStockupStatus())); + } //库存品 - if (!inventoryList.isEmpty() && inventoryList.size() > 0) { + if (!inventoryList.isEmpty()) { inventoryFlag = inventoryList.stream().allMatch(b -> InventoryStockUpStatusConstant.yibeihuo.getValue().equals(b.getStockStatus())); }else { inventoryFlag = true; } //零担 - if (!zeroEntityList.isEmpty() && zeroEntityList.size() > 0) { + if (!zeroEntityList.isEmpty()) { //零担核对备货数量是否完成 int planNum = zeroEntityList.stream().mapToInt(DistributionReservationZeroPackageEntity::getQuantity).sum(); List orderId = zeroEntityList.stream().map(DistributionReservationZeroPackageEntity::getStockArticleId).distinct().collect(Collectors.toList()); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java index f5c0eba60..301910418 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/largeScreen/httpImpl/BillingDataServiceImpl.java @@ -34,7 +34,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public BillingDataVO getBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"))); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); @@ -43,7 +43,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getWarehouseBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"))); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); XxlJobQueryVO init = JSON.parseObject(largeScreenDataEntity.getData(), XxlJobQueryVO.class); @@ -58,7 +58,7 @@ public class BillingDataServiceImpl implements IBillingDataService { @Override public List getMonthBillingData() { - LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1"))); + LargeScreenDataEntity largeScreenDataEntity = largeScreenDataMapper.selectOne(Wrappers.lambdaQuery().orderByDesc(LargeScreenDataEntity::getCreateTime).last("LIMIT 1")); if (largeScreenDataEntity == null) { return new ArrayList<>(); diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml index 169fb17a3..4ffe10b73 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/WarehouseWaybillMapper.xml @@ -671,6 +671,9 @@ and lww.pay_status = #{param.payStatus} + + and lww.sign_user_name = #{param.signUserName} + and lww.settlement_status = #{param.settlementStatus}