From 2112c32498fa18f892ff47aefd10ee1b5cdc86f4 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Wed, 27 Dec 2023 11:49:43 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A3=85=E8=BD=A6=E5=8F=96=E6=B6=88=E5=88=86?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionDeliveryAppController.java | 4 +-- .../DistributionDeliveryListController.java | 10 +++++- .../DistributionDeliveryInfoMapper.java | 2 +- .../IDistributionDeliveryListService.java | 11 +++++- .../impl/DistributionAsyncServiceImpl.java | 34 +++++++++--------- .../DistributionDeliveryListServiceImpl.java | 35 ++++++++++++++----- .../impl/DistributionSignforServiceImpl.java | 9 +++-- 7 files changed, 72 insertions(+), 33 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java index 4a4c595f2..e9b5a3b8d 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/appcontroller/DistributionDeliveryAppController.java @@ -65,8 +65,8 @@ public class DistributionDeliveryAppController { @GetMapping("/custom") @ApiOperationSupport(order = 3) @ApiOperation(value = "详情", notes = "传入DistributionDeliveryListDTO") - public R> detail(DistributionAppDeliveryListDTO distributionDeliveryList, Query query) { - IPage pages = distributionDeliveryListService.getAppDeliveryreservationListPage(Condition.getPage(query),distributionDeliveryList); + public R> detail(DistributionAppDeliveryListDTO distributionDeliveryList) { + List pages = distributionDeliveryListService.getAppDeliveryreservationListPage(distributionDeliveryList); return R.data(pages); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java index cc7fe4748..61db588ca 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistributionDeliveryListController.java @@ -393,6 +393,15 @@ public class DistributionDeliveryListController extends BladeController { return result; } + + @GetMapping("/judgmentOrderRemove") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "判断是否可以在商配计划中移除", notes = "customArgs") + public R judgmentOrderRemove(@RequestParam Long deliveryId,@RequestParam Long orderId) { + boolean result = distributionDeliveryListService.judgmentOrderRemove(deliveryId,orderId); + return R.data(result); + } + @PostMapping("/printBatch") @ApiOperationSupport(order = 2) @ApiOperation(value = "批量打印 配送单") @@ -418,6 +427,5 @@ public class DistributionDeliveryListController extends BladeController { } catch (Exception e) { throw new RuntimeException(e); } - } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java index 7870cc2fa..e29c9ffac 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryInfoMapper.java @@ -132,7 +132,7 @@ public interface DistributionDeliveryInfoMapper extends BaseMapper selectAppcustomListPage(IPage page,@Param("deliveryListId") Long id); + List selectAppcustomListPage(@Param("deliveryListId") Long id); /** * App-通过配送查询客户库存品信息分页 * diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java index a5b6b9a6e..a9f22e1c5 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionDeliveryListService.java @@ -150,7 +150,7 @@ public interface IDistributionDeliveryListService extends BaseService getAppDeliveryreservationListPage(IPage page,DistributionAppDeliveryListDTO distributionDeliveryList); + List getAppDeliveryreservationListPage(DistributionAppDeliveryListDTO distributionDeliveryList); List selectDistributionAppDeliverywrapIn( DistributionAppDeliveryListDTO distributionAppDeliveryListDTO); @@ -385,6 +385,15 @@ public interface IDistributionDeliveryListService extends BaseService getShippingInformation(IPage page, DistributionDeliveryListDTO distributionDeliveryInfoDTO); + /** + * 查询商配计划订单是否可以移除 + * @param deliveryId + * @param orderId + * @return + */ + boolean judgmentOrderRemove(Long deliveryId, Long orderId); + + /** * 查询签收预约客户包件信息 * @param reservationId 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 46b36ac0b..a0d667bf5 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 @@ -1214,24 +1214,24 @@ public class DistributionAsyncServiceImpl implements IDistributionAsyncService { if (Func.isNotEmpty(packageId)) { DistributionParcelListEntity parcelListEntity = distributionParcelListService.getById(packageId); //维护包件所属订单签收状态 - DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); - //维护该订单的签收状态 - if (Func.isNotEmpty(stockArticleEntity)) { - Integer totalNumber = stockArticleEntity.getTotalNumber(); - Integer orderSignNum = distributionLoadscanMapper.selectOrderSignNum(stockArticleEntity.getId()); - Integer orderLoadingNum = distributionLoadscanMapper.selectOrderLoadingNum(stockArticleEntity.getId()); - - if (Func.isNotEmpty(orderSignNum) && orderSignNum > 0) { - if (totalNumber == orderSignNum) { - stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); - } else { - stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); - } - } - distributionStockArticleService.updateById(stockArticleEntity); - } +// DistributionStockArticleEntity stockArticleEntity = distributionStockArticleService.getById(parcelListEntity.getStockArticleId()); +// //维护该订单的签收状态 +// if (Func.isNotEmpty(stockArticleEntity)) { +// Integer totalNumber = stockArticleEntity.getTotalNumber(); +// Integer orderSignNum = distributionLoadscanMapper.selectOrderSignNum(stockArticleEntity.getId()); +// Integer orderLoadingNum = distributionLoadscanMapper.selectOrderLoadingNum(stockArticleEntity.getId()); +// +// if (Func.isNotEmpty(orderSignNum) && orderSignNum > 0) { +// if (totalNumber == orderSignNum) { +// stockArticleEntity.setOrderStatus(OrderStatusConstant.qianshou.getValue()); +// } else { +// stockArticleEntity.setOrderStatus(OrderStatusConstant.bufenqianshou.getValue()); +// } +// } +// distributionStockArticleService.updateById(stockArticleEntity); +// } + distributionStockArticleService.updateOrderInfo(parcelListEntity.getOrderCode(),parcelListEntity.getWarehouseId()); } - checkReservationAndDeliveryLoadingStatus(deliveryId, reservationId); checkReservationAndDeliverySigningStatus(reservationId, deliveryId); //注意:这里对于异常装车的包件也需要进行统计 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 cf7bc4578..f989cfee6 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 @@ -597,11 +597,12 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImplquery().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())); @@ -612,7 +613,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationEntities = reservationEntityList.stream().filter(r -> Func.isNotEmpty(r.getConsignee()) && r.getConsignee().equals(stockArticleEntity.getCustomerName()) && r.getDeliveryAddress().equals(stockArticleEntity.getCustomerAddress()) && r.getDeliveryPhone().equals(stockArticleEntity.getCustomerTelephone()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList()); //查看是否存在满足条件的预约单 if (reservationEntities.size() == 1) { @@ -631,7 +631,6 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl r.getDeliveryType().equals(DistributionTypeConstant.shangpei.getValue())); if (shangpeiFlag) { List reservationEntities = reservationEntityList.stream().filter(r -> r.getReceivingUnit().equals(stockArticleEntity.getConsigneeUnit()) && r.getMallName().equals(stockArticleEntity.getMallName())).collect(Collectors.toList()); @@ -764,6 +763,11 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl getAppDeliveryreservationListPage(IPage page, DistributionAppDeliveryListDTO distributionDeliveryList) { + public List getAppDeliveryreservationListPage( DistributionAppDeliveryListDTO distributionDeliveryList) { //查询客户 - List customList = distributionDeliveryInfoMapper.selectAppcustomListPage(page, distributionDeliveryList.getId()); + List customList = distributionDeliveryInfoMapper.selectAppcustomListPage(distributionDeliveryList.getId()); for (DistributionAppReservationVO distributionAppReservationVO : customList) { List reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(distributionAppReservationVO.getId()); List distributionStockEntities = new ArrayList<>(); @@ -2712,7 +2716,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl loadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getDeliveryId, deliveryId) + .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) + ); + if (Func.isNotEmpty(loadscanEntityList)){ + Map loadingOrderMap = loadscanEntityList.stream().collect(Collectors.toMap(DistributionLoadscanEntity::getOrderId, Function.identity(), (k1, k2) -> k2)); + if (Func.isNotEmpty(loadingOrderMap.get(orderId))){ + return false; + } + } + return true; + } } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java index 47e751e86..a163b5cc6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSignforServiceImpl.java @@ -791,6 +791,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl