From f75eca0009626d79aa15554f0d861d68250bafd3 Mon Sep 17 00:00:00 2001 From: caoyizhong <1270296080> Date: Fri, 19 Jan 2024 14:40:41 +0800 Subject: [PATCH 01/39] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=B7=A5=E5=8D=95?= =?UTF-8?q?=E5=8F=B7=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aftersales/service/impl/AftersalesWorkOrderServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java index 2df282bed..9208dccfb 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesWorkOrderServiceImpl.java @@ -158,7 +158,7 @@ public class AftersalesWorkOrderServiceImpl extends BaseServiceImpl numberRules = DictBizCache.getList("work_order_number_rules"); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmss"); - if (numberRules.isEmpty()) { + if (ObjectUtils.isNull(numberRules) || numberRules.isEmpty()) { log.info("注意,注意!工单号字典未配置!请配置!"); } else { Optional first2 = pcWorkOrder.stream().filter(i -> i.getDictKey().equals(workOrderType)).findFirst(); From f0bf9d076ac5c42221d584ef74998c97d0e8efd3 Mon Sep 17 00:00:00 2001 From: Diss <1157651603@qq.com> Date: Mon, 22 Jan 2024 09:32:27 +0800 Subject: [PATCH 02/39] =?UTF-8?q?=E6=8F=90=E8=B4=A7=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E5=80=BC=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/basicdata/entity/BasicdataCarrierEntity.java | 6 +----- .../com/logpm/basicdata/entity/BasicdataVehicleEntity.java | 3 +-- .../logpm/basicdata/entity/BasicdataWarehouseEntity.java | 5 ----- .../distribution/mapper/DistrilbutionBillStockMapper.xml | 1 + 4 files changed, 3 insertions(+), 12 deletions(-) diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataCarrierEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataCarrierEntity.java index faafccbd4..1c68ceebd 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataCarrierEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataCarrierEntity.java @@ -207,10 +207,6 @@ public class BasicdataCarrierEntity extends TenantEntity { */ @ApiModelProperty(value = "预留5") private String reserve5; - /** - * id - */ - @ApiModelProperty(value = "id") - private Long id; + } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java index fde956de0..4637ec2ec 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataVehicleEntity.java @@ -319,6 +319,5 @@ public class BasicdataVehicleEntity extends TenantEntity { @ApiModelProperty(value = "预留5") private String reserve5; - @ApiModelProperty(value = "id") - private Long id; + } diff --git a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java index 66b8dbaed..39fbc2e19 100644 --- a/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java +++ b/blade-service-api/logpm-basicdata-api/src/main/java/com/logpm/basicdata/entity/BasicdataWarehouseEntity.java @@ -281,9 +281,4 @@ public class BasicdataWarehouseEntity extends TenantEntity { private Integer oldId; - /** - * 对应id - */ - @ApiModelProperty(value = "仓库id") - public Long id; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml index 8a499d4af..831493ea0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillStockMapper.xml @@ -123,6 +123,7 @@ CASE WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3)) = 0 THEN 20 WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3)) > 0 THEN 10 + WHEN (SELECT COUNT(id) FROM logpm_distribution_bill_lading_scan WHERE stock_article_id = ldsa.id) - (SELECT COUNT(id) FROM logpm_distrilbution_bill_package WHERE stock_article_id = ldsa.id AND packet_bar_status IN (1,3)) < 0 THEN 30 END AS conditions, (select GROUP_CONCAT(DISTINCT ldpl.material_name ) from logpm_distribution_parcel_list ldpl From 6e6e1823eee778a76417250e550a571d2b141c91 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 22 Jan 2024 10:03:43 +0800 Subject: [PATCH 03/39] =?UTF-8?q?=E5=BE=85=E7=AD=BE=E6=94=B6=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E8=BF=87=E6=BB=A4=E6=95=B0=E9=87=8F=E4=B8=BA0?= =?UTF-8?q?=E7=9A=84=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/distribution/mapper/DistributionLoadscanMapper.xml | 4 ---- .../logpm/distribution/mapper/DistributionSignforMapper.xml | 2 +- .../service/impl/DistributionSignforServiceImpl.java | 3 --- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml index 5aabf4b43..44825f6fb 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionLoadscanMapper.xml @@ -256,9 +256,6 @@ + + + + select lwug.position_code allocationTitle, + lwug.allocation_id, ldsi.market_name marketName, - lwug.num, + sum(lwug.num) num, lwug.create_time createTime, ldsi.cargo_unit cargoUnit, ldsi.unpack, @@ -402,10 +403,11 @@ logpm_distribution_stock_list ldsi left join logpm_distribution_stock_list_info ldsli on ldsli.material_id = ldsi.material_id AND ldsli.warehouse_id = ldsi.warehouse_id AND ldsi.market_id = ldsli.market_id and ldsli.incoming_batch = ldsi.incoming_batch - LEFT JOIN logpm_warehouse_updown_goods lwug ON ldsli.parcel_list_id = lwug.association_id and lwug.association_type = '4' + LEFT JOIN logpm_warehouse_updown_goods lwug ON ldsli.parcel_list_id = lwug.association_id and lwug.association_type = '3' and ldsi.id = #{param.id} + group by lwug.allocation_id From 3bfa0da9a8d950af4b045831fe733756ce78b902 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 22 Jan 2024 19:44:00 +0800 Subject: [PATCH 18/39] =?UTF-8?q?1.=E6=9F=A5=E8=AF=A2=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E5=93=81=E6=98=8E=E7=BB=86=E5=BA=93=E4=BD=8D=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DistributionStockListServiceImpl.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java index ba0f8153e..9dc9f9495 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java @@ -465,6 +465,17 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl listAllocation(IPage page, Map distributionStockList) { DistributionStockListEntity distributionStockListEntity = JSONObject.parseObject(JSONObject.toJSONString(distributionStockList), DistributionStockListEntity.class); IPage pageList = null; + Long marketId = distributionStockListEntity.getMarketId(); + Long materialId = distributionStockListEntity.getMaterialId(); + String incomingBatch = distributionStockListEntity.getIncomingBatch(); + Long warehouseId = distributionStockListEntity.getWarehouseId(); + + QueryWrapper queryWrapper = new QueryWrapper<>(); + queryWrapper.eq("market_id",marketId) + .eq("material_id",materialId) + .eq("incomingBatch",incomingBatch) + .eq("warehouse_id",warehouseId); + distributionStockListEntity = getOne(queryWrapper); if(Objects.isNull(distributionStockListEntity)){ log.warn("##################listAllocation: 库存品信息不存在"); From a540b68bab688627070d86107cd0c5f99beb84b0 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 22 Jan 2024 19:47:30 +0800 Subject: [PATCH 19/39] =?UTF-8?q?1.=E6=9F=A5=E8=AF=A2=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E5=93=81=E6=98=8E=E7=BB=86=E5=BA=93=E4=BD=8D=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionStockListServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java index 9dc9f9495..3604b42dc 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionStockListServiceImpl.java @@ -473,7 +473,7 @@ public class DistributionStockListServiceImpl extends BaseServiceImpl queryWrapper = new QueryWrapper<>(); queryWrapper.eq("market_id",marketId) .eq("material_id",materialId) - .eq("incomingBatch",incomingBatch) + .eq("incoming_batch",incomingBatch) .eq("warehouse_id",warehouseId); distributionStockListEntity = getOne(queryWrapper); From 80a71bcebfcc16ca0c621bb054e7f14ccfcddec0 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Mon, 22 Jan 2024 20:25:34 +0800 Subject: [PATCH 20/39] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E5=91=98?= =?UTF-8?q?=E7=AD=BE=E6=94=B6=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionSignforServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 c518bef6e..520505418 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 @@ -493,7 +493,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl Date: Tue, 23 Jan 2024 10:39:47 +0800 Subject: [PATCH 21/39] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=B6=E9=97=B4?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionSignforServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 520505418..4f166d5d5 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 @@ -484,7 +484,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl Date: Tue, 23 Jan 2024 11:07:32 +0800 Subject: [PATCH 22/39] =?UTF-8?q?=E9=85=8D=E9=80=81=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E3=80=81=E5=A4=87=E8=B4=A7=E5=BA=93=E4=BD=8DSQL=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E3=80=81=E5=A4=8D=E6=A0=B8=E7=AD=BE=E6=94=B6=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=A0=BC=E5=BC=8F=E5=8C=96=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionDeliveryListController.java | 17 +++++++ .../mapper/DistributionReservationMapper.xml | 2 +- .../mapper/DistributionSignforMapper.java | 7 +++ .../mapper/DistributionSignforMapper.xml | 3 ++ .../IDistributionDeliveryListService.java | 14 ++++++ .../service/IDistributionSignforService.java | 8 ++++ .../DistributionDeliveryListServiceImpl.java | 45 +++++++++++++++++++ .../impl/DistributionSignforServiceImpl.java | 11 ++++- .../impl/DistributionStockupServiceImpl.java | 1 - 9 files changed, 104 insertions(+), 4 deletions(-) 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 c22afa381..12c721edf 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 @@ -482,4 +482,21 @@ public class DistributionDeliveryListController extends BladeController { R r = distributionSignforService.signforInPC(distrilbutionloadingscanDTO); return r; } + + + + @PostMapping("/cancelDelivery") + @ApiOperationSupport(order = 2) + @ApiOperation(value = "PC签收包件") + public R cancelDelivery(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) { + R r = distributionDeliveryListService.cancelDelivery(distrilbutionloadingscanDTO.getDeliveryId()); + return r; + } + + + + + + + } 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 12c99489b..254ecd992 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 @@ -335,7 +335,7 @@ LEFT JOIN logpm_distribution_stock_list ldsl ON ldrs.stocklist_id = ldsl.id WHERE ldrs.reservation_id = #{reservationId} - AND ldsl.mall_name = #{mallName} + AND ldsl.market_name = #{mallName} group by ldsl.cargo_number ) t LEFT JOIN logpm_distribution_stock_list ldslNew ON t.cargo_number = ldslNew.cargo_number 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 23c2ea57d..37e274f25 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 @@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.logpm.distribution.dto.DistributionSignforDTO; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.entity.DistributionParcelListEntity; +import com.logpm.distribution.entity.DistributionReservationEntity; import com.logpm.distribution.entity.DistributionSignforEntity; import com.logpm.distribution.excel.DistributionSignforExcel; import com.logpm.distribution.vo.*; @@ -313,4 +314,10 @@ public interface DistributionSignforMapper extends BaseMapper signingPackageDetail(@Param("reservationId") Long reservationId); + + /** + * 查询配送单关联预约 + * @param deliveryId + */ + List selectReservationByDeliveryId(Long deliveryId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index 8907b947f..032563948 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -1279,4 +1279,7 @@ ldr.id = #{reservationId} + 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 bd8587232..0a7ae5613 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 @@ -25,6 +25,7 @@ import com.logpm.distribution.dto.DistributionDeliveryListDTO; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; import com.logpm.distribution.dto.app.DistrilbutionloadingscanDTO; import com.logpm.distribution.entity.DistributionDeliveryListEntity; +import com.logpm.distribution.entity.DistributionLoadscanEntity; import com.logpm.distribution.entity.DistributionParcelListEntity; import com.logpm.distribution.excel.DistributionDeliveryListExcel; import com.logpm.distribution.vo.*; @@ -405,6 +406,19 @@ public interface IDistributionDeliveryListService extends BaseService selectAbnormalLoadingBydeliveryId(Long deliveryId); + /** * 查询签收预约客户包件信息 diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java index 3b69adcec..75ee5e378 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionSignforService.java @@ -22,6 +22,7 @@ import com.logpm.distribution.dto.DistributionAddvalueDTO; import com.logpm.distribution.dto.DistributionSignforDTO; import com.logpm.distribution.dto.DistrilbutionAppsignforDTO; import com.logpm.distribution.dto.app.DistributionAppDeliveryListDTO; +import com.logpm.distribution.entity.DistributionReservationEntity; import com.logpm.distribution.entity.DistributionSignPrintEntity; import com.logpm.distribution.entity.DistributionSignforEntity; import com.logpm.distribution.excel.DistributionSignforExcel; @@ -275,4 +276,11 @@ public interface IDistributionSignforService extends BaseService selectReservationByDeliveryId(Long 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 8a8f552ad..23d1d944b 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 @@ -6758,6 +6758,51 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationEntities = distributionSignforService.selectReservationByDeliveryId(deliveryId); + if (Func.isEmpty(reservationEntities)){ + log.info(method + "预约查询失败:{}", deliveryId); + throw new RuntimeException("服务器正忙!!!"); + } + String reservationCodes = reservationEntities.stream().filter(f -> !f.getLoadingStatus().equals(ReservationLoadingStatusConstant.daizhuangche.getValue())).map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(",")); + if (Func.isNotEmpty(reservationCodes)){ + log.info(method + "存在装车数据:{}", deliveryId); + return R.fail(reservationCodes+"存在装车数据!!!"); + } + //该配送是否存在异常装车或者异常签收数据 + List loadscanEntityList = distributionDeliveryListService.selectAbnormalLoadingBydeliveryId(deliveryId); + if (Func.isNotEmpty(loadscanEntityList)){ + log.info(method + "存在异常装车数据:{}", deliveryId); + return R.fail(reservationCodes+"存在异常装车、签收包条!!!"); + } + boolean flag = false; + for (DistributionReservationEntity reservationEntity : reservationEntities) { + DistributionReservationDTO reservationDTO = Func.copy(reservationEntity, DistributionReservationDTO.class); + flag = distributionReservationService.cancelReservation(reservationDTO); + if (!flag){ + log.info(method + "取消预约失败:{}", deliveryId); + throw new RuntimeException("取消配送计划失败,请联系管理员"); + } + } + return R.status(flag); + } + + @Override + public List selectAbnormalLoadingBydeliveryId(Long deliveryId) { + return distributionLoadscanService.list(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getDeliveryId,deliveryId) + .eq(DistributionLoadscanEntity::getScanStatus,LoadingStatusConstant.quxiao.getValue()) + .eq(DistributionLoadscanEntity::getIsAbnormalLoading,2) + ); + } + @Override @Transactional public void maintenanceDeliveryInfo(Long deliveryId) { 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 520505418..34be9e4fd 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 @@ -484,13 +484,14 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl selectReservationByDeliveryId(Long deliveryId) { + + return baseMapper.selectReservationByDeliveryId(deliveryId); + } + private boolean judgmentSignIsHavePackage(Long reservationId) { boolean flag = false; List distributionParcelListEntities = distributionReservationMapper.selectPackageListByReservationId(reservationId); 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 d55d33684..13bc31eb2 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 @@ -1159,7 +1159,6 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl Date: Tue, 23 Jan 2024 11:19:32 +0800 Subject: [PATCH 23/39] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF-=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OpenOrderServiceImpl.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index f342efee9..061ab5d3e 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -1091,10 +1091,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceDetailEntities.add(advanceDetailModel); } - int all = orderPackageCodes.size() + advanceDetailEntities.size(); - if(all != trunklineAdvanceEntity.getTotalNum()){ - advanceService.updateTotalNumById(trunklineAdvanceEntity.getId(),all); - } +// int all = orderPackageCodes.size() + advanceDetailEntities.size(); +// if(all != trunklineAdvanceEntity.getTotalNum()){ +// advanceService.updateTotalNumById(trunklineAdvanceEntity.getId(),all); +// } } advanceDetailService.saveBatch(advanceDetailEntities); @@ -1218,10 +1218,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceDetailEntities.add(advanceDetailModel); } - int all = orderPackageCodes.size() + advanceDetailEntities.size(); - if(all != trunklineAdvanceEntity.getTotalNum()){ - advanceService.updateTotalNumById(trunklineAdvanceEntity.getId(),all); - } +// int all = orderPackageCodes.size() + advanceDetailEntities.size(); +// if(all != trunklineAdvanceEntity.getTotalNum()){ +// advanceService.updateTotalNumById(trunklineAdvanceEntity.getId(),all); +// } } advanceDetailService.saveBatch(advanceDetailEntities); From c9626e0656a6be5763f25a9c7e27ae9e02681f6b Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 23 Jan 2024 11:44:48 +0800 Subject: [PATCH 24/39] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF-=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trunkline/service/impl/OpenOrderServiceImpl.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 061ab5d3e..2b00c34ab 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -1004,9 +1004,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService { List importCustomizedOuPaiDTOS = EasyExcel.read(inputStream).head(ImportCustomizedOuPaiDTO.class).sheet(0).headRowNumber(1).doReadSync(); - Map> listMap = importCustomizedOuPaiDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "-" + a.getTrainNumber())); + Map> listMap = importCustomizedOuPaiDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "&" + a.getTrainNumber())); - listMap.remove("null-null"); + listMap.remove("null&null"); Set set = listMap.keySet(); @@ -1015,7 +1015,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { for (String str : set) { List paiDTOList = listMap.get(str); ImportCustomizedOuPaiDTO importCustomizedOuPaiDTO = paiDTOList.get(0); - String[] split = str.split("-"); + String[] split = str.split("&"); String orderCode = split[0]; String trainNumber = split[1]; List orderPackageCodes = new ArrayList<>(); @@ -1116,9 +1116,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService { InputStream inputStream = file.getInputStream(); List importStandardOuPaiDTOS = EasyExcel.read(inputStream).head(ImportStandardOuPaiDTO.class).sheet(0).headRowNumber(1).doReadSync(); - Map> listMap = importStandardOuPaiDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "-" + a.getTrainNumber())); + Map> listMap = importStandardOuPaiDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "&" + a.getTrainNumber())); - listMap.remove("null-null"); + listMap.remove("null&null"); Set set = listMap.keySet(); @@ -1126,7 +1126,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { for (String str : set) { List paiDTOList = listMap.get(str); ImportStandardOuPaiDTO importStandardOuPaiDTO = paiDTOList.get(0); - String[] split = str.split("-"); + String[] split = str.split("&"); String orderCode = split[0]; String trainNumber = split[1]; List orderPackageCodes = new ArrayList<>(); From 8127662199465e5c577b3165f7866ca71e7500d8 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 23 Jan 2024 11:45:36 +0800 Subject: [PATCH 25/39] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF-=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/trunkline/service/impl/OpenOrderServiceImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 2b00c34ab..d26019df7 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -871,9 +871,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService { List pacakgeDetailExcelDTOS = EasyExcel.read(inputStream).head(PacakgeDetailExcelDTO.class).sheet(0).headRowNumber(2).doReadSync(); - Map> listMap = pacakgeDetailExcelDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "-" + a.getTrainNumber())); + Map> listMap = pacakgeDetailExcelDTOS.parallelStream().collect(Collectors.groupingBy(a -> a.getOrderCode() + "&" + a.getTrainNumber())); - listMap.remove("null-null"); + listMap.remove("null&null"); Set set = listMap.keySet(); List advanceDetailEntities = new ArrayList<>(); @@ -882,7 +882,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { for (String str : set) { List detailExcelDTOS = listMap.get(str); PacakgeDetailExcelDTO pacakgeDetailExcelDTO = detailExcelDTOS.get(0); - String[] split = str.split("-"); + String[] split = str.split("&"); String orderCode = split[0]; String trainNumber = split[1]; List orderPackageCodes = new ArrayList<>(); From 8acbb0bc061bad4ba9e6534867c227e8580bbc66 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 23 Jan 2024 13:44:15 +0800 Subject: [PATCH 26/39] =?UTF-8?q?=E9=85=8D=E9=80=81=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/mapper/DistributionSignforMapper.xml | 2 +- .../service/impl/DistributionDeliveryListServiceImpl.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index 032563948..64588eb84 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -1280,6 +1280,6 @@ 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 23d1d944b..5ba83b2be 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 @@ -6764,17 +6764,17 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationEntities = distributionSignforService.selectReservationByDeliveryId(deliveryId); if (Func.isEmpty(reservationEntities)){ log.info(method + "预约查询失败:{}", deliveryId); - throw new RuntimeException("服务器正忙!!!"); + return R.fail("服务器正忙!!!"); } String reservationCodes = reservationEntities.stream().filter(f -> !f.getLoadingStatus().equals(ReservationLoadingStatusConstant.daizhuangche.getValue())).map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(",")); if (Func.isNotEmpty(reservationCodes)){ - log.info(method + "存在装车数据:{}", deliveryId); - return R.fail(reservationCodes+"存在装车数据!!!"); + log.info(method + "存在装车数据:{}", reservationCodes); + return R.fail(reservationCodes+"存在装车包件!!!"); } //该配送是否存在异常装车或者异常签收数据 List loadscanEntityList = distributionDeliveryListService.selectAbnormalLoadingBydeliveryId(deliveryId); From aa2971e59b24f07233c4c2e8bf7c24d50b82cdbb Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 23 Jan 2024 13:50:52 +0800 Subject: [PATCH 27/39] =?UTF-8?q?=E9=85=8D=E9=80=81=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/distribution/mapper/DistributionSignforMapper.xml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index 64588eb84..0341cadff 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -1280,6 +1280,9 @@ From 7b51b5dc18f7a67d1b5a21e1a2211e90e9fc92aa Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 23 Jan 2024 13:52:19 +0800 Subject: [PATCH 28/39] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF-=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trunkline/service/impl/OpenOrderServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index d26019df7..74b6fe27a 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -981,10 +981,10 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceDetailEntities.add(advanceDetailModel); } - int all = orderPackageCodes.size() + advanceDetailEntities.size(); - if(all != advanceEntity.getTotalNum()){ - advanceService.updateTotalNumById(advanceEntity.getId(),all); - } +// int all = orderPackageCodes.size() + advanceDetailEntities.size(); +// if(all != advanceEntity.getTotalNum()){ +// advanceService.updateTotalNumById(advanceEntity.getId(),all); +// } } advanceDetailService.saveBatch(advanceDetailEntities); From f55db137c70838c00289f9ab10b67969e3a379ca Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 23 Jan 2024 14:15:50 +0800 Subject: [PATCH 29/39] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF-=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=80=BB=E8=BE=91=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java | 1 + 1 file changed, 1 insertion(+) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java index 74b6fe27a..4dd3c0eea 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/OpenOrderServiceImpl.java @@ -1168,6 +1168,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceDetailModel.setWarehouseId(warehouseId); advanceDetailModel.setWarehouseName(warehouseName); advanceDetailModel.setAdvanceId(trunklineAdvanceEntity.getId()); + advanceDetailModel.setOrderPackageCode(orderPackageCode); advanceDetailModel.setOrderCode(orderCode); advanceDetailModel.setBrand("欧派"); advanceDetailModel.setSystemType("线上"); From 0e56f11c6aa13aebea869b7048ad62351f76384e Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 23 Jan 2024 14:42:03 +0800 Subject: [PATCH 30/39] =?UTF-8?q?=E5=8F=96=E6=B6=88=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E9=85=8D=E9=80=81=E6=8E=A5=E5=8F=A3=E3=80=81=E5=95=86=E9=85=8D?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/DistributionDeliveryListController.java | 5 +++++ .../controller/DistrilbutionBillLadingController.java | 7 +++++++ .../logpm/distribution/dto/DistrilbutionBillLadingDTO.java | 5 +++++ .../distribution/mapper/DistributionDeliveryListMapper.xml | 2 +- .../distribution/mapper/DistributionSignforMapper.xml | 5 +++-- .../service/IDistrilbutionBillLadingService.java | 7 +++++++ .../service/impl/DistrilbutionBillLadingServiceImpl.java | 6 ++++++ 7 files changed, 34 insertions(+), 3 deletions(-) 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 12c721edf..a73182c53 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 @@ -490,6 +490,11 @@ public class DistributionDeliveryListController extends BladeController { @ApiOperation(value = "PC签收包件") public R cancelDelivery(@Valid @RequestBody DistrilbutionAppsignforDTO distrilbutionloadingscanDTO) { R r = distributionDeliveryListService.cancelDelivery(distrilbutionloadingscanDTO.getDeliveryId()); + if (r.isSuccess()){ + //取消成功,维护配送单状态和数量 + distributionDeliveryListService.maintenanceDeliveryNum(distrilbutionloadingscanDTO.getDeliveryId()); + distributionDeliveryListService.maintenanceDeliveryInfo(distrilbutionloadingscanDTO.getDeliveryId()); + } return r; } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java index 08f35f04c..3bada1f38 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java @@ -275,6 +275,13 @@ public class DistrilbutionBillLadingController extends BladeController { return R.status(distrilbutionBillLadingService.ownSaveOrUpdate(distrilbutionBillLading)); } + @PostMapping("/cancelBillLoding") + @ApiOperationSupport(order = 1) + @ApiOperation(value = "批量取消自提单", notes = "传入distrilbutionBillLading") + public R cancelBillLoding(@Valid @RequestBody DistrilbutionBillLadingDTO distrilbutionBillLadingDTO) { + return R.status(distrilbutionBillLadingService.cancelBillLoding(distrilbutionBillLadingDTO.getBillLodingIds())); + } + /** diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java index 12ba89c9b..8e0e45643 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/dto/DistrilbutionBillLadingDTO.java @@ -42,6 +42,11 @@ public class DistrilbutionBillLadingDTO extends DistrilbutionBillLadingEntity { * */ private String name; + + /** + * + */ + private String billLodingIds; /** * 提货批次 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 8eb691651..6b19840b8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -210,7 +210,7 @@ left JOIN logpm_distribution_signfor lds on lddl.id = lds.delivery_id LEFT JOIN logpm_distribution_reservation ldr on ldr.id = lds.reservation_id - lddl.is_deleted = 0 AND (IF(lddl.delivery_number is null ,0,lddl.delivery_number) + IF(lddl.inventory_nub is null ,0,lddl.inventory_nub)) > 0 + lddl.is_deleted = 0 AND (IF(lddl.delivery_number is null ,0,lddl.delivery_number) + IF(lddl.inventory_nub is null ,0,lddl.inventory_nub)) > 0 AND lddl.customers_number > 0 and lddl.train_number like concat('%',#{param.trainNumber},'%') diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index 0341cadff..c511c3a8b 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -1280,9 +1280,10 @@ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java index 80fe95b60..67f1d18de 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistrilbutionBillLadingService.java @@ -214,4 +214,11 @@ public interface IDistrilbutionBillLadingService extends BaseService Date: Tue, 23 Jan 2024 16:49:18 +0800 Subject: [PATCH 31/39] =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E3=80=81=E8=87=AA=E6=8F=90?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistrilbutionBillLadingController.java | 2 +- .../mapper/DistrilbutionBillLadingMapper.xml | 64 +++++++++---------- .../IDistrilbutionBillLadingService.java | 2 +- .../DistrilbutionBillLadingServiceImpl.java | 30 ++++++++- 4 files changed, 60 insertions(+), 38 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java index 3bada1f38..ea322394a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/controller/DistrilbutionBillLadingController.java @@ -279,7 +279,7 @@ public class DistrilbutionBillLadingController extends BladeController { @ApiOperationSupport(order = 1) @ApiOperation(value = "批量取消自提单", notes = "传入distrilbutionBillLading") public R cancelBillLoding(@Valid @RequestBody DistrilbutionBillLadingDTO distrilbutionBillLadingDTO) { - return R.status(distrilbutionBillLadingService.cancelBillLoding(distrilbutionBillLadingDTO.getBillLodingIds())); + return distrilbutionBillLadingService.cancelBillLoding(distrilbutionBillLadingDTO.getBillLodingIds()); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index dbaa527f5..71ad97c65 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -121,40 +121,35 @@ SELECT reservation_id,COUNT(1) as num from ( diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java index d78fbc7d4..a4dea576e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java @@ -19,8 +19,12 @@ package com.logpm.distribution.mapper; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.logpm.distribution.dto.DistributionDeliveryDetailsDTO; import com.logpm.distribution.dto.DistrilbutionBillLadingDTO; import com.logpm.distribution.dto.app.BillLadingAppDTO; +import com.logpm.distribution.entity.DistributionDeliveryDetailsEntity; +import com.logpm.distribution.entity.DistributionParcelListEntity; +import com.logpm.distribution.entity.DistributionStockListEntity; import com.logpm.distribution.entity.DistrilbutionBillLadingEntity; import com.logpm.distribution.excel.DistrilbutionBillLadingExcel; import com.logpm.distribution.vo.*; @@ -91,4 +95,21 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper exportDistributionBillLading(@Param("param") Map param, @Param("idArr") List idArr); + + + /** + * 取消订制品包件 + * @param billLodingIds + * @return + */ + Integer cancelBillLadingPackage(@Param("ids")List ids); + + /** + * 查询自提单关联包件 + * @param billLodingIds + * @return + */ + List selectBillLadingPackage(@Param("ids")List ids); + + List selectBillLadingInventory(@Param("ids")List ids); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 71ad97c65..9e729dada 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -25,6 +25,12 @@ + + UPDATE logpm_distrilbution_bill_package SET packet_bar_status = 3 WHERE bill_lading_id IN + + #{id} + + + + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDisStockListDetailService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDisStockListDetailService.java index 2bdc628bf..2fcbee1c4 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDisStockListDetailService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDisStockListDetailService.java @@ -68,4 +68,10 @@ public interface IDisStockListDetailService extends BaseService disStockListDetail) throws Exception; + /** + * 取消库存品包件信息 + * @param stockListId + * @param billLadingId + */ + void cancelInventoryPackageByReservationIdAnStockListId(Long stockListId, Long billLadingId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java index 2a38c4b8f..20ecd7fe8 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionParcelListService.java @@ -180,4 +180,10 @@ public interface IDistributionParcelListService extends BaseService findByWaybillNumber(String waybillId); + /** + * 批量还原包件状态 + * @param packageIds + * @return + */ + Integer restorePakcageByIds(List packageIds); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java index c4d510a3d..f9d949057 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DisStockListDetailServiceImpl.java @@ -20,6 +20,7 @@ import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; @@ -248,6 +249,15 @@ public class DisStockListDetailServiceImpl extends BaseServiceImpl updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda().eq(DisStockListDetailEntity::getStockListId,stockListId) + .eq(DisStockListDetailEntity::getReservationId,billLadingId) + .set(DisStockListDetailEntity::getStockPackageStatus,2); + this.update(updateWrapper); + } + /** * 赋值模板转换 * @param id 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 5ba83b2be..237b99bf5 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 @@ -6743,6 +6743,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl packageIds) { + return baseMapper.restorePakcageByIds(packageIds); + } + } 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 2a10959bb..93bdd4798 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 @@ -21,6 +21,7 @@ import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.StringUtils; @@ -667,14 +668,71 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl ids) { + String method = "##########类DistrilbutionBillLadingServiceImpl执行方法cancelBillLoding,"; + BasicdataWarehouseEntity myCurrentWarehouse = basicdataWarehouseClient.getMyCurrentWarehouse(); + if (Func.isEmpty(myCurrentWarehouse)){ + //未授权 + return 1; + } + //查询关联包件进行状态恢复 + List distributionParcelListEntities = baseMapper.selectBillLadingPackage(ids); + if (Func.isNotEmpty(distributionParcelListEntities)){ + List signingPakcage = distributionParcelListEntities.stream().filter(f -> f.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())).collect(Collectors.toList()); + if (Func.isEmpty(signingPakcage)){ + //存在签收包件 + return 3; + } + List packageIds = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); + //将这些包件还原成可操作状态 + Integer num = distributionParcelListService.restorePakcageByIds(packageIds); + //维护订单状态 + String orderCodes = distributionParcelListEntities.stream().map(DistributionParcelListEntity::getOrderCode).distinct().collect(Collectors.joining(",")); + distributionStockArticleService.maintenanceOrderInfo(orderCodes,myCurrentWarehouse.getId()); + }else { + log.error(method+"查询无包件信息:{}",ids); + //自提无包件信息 + return 2; + } + //取消库存品 + //查询自提库存品信息 + List distributionStockListEntities = baseMapper.selectBillLadingInventory(ids); + if (Func.isNotEmpty(distributionStockListEntities)){ + //已经备货的库存品 存在库存品包件 + distributionStockListEntities.forEach(ddd->{ + //进行库存品包件取消 + if (ddd.getStockStatus().equals("3")){ + disStockListDetailService.cancelInventoryPackageByReservationIdAnStockListId(ddd.getStockListId(),ddd.getBillLadingId()); + } + //恢复库存品数量 - return R.status(true); + + + } + ); + + + + + + //对所有的库存品相关进行取消标识 + UpdateWrapper updateWrapper = new UpdateWrapper<>(); + updateWrapper.lambda() + .set(DistributionDeliveryDetailsEntity::getConditions,3) + .set(DistributionDeliveryDetailsEntity::getQuantity,0) + .in(DistributionDeliveryDetailsEntity::getBillLadingId,ids); + distributionDeliveryDetailsService.update(updateWrapper); + } + return 0; } /** From ef38fa853655b2f304499d2dcdcbe345378502a2 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 24 Jan 2024 14:03:52 +0800 Subject: [PATCH 35/39] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=9B=98=E7=82=B9?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E7=9A=84=E7=89=A9=E6=96=99=E5=90=8D=E7=A7=B0?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E9=95=BF=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml index c1506a3d0..a9d6ce07b 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/mapper/TaskQuestMapper.xml @@ -116,7 +116,7 @@ `third_product` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '三级品', `market_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '商场名称(库存品)', `incoming_batch` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '批次号(库存品)', - `material_name` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物料名称(库存品)', + `material_name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '物料名称(库存品)', `waybill_number` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '运单号', `send_warehouse_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '发站仓名称', `tray_name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '托盘名称', From d586a6e92dbc42d8ea1a2cb9578871ec2ee381e4 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 24 Jan 2024 14:22:46 +0800 Subject: [PATCH 36/39] =?UTF-8?q?debug=20=E5=8F=B8=E6=9C=BA=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=B8=8D=E5=87=BA=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionDeliveryListServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) 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 237b99bf5..427c362d0 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 @@ -2227,6 +2227,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>>> distributionAppDeliveryListVOS 司机配送任务列表 {}",distributionAppDeliveryListVOS); //转换字典字段 for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) { From 37f1ec0399248443f72c1845bd55a1a2acfe4fd8 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Wed, 24 Jan 2024 14:36:03 +0800 Subject: [PATCH 37/39] =?UTF-8?q?debug=20=E5=8F=B8=E6=9C=BA=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E4=B8=8D=E5=87=BA=E7=8E=B02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionDeliveryListMapper.xml | 2 +- .../DistributionDeliveryListServiceImpl.java | 351 +++++++++--------- 2 files changed, 178 insertions(+), 175 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index 6b19840b8..dec1a0e52 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -757,7 +757,7 @@ logpm_distribution_delivery_list lddl left join logpm_distribution_delivery_self ldds on lddl.id =ldds.delivery_id - lddl.is_deleted =0 and lddl.warehouse_id =#{warehouseId} + lddl.is_deleted =0 and lddl.customers_number > 0 and lddl.warehouse_id =#{warehouseId} and lddl.type = #{param.type} and lddl.id in 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 427c362d0..395a3866a 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 @@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.logpm.aftersales.vo.AftersalesAbnormalPackageVO; import com.logpm.basic.entity.BasicPrintTemplateEntity; import com.logpm.basic.feign.IBasicPrintTemplateClient; @@ -577,8 +578,8 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl map = new HashMap(); + Map map = new HashMap(); String distrilbutionloadingscanDTOJson = JSONObject.toJSONString(distrilbutionloadingscanDTO); - map.put("distrilbutionloadingscanDTO",distrilbutionloadingscanDTOJson); + map.put("distrilbutionloadingscanDTO", distrilbutionloadingscanDTOJson); String parcelListEntityJson = JSONObject.toJSONString(parcelListEntity); - map.put("parcelListEntity",parcelListEntityJson); - map.put("myCurrentWarehouseId",myCurrentWarehouse.getId()); + map.put("parcelListEntity", parcelListEntityJson); + map.put("myCurrentWarehouseId", myCurrentWarehouse.getId()); String reservationEntityJson = JSONObject.toJSONString(reservationEntity); - map.put("reservationEntity",reservationEntityJson); + map.put("reservationEntity", reservationEntityJson); log.info(">>>>>>>>>>>>> 进入延迟队列处理包件相关信息状态"); @@ -871,7 +872,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectDistributionAppDeliveryListPage(IPage page, DistributionAppDeliveryListDTO distributionAppDeliveryListDTO) { - - //获取当前登录人 - BladeUser user = AuthUtil.getUser(); - String roleId = user.getRoleId(); - //判断当前登录人是否为司机 List distributionAppDeliveryListVOS = new ArrayList<>(); - boolean delivery = false; - String value1 = DictBizCache.getValue("role_class", "delivery_driver_new"); - if (roleId.contains(value1)) delivery = true; - - BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); - + try { +//获取当前登录人 + BladeUser user = AuthUtil.getUser(); + String roleId = user.getRoleId(); + //判断当前登录人是否为司机 + boolean delivery = false; + String value1 = DictBizCache.getValue("role_class", "delivery_driver_new"); + if (roleId.contains(value1)) delivery = true; + BasicdataWarehouseEntity myCurrentWarehouse = warehouseClient.getMyCurrentWarehouse(); // R value = dictBizClient.getValue("role_class", roleId); - if (delivery) { - //查询当前登录人的配送任务 - BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId()); - if (null == driverArtery) { - log.error("没有司机的信息!!"); - return page.setRecords(distributionAppDeliveryListVOS); - } - //查询司机的任务 - List deliveryIds = distributionDeliverySelfMapper.selectdeliveryList(driverArtery.getId()); - if (!deliveryIds.isEmpty()) { - distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, deliveryIds, myCurrentWarehouse.getId()); + if (delivery) { + //查询当前登录人的配送任务 + BasicdataDriverArteryEntity driverArtery = iBasicdataDriverArteryClient.getDriverArtery(user.getUserId()); + if (null == driverArtery) { + log.error("没有司机的信息!!"); + return page.setRecords(distributionAppDeliveryListVOS); + } + //查询司机的任务 + List deliveryIds = distributionDeliverySelfMapper.selectdeliveryList(driverArtery.getId()); + if (!deliveryIds.isEmpty()) { + distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, deliveryIds, myCurrentWarehouse.getId()); + } else { + return page.setRecords(distributionAppDeliveryListVOS); + } } else { - return page.setRecords(distributionAppDeliveryListVOS); + distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, null, myCurrentWarehouse.getId()); } - } else { - distributionAppDeliveryListVOS = baseMapper.selectDistributionAppDeliveryListPage(page, distributionAppDeliveryListDTO, null, myCurrentWarehouse.getId()); - } - log.info(">>>>>>>>>>>>>>>>> distributionAppDeliveryListVOS 司机配送任务列表 {}",distributionAppDeliveryListVOS); - //转换字典字段 - for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) { + log.info(">>>>>>>>>>>>>>>>> distributionAppDeliveryListVOS 司机配送任务列表 {}", distributionAppDeliveryListVOS); + //转换字典字段 + for (DistributionAppDeliveryListVO distributionAppDeliveryListVO : distributionAppDeliveryListVOS) { - distributionAppDeliveryListVO.setScannedNumber(getCarLaodNum(distributionAppDeliveryListVO.getId())); - // 调用下 查询装车件数的方法 - //查询备货区 - if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) { - List list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId()); - QueryWrapper queryWrapper = new QueryWrapper(); + distributionAppDeliveryListVO.setScannedNumber(getCarLaodNum(distributionAppDeliveryListVO.getId())); + // 调用下 查询装车件数的方法 + //查询备货区 + if (StringUtils.isNotBlank(distributionAppDeliveryListVO.getReservationId())) { + List list = CommonUtil.stringNum(distributionAppDeliveryListVO.getReservationId()); + QueryWrapper queryWrapper = new QueryWrapper(); - if (list.size() > 1) { - queryWrapper.in("reservation_id", list); - } else { - queryWrapper.eq("reservation_id", distributionAppDeliveryListVO.getReservationId()); - } - List list1 = distributionStockupInfoService.list(queryWrapper); - if (!list1.isEmpty()) { - DistributionStockupInfoEntity distributionStockupInfoEntity = list1.get(0); - DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntity.getStockupId()); - if (ObjectUtils.isNotNull(distributionStockupEntity)) { - distributionAppDeliveryListVO.setStockupArea(distributionStockupEntity.getStockupArea()); + if (list.size() > 1) { + queryWrapper.in("reservation_id", list); + } else { + queryWrapper.eq("reservation_id", distributionAppDeliveryListVO.getReservationId()); + } + List list1 = distributionStockupInfoService.list(queryWrapper); + if (!list1.isEmpty()) { + DistributionStockupInfoEntity distributionStockupInfoEntity = list1.get(0); + DistributionStockupEntity distributionStockupEntity = distributionStockupMapper.selectById(distributionStockupInfoEntity.getStockupId()); + if (ObjectUtils.isNotNull(distributionStockupEntity)) { + distributionAppDeliveryListVO.setStockupArea(distributionStockupEntity.getStockupArea()); + } else { + distributionAppDeliveryListVO.setStockupArea("无数据"); + } } else { distributionAppDeliveryListVO.setStockupArea("无数据"); } + } + //查询包件签收件数 + Integer lad = distributionLoadscanMapper.selectCount(new QueryWrapper().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getSignforState, 2)).intValue(); + //查询库存品签收件数 + Integer nad = distributionLoadscaninvnMapper.selectCount(new QueryWrapper().lambda().eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscaninvnEntity::getSignforState, 2)).intValue(); + //维护计划数 + List reservationEntityList = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); + if (Func.isNotEmpty(reservationEntityList)) { + int packageNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationNum).sum(); + int invertoryNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationStockListNum).sum(); + distributionAppDeliveryListVO.setDeliveryNumber(packageNum + invertoryNum); } else { - distributionAppDeliveryListVO.setStockupArea("无数据"); + continue; } - } - //查询包件签收件数 - Integer lad = distributionLoadscanMapper.selectCount(new QueryWrapper().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getSignforState, 2)).intValue(); - //查询库存品签收件数 - Integer nad = distributionLoadscaninvnMapper.selectCount(new QueryWrapper().lambda().eq(DistributionLoadscaninvnEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscaninvnEntity::getSignforState, 2)).intValue(); - //维护计划数 - List reservationEntityList = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); - if (Func.isNotEmpty(reservationEntityList)) { - int packageNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationNum).sum(); - int invertoryNum = reservationEntityList.stream().mapToInt(DistributionReservationEntity::getReservationStockListNum).sum(); - distributionAppDeliveryListVO.setDeliveryNumber(packageNum + invertoryNum); - } else { - return null; - } - distributionAppDeliveryListVO.setSignNub(lad + nad); - //查询完成客户数 - Integer cusCount = baseMapper.selectCompletecusCount(distributionAppDeliveryListVO.getId()); - //查询完成订单数 - AtomicInteger ordCount = new AtomicInteger(); + distributionAppDeliveryListVO.setSignNub(lad + nad); + //查询完成客户数 + Integer cusCount = baseMapper.selectCompletecusCount(distributionAppDeliveryListVO.getId()); + //查询完成订单数 + AtomicInteger ordCount = new AtomicInteger(); // List distributionAppStockArticleVOS = baseMapper.selectDistributionAppDeliveryOrderO(distributionAppDeliveryListVO); - List deliveryStockArticleInfo = baseMapper.getDeliveryStockArticleInfo(distributionAppDeliveryListVO.getId()); + List deliveryStockArticleInfo = baseMapper.getDeliveryStockArticleInfo(distributionAppDeliveryListVO.getId()); // deliveryStockArticleInfo.forEach(); - List distributionReservationEntities = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); - distributionReservationEntities.forEach(r -> { - List reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(r.getId()); - reservationStockarticleEntityList.forEach(rs -> { - List loadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getOrderId, rs.getStockArticleId()).eq(DistributionLoadscanEntity::getReservationId, rs.getReservationId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); - if (Func.isNotEmpty(loadscanEntityList)) { - int loadSum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); - if (rs.getReservationNum() == loadSum) { - ordCount.getAndIncrement(); + List distributionReservationEntities = baseMapper.selectReservationByDeliveryListId(distributionAppDeliveryListVO.getId()); + distributionReservationEntities.forEach(r -> { + List reservationStockarticleEntityList = distributionReservationMapper.selectStockArticleByReservationId(r.getId()); + reservationStockarticleEntityList.forEach(rs -> { + List loadscanEntityList = distributionLoadscanService.list(Wrappers.query().lambda().eq(DistributionLoadscanEntity::getDeliveryId, distributionAppDeliveryListVO.getId()).eq(DistributionLoadscanEntity::getOrderId, rs.getStockArticleId()).eq(DistributionLoadscanEntity::getReservationId, rs.getReservationId()).ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue())); + if (Func.isNotEmpty(loadscanEntityList)) { + int loadSum = loadscanEntityList.stream().mapToInt(DistributionLoadscanEntity::getLoadedNub).sum(); + if (rs.getReservationNum() == loadSum) { + ordCount.getAndIncrement(); + } } - } + }); }); - }); // distributionReservationMapper.selectPackageByReservationAndStockArticle() // for (DistributionAppStockArticleVO distributionAppStockArticleVO : distributionAppStockArticleVOS) { // if (distributionAppStockArticleVO.getLoadingNub() >= distributionAppStockArticleVO.getReservationNum()) { // ordCount += 1; // } // } - distributionAppDeliveryListVO.setLoadCusNub(cusCount); - distributionAppDeliveryListVO.setLoadOrdNub(ordCount.get()); - //查询下面的预约单 - List distributionSignforEntityList = distributionSignforMapper.selectList(new QueryWrapper().lambda().eq(DistributionSignforEntity::getDeliveryId, distributionAppDeliveryListVO.getId())); - //提取id - List reList = distributionSignforEntityList.stream().map(DistributionSignforEntity::getId).collect(Collectors.toList()); - distributionAppDeliveryListVO.setType_name(dictBizClient.getValue("distribution_type", distributionAppDeliveryListVO.getType()).getData()); - //查询是否配车 - Integer aLong = 0; - Integer aLong2 = 0; - distributionAppDeliveryListVO.setVehicleStatus_name("已配车"); - distributionAppDeliveryListVO.setDeliStatus_name("配送中"); - if (distributionAppDeliveryListVO.getDeliveryStatus().equals("4")) { - distributionAppDeliveryListVO.setDeliStatus_name("完成"); - } - if (distributionAppDeliveryListVO.getKind().equals("1")) { - aLong = distributionDeliverySelfMapper.selectCount(new QueryWrapper().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue(); - } else { - aLong2 = distributionDeliveryTripartiteMapper.selectCount(new QueryWrapper().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue(); - } - if (aLong == 0 && aLong2 == 0) { - distributionAppDeliveryListVO.setVehicleStatus_name("未配车"); - } - //查询是否备货 - distributionAppDeliveryListVO.setIsstock("备货未完成"); - List stockEntityList = distributionStockMapper.selectList(new QueryWrapper().lambda().eq(DistributionStockEntity::getReservationId, distributionAppDeliveryListVO.getReservationId())); - if (Func.isNotEmpty(stockEntityList)) { - Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数 - int sum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum(); - if (sum == deliveryNumber) { - distributionAppDeliveryListVO.setIsstock("备货完成"); + distributionAppDeliveryListVO.setLoadCusNub(cusCount); + distributionAppDeliveryListVO.setLoadOrdNub(ordCount.get()); + //查询下面的预约单 + List distributionSignforEntityList = distributionSignforMapper.selectList(new QueryWrapper().lambda().eq(DistributionSignforEntity::getDeliveryId, distributionAppDeliveryListVO.getId())); + //提取id + List reList = distributionSignforEntityList.stream().map(DistributionSignforEntity::getId).collect(Collectors.toList()); + distributionAppDeliveryListVO.setType_name(dictBizClient.getValue("distribution_type", distributionAppDeliveryListVO.getType()).getData()); + //查询是否配车 + Integer aLong = 0; + Integer aLong2 = 0; + distributionAppDeliveryListVO.setVehicleStatus_name("已配车"); + distributionAppDeliveryListVO.setDeliStatus_name("配送中"); + if (distributionAppDeliveryListVO.getDeliveryStatus().equals("4")) { + distributionAppDeliveryListVO.setDeliStatus_name("完成"); } - } - //查询司机 - List distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distributionAppDeliveryListVO.getId()); - if (!distributionAppDeliverySelfVOS.isEmpty()) { - StringBuilder stringBuilder = new StringBuilder(); - distributionAppDeliverySelfVOS.forEach(e -> { - if (e.getIsMaster() == 2) { - stringBuilder.append(e.getDriverName()).append("(主)"); - } else { - stringBuilder.append(e.getDriverName()).append("(副)"); + if (distributionAppDeliveryListVO.getKind().equals("1")) { + aLong = distributionDeliverySelfMapper.selectCount(new QueryWrapper().lambda().eq(DistributionDeliverySelfEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue(); + } else { + aLong2 = distributionDeliveryTripartiteMapper.selectCount(new QueryWrapper().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, distributionAppDeliveryListVO.getId())).intValue(); + } + if (aLong == 0 && aLong2 == 0) { + distributionAppDeliveryListVO.setVehicleStatus_name("未配车"); + } + //查询是否备货 + distributionAppDeliveryListVO.setIsstock("备货未完成"); + List stockEntityList = distributionStockMapper.selectList(new QueryWrapper().lambda().eq(DistributionStockEntity::getReservationId, distributionAppDeliveryListVO.getReservationId())); + if (Func.isNotEmpty(stockEntityList)) { + Integer deliveryNumber = distributionAppDeliveryListVO.getDeliveryNumber(); //配送件数 + int sum = stockEntityList.stream().mapToInt(DistributionStockEntity::getStockQuantity).sum(); + if (sum == deliveryNumber) { + distributionAppDeliveryListVO.setIsstock("备货完成"); } - }); - distributionAppDeliveryListVO.setDriverName(stringBuilder.toString()); + } + //查询司机 + List distributionAppDeliverySelfVOS = distributionDeliverySelfMapper.selectListcustom(distributionAppDeliveryListVO.getId()); + if (!distributionAppDeliverySelfVOS.isEmpty()) { + StringBuilder stringBuilder = new StringBuilder(); + distributionAppDeliverySelfVOS.forEach(e -> { + if (e.getIsMaster() == 2) { + stringBuilder.append(e.getDriverName()).append("(主)"); + } else { + stringBuilder.append(e.getDriverName()).append("(副)"); + } + }); + distributionAppDeliveryListVO.setDriverName(stringBuilder.toString()); + } } + } catch (Exception e) { + log.error(">>>>>>>> 司机配送装车查询 报错", e); } return page.setRecords(distributionAppDeliveryListVOS); + } @Override @@ -3021,9 +3024,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl distributionParcelListEntities = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getStockArticleId, s.getId()).ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()).ne(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.yiyueyue.getValue()).notIn(DistributionParcelListEntity::getOrderPackageStatus, new String[]{OrderPackageStatusConstant.yichuku.getValue(), OrderPackageStatusConstant.yiqianshou.getValue()})); if (Func.isEmpty(distributionParcelListEntities)) { log.error("##############添加空订单"); - throw new RuntimeException(s.getOrderCode()+"无可用包件!!!"); + throw new RuntimeException(s.getOrderCode() + "无可用包件!!!"); } distributionParcelListEntities.forEach(dp -> { if (!dp.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())) { @@ -3165,9 +3168,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { if (Func.isEmpty(oldPackageList.get(p.getId()))) { - if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ - log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); - throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); + if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) { + log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId()); + throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单"); } //为该订单新增了包件 DistributionReservationPackageEntity reservationPackageEntity = new DistributionReservationPackageEntity(); @@ -3187,9 +3190,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { - if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ - log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); - throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); + if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) { + log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId()); + throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单"); } DistributionReservationPackageEntity reservationPackageEntity = b.get(0); reservationPackageEntity.setPacketBarStatus(ReservationPackageStatusConstant.quxiao.getValue()); @@ -3286,9 +3289,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl { - if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ - log.error("#############商配文员对已复核预约进行订单追加reservationId:{}",reservationEntity.getId()); - throw new RuntimeException("收货单位:"+reservationEntity.getMallName()+"客户:"+reservationEntity.getConsignee()+"完成复核签收,无法追加订单"); + if (Func.isNotEmpty(signforEntity) && signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())) { + log.error("#############商配文员对已复核预约进行订单追加reservationId:{}", reservationEntity.getId()); + throw new RuntimeException("收货单位:" + reservationEntity.getMallName() + "客户:" + reservationEntity.getConsignee() + "完成复核签收,无法追加订单"); } DistributionReservationStockarticleEntity reservationStockarticleEntity = n.get(0); if (reservationStockarticleEntity.getIsZero().equals(IsOrNoConstant.no.getValue())) { @@ -4170,16 +4173,16 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl orderIds = reservationStockarticleEntityList.stream().filter(order -> order.getIsZero().equals(IsOrNoConstant.no.getValue())).map(DistributionReservationStockarticleEntity::getStockArticleId).collect(Collectors.toList()); if (Func.isNotEmpty(orderIds)) { //查询该客户的非零但订单包间 - IPage parcelListEntityList = distributionReservationMapper.getReservationPackage(page,orderIds, distributionDeliveryInfoDTO); + IPage parcelListEntityList = distributionReservationMapper.getReservationPackage(page, orderIds, distributionDeliveryInfoDTO); parcelListVOIPage.setTotal(parcelListEntityList.getTotal()); // List parcelListEntityList = distributionReservationMapper.getReservationPackageNew(distributionDeliveryInfoDTO); - log.info(">>>>>> parcelListEntityList {}",parcelListEntityList); + log.info(">>>>>> parcelListEntityList {}", parcelListEntityList); List parcelListVOList = DistributionParcelListWrapper.build().listVO(parcelListEntityList.getRecords()); for (DistributionParcelListVO distributionParcelListVO : parcelListVOList) { - log.info(">>>>>> distributionParcelListVO {}",distributionParcelListVO); + log.info(">>>>>> distributionParcelListVO {}", distributionParcelListVO); if (Func.isNotEmpty(loadingDataMap)) { DistributionLoadscanEntity loadscanEntity = loadingDataMap.get(distributionParcelListVO.getId()); - log.info(">>>>>> loadscanEntity {}",loadscanEntity); + log.info(">>>>>> loadscanEntity {}", loadscanEntity); if (Func.isNotEmpty(loadscanEntity)) { if (loadscanEntity.getSignforState().equals(LoadScanSigningStatusConstant.yiqianshou.getValue())) { @@ -4225,7 +4228,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl>>>>> distributionParcelListVO2 {}",distributionParcelListVO); + log.info(">>>>>> distributionParcelListVO2 {}", distributionParcelListVO); distributionParcelListVOS.add(distributionParcelListVO); } @@ -5135,7 +5138,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl parcelListEntities = distributionParcelListService.list(Wrappers.query().lambda().eq(DistributionParcelListEntity::getOrderPackageCode, distrilbutionloadingscanDTO.getBarcode())); if (Func.isNotEmpty(parcelListEntities) && parcelListEntities.size() == 1) { DistributionParcelListEntity parcelListEntity = parcelListEntities.get(0); - if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())){ + if (OrderPackageLoadingStatusConstant.yizhuangche.getValue().equals(parcelListEntity.getOrderPackageLoadingStatus())) { //包件已装车 log.error("重复异常装车,:{}", parcelListEntity.getOrderPackageCode()); return Resp.scanFail("操作失败", "包件已装车"); @@ -5290,13 +5293,13 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl parcelListEntityLambdaQueryWrapper = Wrappers.query().lambda() - .notIn(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue(),OrderPackageStatusConstant.yichuku.getValue()) + .notIn(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue(), OrderPackageStatusConstant.yichuku.getValue()) .ne(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.yizhuangche.getValue()) .eq(DistributionParcelListEntity::getStockArticleId, orderId); - if (Func.isNotEmpty(reservationPackageList)){ + if (Func.isNotEmpty(reservationPackageList)) { List packageIds = reservationPackageList.stream().map(DistributionParcelListEntity::getId).collect(Collectors.toList()); - if (Func.isNotEmpty(packageIds)){ - parcelListEntityLambdaQueryWrapper.notIn(DistributionParcelListEntity::getId,packageIds); + if (Func.isNotEmpty(packageIds)) { + parcelListEntityLambdaQueryWrapper.notIn(DistributionParcelListEntity::getId, packageIds); } } List parcelListEntities = distributionParcelListService.list(parcelListEntityLambdaQueryWrapper); @@ -6475,7 +6478,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl reservationEntities = distributionSignforService.selectReservationByDeliveryId(deliveryId); - if (Func.isEmpty(reservationEntities)){ - log.info(method + "预约查询失败:{}", deliveryId); + if (Func.isEmpty(reservationEntities)) { + log.info(method + "预约查询失败:{}", deliveryId); return R.fail("服务器正忙!!!"); } String reservationCodes = reservationEntities.stream().filter(f -> !f.getLoadingStatus().equals(ReservationLoadingStatusConstant.daizhuangche.getValue())).map(DistributionReservationEntity::getReservationCode).collect(Collectors.joining(",")); - if (Func.isNotEmpty(reservationCodes)){ + if (Func.isNotEmpty(reservationCodes)) { log.info(method + "存在装车数据:{}", reservationCodes); - return R.fail(reservationCodes+"存在装车包件!!!"); + return R.fail(reservationCodes + "存在装车包件!!!"); } //该配送是否存在异常装车或者异常签收数据 List loadscanEntityList = distributionDeliveryListService.selectAbnormalLoadingBydeliveryId(deliveryId); - if (Func.isNotEmpty(loadscanEntityList)){ + if (Func.isNotEmpty(loadscanEntityList)) { log.info(method + "存在异常装车数据:{}", deliveryId); - return R.fail(reservationCodes+"存在异常装车、签收包条!!!"); + return R.fail(reservationCodes + "存在异常装车、签收包条!!!"); } boolean flag = false; for (DistributionReservationEntity reservationEntity : reservationEntities) { DistributionReservationDTO reservationDTO = Func.copy(reservationEntity, DistributionReservationDTO.class); - flag = distributionReservationService.cancelReservation(reservationDTO); - if (!flag){ - log.info(method + "取消预约失败:{}", deliveryId); - throw new RuntimeException("取消配送计划失败,请联系管理员"); - } + flag = distributionReservationService.cancelReservation(reservationDTO); + if (!flag) { + log.info(method + "取消预约失败:{}", deliveryId); + throw new RuntimeException("取消配送计划失败,请联系管理员"); + } } return R.status(flag); } @@ -6802,9 +6805,9 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl selectAbnormalLoadingBydeliveryId(Long deliveryId) { return distributionLoadscanService.list(Wrappers.query().lambda() - .eq(DistributionLoadscanEntity::getDeliveryId,deliveryId) - .eq(DistributionLoadscanEntity::getScanStatus,LoadingStatusConstant.quxiao.getValue()) - .eq(DistributionLoadscanEntity::getIsAbnormalLoading,2) + .eq(DistributionLoadscanEntity::getDeliveryId, deliveryId) + .eq(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) + .eq(DistributionLoadscanEntity::getIsAbnormalLoading, 2) ); } @@ -6847,10 +6850,10 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl list = distributionSignforService.list(Wrappers.query().lambda() .eq(DistributionSignforEntity::getDeliveryId, deliveryId) ); - if (!list.isEmpty()){ + if (!list.isEmpty()) { //查看所有的签收信息是否均已完成 boolean anyMatch = list.stream().allMatch(s -> s.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())); - if (anyMatch){ + if (anyMatch) { deliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.yiwancheng.getValue()); } } From b374fdbe823df303b3551fe3939e9864a4c50abf Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Wed, 24 Jan 2024 15:26:17 +0800 Subject: [PATCH 38/39] =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E5=AE=8C=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionDeliveryListMapper.xml | 1 + .../mapper/DistrilbutionBillLadingMapper.xml | 5 +- .../IDistributionStockListService.java | 6 + .../DistributionStockListServiceImpl.java | 10 + .../DistrilbutionBillLadingServiceImpl.java | 694 +++++++++--------- 5 files changed, 377 insertions(+), 339 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml index dec1a0e52..99e77bbd2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionDeliveryListMapper.xml @@ -1171,6 +1171,7 @@ logpm_distribution_signfor lds JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id + ldr.reservation_status != 40 and lds.delivery_id = #{deliveryListId} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index 9e729dada..b6cb2d3fe 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -457,14 +457,15 @@