From dc1899d11b269962f08b85b8b02e4918a0c2e5a6 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 24 Mar 2025 16:05:04 +0800 Subject: [PATCH 01/29] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=97=A0=E7=BC=96=E7=A0=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trunkline/service/impl/TrunklineCarsLoadServiceImpl.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 41822a3ee..b4680d4a8 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -13398,6 +13398,9 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl Date: Mon, 24 Mar 2025 16:18:42 +0800 Subject: [PATCH 02/29] =?UTF-8?q?feat(all):=20=E9=85=8D=E9=80=81=E7=AD=BE?= =?UTF-8?q?=E6=94=B6=E7=8E=87=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改签收状态字段显示错误问题 --- .../com/logpm/report/mapper/QualityDispatchNumberMapper.xml | 2 +- .../logpm/report/vo/qulity/dispatch/QualityDispatchTaskVO.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/QualityDispatchNumberMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/QualityDispatchNumberMapper.xml index a1db885e3..542ea77f3 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/QualityDispatchNumberMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/QualityDispatchNumberMapper.xml @@ -143,7 +143,7 @@ t.driver_name, t.vehicle_name, t.delivery_create_user_name, - case when t.sign_status = 1 then '已签收' else '未签收' end signStatus, + t.sign_status signStatus, t.sign_time, t.sign_user_name, t.reviewStatus, diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/qulity/dispatch/QualityDispatchTaskVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/qulity/dispatch/QualityDispatchTaskVO.java index 7a896959c..602e319b1 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/qulity/dispatch/QualityDispatchTaskVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/qulity/dispatch/QualityDispatchTaskVO.java @@ -1,5 +1,6 @@ package com.logpm.report.vo.qulity.dispatch; +import com.alibaba.excel.annotation.ExcelIgnore; import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.write.style.ColumnWidth; import com.alibaba.excel.annotation.write.style.ContentRowHeight; @@ -94,7 +95,7 @@ public class QualityDispatchTaskVO implements Serializable { private Integer signStockNum; @ApiModelProperty(value = "状态") - @ExcelProperty("状态") + @ExcelIgnore private String signStatus; @ApiModelProperty(value = "签收时间") From 6c266cf99a6911d99f7b0756a861d3bd1252e8e5 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 24 Mar 2025 16:31:36 +0800 Subject: [PATCH 03/29] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=97=A0=E7=BC=96=E7=A0=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TrunklineCarsLoadServiceImpl.java | 32 +++++++++++++++++-- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index b4680d4a8..d3a88353d 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -13297,6 +13297,13 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl advanceIdSet = allAdvanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getAdvanceId).collect(Collectors.toSet()); + List advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet)); + //把advanceEntities转化成id为key的Map + Map advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity())); + + //把allAdvanceDetailList转化成orderPackageCode为key的Map Map advanceDetailMap = allAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity())); @@ -13310,6 +13317,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl { - - }); +// udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> { +// +// }); } @@ -13447,6 +13467,12 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = new ArrayList<>(orderPackageCodeSet); + + String content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:" + IncomingTypeEnum.getValue(IncomingTypeEnum.SYNC_INCOMING.getCode()); + packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(), content); + } bladeRedis.del(key); From 09964ca74bcf33ba63a78fc35d26ab16cc7b3572 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 24 Mar 2025 17:11:49 +0800 Subject: [PATCH 04/29] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E7=B3=BB=E7=BB=9F=E6=97=A0=E7=BC=96=E7=A0=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trunkline/service/impl/TrunklineCarsLoadServiceImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index d3a88353d..ae10cae5a 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -13310,6 +13310,7 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl updateScanList = new ArrayList<>(); List incomingAdvanceDetailList = new ArrayList<>(); List udateAdvanceDetailList = new ArrayList<>(); + List orderPackageCodeList = new ArrayList<>(); Set orderPackageCodeSet = new HashSet<>(); carsLoadScanEntities.forEach(carsLoadScanEntity -> { @@ -13378,6 +13379,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl 0){ @@ -13470,6 +13473,8 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl orderPackageCodes = new ArrayList<>(orderPackageCodeSet); + orderPackageCodes.removeAll(orderPackageCodeList); + String content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:" + IncomingTypeEnum.getValue(IncomingTypeEnum.SYNC_INCOMING.getCode()); packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(), content); From 6579e83e6ad232f87be3f3b46248867617d017e6 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 24 Mar 2025 17:43:33 +0800 Subject: [PATCH 05/29] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF=E5=8D=B8=E8=BD=A6?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TrunklineCarsLoadServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index ae10cae5a..0a25c70ac 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -1207,10 +1207,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl Date: Mon, 24 Mar 2025 17:51:03 +0800 Subject: [PATCH 06/29] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF=E5=8D=B8=E8=BD=A6?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TrunklineCarsLoadServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 0a25c70ac..34e928150 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -1220,10 +1220,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl Date: Mon, 24 Mar 2025 18:06:42 +0800 Subject: [PATCH 07/29] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BF=E5=8D=B8=E8=BD=A6?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TrunklineCarsLoadServiceImpl.java | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 34e928150..35d521c25 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -9934,6 +9934,10 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl Date: Mon, 24 Mar 2025 18:25:27 +0800 Subject: [PATCH 08/29] =?UTF-8?q?1.=E5=94=AE=E5=90=8E=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A4=84=E7=90=86bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/springblade/common/constant/WorkNodeEnums.java | 1 + .../service/impl/AftersalesAbnormalRecordServiceImpl.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java index bbf747c33..075098679 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java @@ -46,6 +46,7 @@ public enum WorkNodeEnums implements Serializable { SIGN_DIRECT_SHIPPER(105030,"直发商家签收"), END_WAREHOUSE_UNLOADING(105040, "末端仓卸车确认"), NO_STOCK_CAR(105050, "本车次少货"), + NO_DATA(105051, "无效包条码"), COST_SHARE(105060, "车次成本分摊"), SORTING_TRAYS(201010, "分拣打托"), diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java index daf8dcbaa..666606365 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/service/impl/AftersalesAbnormalRecordServiceImpl.java @@ -148,7 +148,7 @@ public class AftersalesAbnormalRecordServiceImpl extends BaseServiceImpl ls = new ArrayList<>(); From 10eb18ee10bb247181fe24e985f058a12697511a Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Mon, 24 Mar 2025 18:38:48 +0800 Subject: [PATCH 09/29] =?UTF-8?q?1.=E5=94=AE=E5=90=8E=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E5=A4=84=E7=90=86bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/org/springblade/common/constant/WorkNodeEnums.java | 1 + .../com/logpm/trunkline/service/impl/InComingServiceImpl.java | 2 ++ 2 files changed, 3 insertions(+) diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java index 075098679..d8ca4857a 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/WorkNodeEnums.java @@ -17,6 +17,7 @@ public enum WorkNodeEnums implements Serializable { INITIAL_DATA_ENTRY(101010, "数据入库"), INITIAL_WAREHOUSE_ENTRY(101020, "始发仓入库"), UNLOAD_WAREHOUSE_ENTRY(101021, "卸车并入库"), + ERROR_WAREHOUSE_ENTRY(101022, "异常入库"), OPEN_ORDER(102010, "开单"), CHANGE_ORDER(102020, "改单"), diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java index c52647bff..0f2ee527a 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/InComingServiceImpl.java @@ -339,6 +339,8 @@ public class InComingServiceImpl implements IInComingService { if(incomingType.equals(IncomingTypeEnum.PACKAGE_INCOMING.getCode())){ c = WorkNodeEnums.UNLOAD_WAREHOUSE_ENTRY.getCode(); + }else if(incomingType.equals(IncomingTypeEnum.SYNC_INCOMING.getCode())){ + c = WorkNodeEnums.ERROR_WAREHOUSE_ENTRY.getCode(); } //存入日志 From afa02e3d8dea1b6536b067f732496051ab725eed Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 25 Mar 2025 14:40:10 +0800 Subject: [PATCH 10/29] =?UTF-8?q?1.=E7=9B=98=E7=82=B9bug=E6=97=A5=E5=BF=97?= =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/TaskQuestServiceImpl.java | 227 +++++++++--------- 1 file changed, 116 insertions(+), 111 deletions(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java index 5aac3c7e9..2c8501401 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java @@ -843,116 +843,117 @@ public class TaskQuestServiceImpl extends BaseServiceImpl>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> tag {}", 45); - Long taskID; - if (ObjectUtils.isNotNull(i.getId())) { - taskID = i.getId(); - } else { - taskID = getTaskID(); - } - if (i.getIsNew().equals(1)) { - //新增数据 - Integer questTarget = i.getQuestTarget(); - QuestDetailEntity questDetail = new QuestDetailEntity(); - BeanUtil.copyProperties(i, questDetail); - questDetail.setTenantId(user.getTenantId()); - questDetail.setCreateDept(getDeptByMaxDept(user.getDeptId())); - questDetail.setCreateTime(new Date()); - questDetail.setIsDeleted(0); - questDetail.setStatus(1); - questDetail.setIsChange(1); - if (questTarget.equals(2)) { - questDetail.setHasData(0); + try{ + Long taskID; + if (ObjectUtils.isNotNull(i.getId())) { + taskID = i.getId(); } else { - String orderPackageCode = i.getOrderPackageCode(); - if (StringUtil.isBlank(orderPackageCode)) { + taskID = getTaskID(); + } + if (i.getIsNew().equals(1)) { + //新增数据 + Integer questTarget = i.getQuestTarget(); + QuestDetailEntity questDetail = new QuestDetailEntity(); + BeanUtil.copyProperties(i, questDetail); + questDetail.setTenantId(user.getTenantId()); + questDetail.setCreateDept(getDeptByMaxDept(user.getDeptId())); + questDetail.setCreateTime(new Date()); + questDetail.setIsDeleted(0); + questDetail.setStatus(1); + questDetail.setIsChange(1); + if (questTarget.equals(2)) { questDetail.setHasData(0); } else { - questDetail.setHasData(1); + String orderPackageCode = i.getOrderPackageCode(); + if (StringUtil.isBlank(orderPackageCode)) { + questDetail.setHasData(0); + } else { + questDetail.setHasData(1); + } } + questDetail.setCreateUser(user.getUserId()); + questDetail.setUpdateUser(user.getUserId()); + questDetail.setUpdateTime(new Date()); + questDetail.setInventoryTime(new Date()); + questDetail.setInventoryUser(user.getUserId()); + + questDetail.setId(taskID); + questDetail.setWarehouseId(warehouseId); + questDetail.setQuestStatus(1); + List entityList = new ArrayList<>(); + entityList.add(questDetail); + baseMapper.insertQuestDetail(questNum, entityList); } - questDetail.setCreateUser(user.getUserId()); - questDetail.setUpdateUser(user.getUserId()); - questDetail.setUpdateTime(new Date()); - questDetail.setInventoryTime(new Date()); - questDetail.setInventoryUser(user.getUserId()); - - questDetail.setId(taskID); - questDetail.setWarehouseId(warehouseId); - questDetail.setQuestStatus(1); - List entityList = new ArrayList<>(); - entityList.add(questDetail); - baseMapper.insertQuestDetail(questNum, entityList); - } - Integer stockNum = i.getStockNum(); - Integer lossNum = i.getLossNum(); - Integer deliveNum = i.getDeliveNum(); - Integer wornNum = i.getWornNum(); - Integer noReceivedNum = i.getNoReceivedNum(); - Integer noRepairNum = i.getNoRepairNum(); - if (stockNum > 0 || lossNum > 0 || deliveNum > 0 || wornNum > 0 || noReceivedNum > 0 || noRepairNum > 0) { - - //查询盘点包件信息 - if (ObjectUtils.isNotNull(i.getOrderPackageCode())) { - QuestDetailEntity questDetail = new QuestDetailEntity(); - questDetail.setOrderPackageCode(i.getOrderPackageCode()); - QuestDetailEntity questDetail1 = baseMapper.selectOneTaskInfo(taskSearchDTO.getQuestNum(), questDetail); - if (ObjectUtils.isNotNull(questDetail1)) { - i.setId(questDetail1.getId()); - taskID = questDetail1.getId(); + Integer stockNum = i.getStockNum(); + Integer lossNum = i.getLossNum(); + Integer deliveNum = i.getDeliveNum(); + Integer wornNum = i.getWornNum(); + Integer noReceivedNum = i.getNoReceivedNum(); + Integer noRepairNum = i.getNoRepairNum(); + if (stockNum > 0 || lossNum > 0 || deliveNum > 0 || wornNum > 0 || noReceivedNum > 0 || noRepairNum > 0) { + + //查询盘点包件信息 + if (ObjectUtils.isNotNull(i.getOrderPackageCode())) { + QuestDetailEntity questDetail = new QuestDetailEntity(); + questDetail.setOrderPackageCode(i.getOrderPackageCode()); + QuestDetailEntity questDetail1 = baseMapper.selectOneTaskInfo(taskSearchDTO.getQuestNum(), questDetail); + if (ObjectUtils.isNotNull(questDetail1)) { + i.setId(questDetail1.getId()); + taskID = questDetail1.getId(); + } } - } - //添加 - List childList = new ArrayList<>(); - childList.add(addQuestDetailChild(stockNum, "10", taskID, warehouseId, questNum)); - childList.add(addQuestDetailChild(wornNum, "20", taskID, warehouseId, questNum)); - childList.add(addQuestDetailChild(lossNum, "30", taskID, warehouseId, questNum)); - childList.add(addQuestDetailChild(noRepairNum, "40", taskID, warehouseId, questNum)); - childList.add(addQuestDetailChild(deliveNum, "50", taskID, warehouseId, questNum)); - childList.add(addQuestDetailChild(noReceivedNum, "60", taskID, warehouseId, questNum)); - boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId())); - if (b) { //添加 - baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum() + "_child", childList); - //修改盘点数据 - List list = new ArrayList<>(); - QuestDetailEntity questDetail = new QuestDetailEntity(); - questDetail.setId(i.getId()); - questDetail.setQuestStatus(1); //已盘 - questDetail.setUpdateUser(user.getUserId()); - QuestDetailEntity detailEntity = baseMapper.findEntityById(questNum, taskID); - if (!Objects.isNull(detailEntity)) { - Integer isNew = detailEntity.getIsNew(); - Integer questTarget = detailEntity.getQuestTarget(); - Integer stockNum1 = detailEntity.getStockNum(); - - if (isNew.equals(1)) { - questDetail.setIsChange(1); - } else { - if (!stockNum1.equals(stockNum)) { + List childList = new ArrayList<>(); + childList.add(addQuestDetailChild(stockNum, "10", taskID, warehouseId, questNum)); + childList.add(addQuestDetailChild(wornNum, "20", taskID, warehouseId, questNum)); + childList.add(addQuestDetailChild(lossNum, "30", taskID, warehouseId, questNum)); + childList.add(addQuestDetailChild(noRepairNum, "40", taskID, warehouseId, questNum)); + childList.add(addQuestDetailChild(deliveNum, "50", taskID, warehouseId, questNum)); + childList.add(addQuestDetailChild(noReceivedNum, "60", taskID, warehouseId, questNum)); + boolean b = childList.stream().anyMatch(ii -> ObjectUtils.isNull(ii.getId())); + if (b) { + //添加 + baseMapper.insertQuestDetailChildList(taskSearchDTO.getQuestNum() + "_child", childList); + //修改盘点数据 + List list = new ArrayList<>(); + QuestDetailEntity questDetail = new QuestDetailEntity(); + questDetail.setId(i.getId()); + questDetail.setQuestStatus(1); //已盘 + questDetail.setUpdateUser(user.getUserId()); + QuestDetailEntity detailEntity = baseMapper.findEntityById(questNum, taskID); + if (!Objects.isNull(detailEntity)) { + Integer isNew = detailEntity.getIsNew(); + Integer questTarget = detailEntity.getQuestTarget(); + Integer stockNum1 = detailEntity.getStockNum(); + + if (isNew.equals(1)) { questDetail.setIsChange(1); + } else { + if (!stockNum1.equals(stockNum)) { + questDetail.setIsChange(1); + } } } - } - questDetail.setUpdateTime(new Date()); - if (ObjectUtils.isNotNull(i.getTrayId())) { - questDetail.setTrayId(i.getTrayId()); - questDetail.setTrayCode(i.getTrayCode()); - } - list.add(questDetail); - baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(), list); - } else { - //修改 + questDetail.setUpdateTime(new Date()); + if (ObjectUtils.isNotNull(i.getTrayId())) { + questDetail.setTrayId(i.getTrayId()); + questDetail.setTrayCode(i.getTrayCode()); + } + list.add(questDetail); + baseMapper.updatePositionCodeList(taskSearchDTO.getQuestNum(), list); + } else { + //修改 // List collect = childList.stream().filter(ii -> ObjectUtils.isNotNull(ii.getQuestNum()) && ii.getQuestNum() > 0).collect(Collectors.toList()); - baseMapper.updetaQuestDetailChildList(questNum + "_child", childList); + baseMapper.updetaQuestDetailChildList(questNum + "_child", childList); + } } - } - //是否修改库位 - QuestDetailEntity questDetail = new QuestDetailEntity(); - if (ObjectUtils.isNotNull(i.getGroundingAllocationId()) || ObjectUtils.isNotNull(i.getNewTrayId())) { - //查询当前待更新货位是否包含已更新货位数据 - QuestDetailEntity questDetail1 = new QuestDetailEntity(); - questDetail1.setGroundingAllocationId(i.getGroundingAllocationId()); + //是否修改库位 + QuestDetailEntity questDetail = new QuestDetailEntity(); + if (ObjectUtils.isNotNull(i.getGroundingAllocationId()) || ObjectUtils.isNotNull(i.getNewTrayId())) { + //查询当前待更新货位是否包含已更新货位数据 + QuestDetailEntity questDetail1 = new QuestDetailEntity(); + questDetail1.setGroundingAllocationId(i.getGroundingAllocationId()); // List questDetailEntities = baseMapper.selectTaskInfo(taskSearchDTO.getQuestNum(), questDetail1); // if (!questDetailEntities.isEmpty()) { // boolean b = questDetailEntities.stream().anyMatch(q -> ObjectUtils.isNotNull(q.getTrayId())); @@ -960,23 +961,27 @@ public class TaskQuestServiceImpl extends BaseServiceImpl Date: Tue, 25 Mar 2025 15:44:11 +0800 Subject: [PATCH 11/29] =?UTF-8?q?1.=E7=9B=98=E7=82=B9bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../warehouse/service/impl/TaskQuestServiceImpl.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java index 2c8501401..ff7964a83 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/TaskQuestServiceImpl.java @@ -16,6 +16,7 @@ */ package com.logpm.warehouse.service.impl; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.Wrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; @@ -305,6 +306,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl questDetailEntityList = baseMapper.selectQuestDetailList(taskSearchDTO.getQuestNum(), questDetail); - if (questDetailEntityList.isEmpty() || ObjectUtils.isNull(questDetailEntityList) || ObjectUtils.isNull(questDetailEntityList.get(0).getQuestId())) { + if (CollUtil.isEmpty(questDetailEntityList)) { // 需要判读这个盘点任务 是否存在绑定的商场 R extracted = extracted(questId, questDetail); @@ -2955,8 +2958,8 @@ public class TaskQuestServiceImpl extends BaseServiceImpl byPacketBarCode = distributionParcelListClient.findByPacketBarCode(questDetail.getOrderPackageCode()); - - if (ObjectUtils.isEmpty(byPacketBarCode)) { +// DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(questDetail.getOrderPackageCode(), warehouseId); + if (CollUtil.isEmpty(byPacketBarCode)) { return R.fail(5000, "包件信息不存在!!"); } else { for (DistributionParcelListEntity distributionParcelListEntity : byPacketBarCode) { From 6c5ffd11e7eab1fbc144f478d39f496a9976f6e9 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Tue, 25 Mar 2025 16:38:57 +0800 Subject: [PATCH 12/29] =?UTF-8?q?feat(all):=20=E9=87=91=E7=89=8C=E5=B7=A5?= =?UTF-8?q?=E5=8E=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改金牌工厂订单重复,无包条的情况导致包条丢失问题 --- .../jinpai/service/impl/DeliveryNoteServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java index 24c6de4a2..9c44946bf 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-jinpai/src/main/java/com/logpm/factorydata/jinpai/service/impl/DeliveryNoteServiceImpl.java @@ -260,7 +260,7 @@ public class DeliveryNoteServiceImpl extends BaseServiceImpl Date: Tue, 25 Mar 2025 17:08:03 +0800 Subject: [PATCH 13/29] =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=A4=87=E8=B4=A7BUG?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DistributionStockupServiceImpl.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 d96de1ad7..dd2c7b160 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 @@ -6334,7 +6334,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl !Objects.equals(f.getQuantity(), f.getRealityQuantity())).collect(Collectors.toList()).get(0); - deliveryDetails.setQuantity(deliveryDetails.getQuantity() - 1); + int updateNum = deliveryDetails.getQuantity() - 1; + if (Objects.equals(updateNum,deliveryDetails.getRealityQuantity())) { + deliveryDetails.setStockStatus("3"); + } + deliveryDetails.setQuantity(updateNum); distributionDeliveryDetailsService.updateById(deliveryDetails); distributionStockListMapper.decreaseStockListQuantityOccupied(stockListId, 1); distributionStockListMapper.updateInventoryQuantityOccupied(distributionStockListEntity.getId(), 1); @@ -6353,6 +6357,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl !Objects.equals(r.getQuantity(), r.getRealityQuantity())).collect(Collectors.toList()).get(0); - deliveryDetails.setQuantity(deliveryDetails.getQuantity() - 1); + int updateNum = deliveryDetails.getQuantity() - 1; + if (Objects.equals(updateNum,deliveryDetails.getRealityQuantity())) { + deliveryDetails.setStockStatus("3"); + } + deliveryDetails.setQuantity(updateNum); distributionDeliveryDetailsService.updateById(deliveryDetails); } } From f63533c3a1d4fc924e5c1e74730a835e59bdc4e2 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 25 Mar 2025 17:44:26 +0800 Subject: [PATCH 14/29] =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E5=93=81=E7=AD=BE=E6=94=B6BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistrilbutionBillLadingServiceImpl.java | 1 - 1 file changed, 1 deletion(-) 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 19a27028e..e1d834fc4 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 @@ -3355,7 +3355,6 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl listed = disStockListDetailService.list(Wrappers.query().lambda() .eq(DisStockListDetailEntity::getReservationId, i.getId()) .eq(DisStockListDetailEntity::getSku, i.getSku()) - .eq(DisStockListDetailEntity::getStockListId, i.getStockListId()) .ne(DisStockListDetailEntity::getStockPackageStatus, ReservationPackageStatusConstant.quxiao.getValue()) ); if (Func.isNotEmpty(listed)) { From 0e5771ee98ff481fccc1ab76fc3c8a719f980fbc Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 25 Mar 2025 18:07:54 +0800 Subject: [PATCH 15/29] =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E5=93=81=E5=A4=87=E8=B4=A7BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionStockupServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 dd2c7b160..a21a8f351 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 @@ -5841,9 +5841,11 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl 0) { packageFlag = packageEntityList.stream().allMatch(a->OrderPackageStockupStatusConstant.yibeihu.getValue().equals(a.getOrderPackageStockupStatus())); - }else { + } else { packageFlag = true; } + }else { + packageFlag = true; } //库存品 if (!inventoryList.isEmpty() && inventoryList.size() > 0) { From 5c925406f3330148b8d651583d3f483f16b3848d Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Tue, 25 Mar 2025 18:17:53 +0800 Subject: [PATCH 16/29] =?UTF-8?q?=E8=87=AA=E6=8F=90=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E5=93=81=E5=A4=87=E8=B4=A7BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionStockupServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 a21a8f351..75cf80e34 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 @@ -5864,7 +5864,7 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl Date: Wed, 26 Mar 2025 15:08:20 +0800 Subject: [PATCH 17/29] =?UTF-8?q?feat(all):=20=E9=85=8D=E9=80=81=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E4=BB=B7=E6=A0=BC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 增加点位计费是否合并区域的配置 --- .../ExpenseDispatchPriceRuleEntity.java | 5 +++++ .../report/DeliverFinishReportListener.java | 19 ++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceRuleEntity.java b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceRuleEntity.java index c4d244932..7e9e39be6 100644 --- a/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceRuleEntity.java +++ b/blade-service-api/logpm-statisticsdata-api/src/main/java/com/logpm/statistics/entity/ExpenseDispatchPriceRuleEntity.java @@ -105,6 +105,11 @@ public class ExpenseDispatchPriceRuleEntity extends TenantEntity { */ @ApiModelProperty(value = "是否点位补贴计费") private Integer ynSiteSubsidy; + /** + * 是否点位合并区域 + */ + @ApiModelProperty(value = "是否点位合并区域") + private Integer ynMergePointArea; /** * 是否保底费 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java index d56c7cfab..ba463406a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java @@ -763,7 +763,24 @@ public class DeliverFinishReportListener implements ReportService { Set longs = valueMap.keySet(); Integer dkp = 0; if (CollUtil.isNotEmpty(allRouteMap)) { - dkp = allRouteMap.keySet().size(); + // 是否合并区域计费 + Integer ynMergePointArea = rule.getYnMergePointArea(); + if(NumberUtil.equals(ynMergePointArea, BooleanZeroOneEnums.YES.getCode())){ + // 是 同一区域的视为一个点 + Collection values = valueMap.values(); + // 按省市区分组后的数量 arriveProvince arriveCity arriveDistrict + if(CollUtil.isNotEmpty(values)){ + Set collect1 = values.stream().map(v -> { + return v.getArriveProvince() + v.getArriveCity() + v.getArriveDistrict(); + }).collect(Collectors.toSet()); + if(CollUtil.isNotEmpty(collect1)){ + dkp = collect1.size(); + } + } + }else{ + // 否 所有点位 + dkp = allRouteMap.keySet().size(); + } } if (!NumberUtil.equals(dkp, 0)) { dkp = dkp - 1; From 605d5137e1ed581fccbb67262741d0ff8dd1e367 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Wed, 26 Mar 2025 16:25:14 +0800 Subject: [PATCH 18/29] =?UTF-8?q?feat(all):=20=E6=88=91=E4=B9=90=E5=B7=A5?= =?UTF-8?q?=E5=8E=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改我乐工厂回传逻辑 --- .../olo/entity/FactoryNodePushEntity.java | 5 +++ .../olo/mq/NodeDataPushListener.java | 40 +++++++++++-------- 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java index 11b05d506..005076a28 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/entity/FactoryNodePushEntity.java @@ -79,6 +79,11 @@ public class FactoryNodePushEntity extends BaseEntity { */ @ApiModelProperty(value = "订单号") private String orderCode; + /** + * 包条码 + */ + @ApiModelProperty(value = "包条码") + private String packageCode; /** * 运单号 */ diff --git a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java index 4b9d6061f..847565949 100644 --- a/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java +++ b/blade-service/logpm-factory-data/logpm-factory-data-olo/src/main/java/com/logpm/factorydata/olo/mq/NodeDataPushListener.java @@ -173,22 +173,30 @@ public class NodeDataPushListener { // value 按包件分组 包含则数量+1 // 分拨中心回传所有包件,其他节点回传当前操作的包件 if (isArrival) { - List collect2 = factoryList.stream() - .filter(data -> data.getCrmSo().equals(orderCode)) - .filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo)) - .collect(Collectors.toList()); - snMap = collect2.stream().collect(Collectors.toMap(DeliveryNoteEntity::getSn, s -> Convert.toInt(s.getQty()))); - FactoryNodePushEntity entity1 = FactoryNodePushEntity.builder() - .orderCode(orderCode).statusName(needSendNode.getStatus()).opTime(entries.getStr("operatorTime")).content(needSendNode.getValue()) - .waybillCode(waybillNumber).siteLevel(needSendNode.getSiteLecel(isArrival)).warehouse(sendData.getWarehouseName()) - .receiveOrSend(needSendNode.getReceiveOrSend()) - .shipmentSpitCode(shipmentSplitNo).shipmentCode(collect.get(sendData.getPackageCode() + sendData.getOrderCode()).get(0).getShipmentNo()) - .receivable(0).receipts(0) - .type(needSendNode.getValue()) - .typeCode(needSendNode.getCode()) - .build(); - pushEntities.add(entity1); - factoryNodeAllPushEntity.setPackageCode(collect2.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(","))); + // List collect2 = factoryList.stream() + // .filter(data -> data.getCrmSo().equals(orderCode)) + // .filter(data -> data.getShipmentSplitNo().equals(shipmentSplitNo)) + // .collect(Collectors.toList()); + List checkList = deliveryNoteService.list(Wrappers.lambdaQuery() + .select(DeliveryNoteEntity::getSn, DeliveryNoteEntity::getQty) + .eq(DeliveryNoteEntity::getShipmentSplitNo, shipmentSplitNo) + .eq(DeliveryNoteEntity::getCrmSo, orderCode) + ); + snMap = checkList.stream().collect(Collectors.toMap(DeliveryNoteEntity::getSn, s -> Convert.toInt(s.getQty()))); + for (DeliveryNoteEntity deliveryNoteEntity : checkList) { + FactoryNodePushEntity entity1 = FactoryNodePushEntity.builder() + .orderCode(orderCode).statusName(needSendNode.getStatus()).opTime(entries.getStr("operatorTime")).content(needSendNode.getValue()) + .waybillCode(waybillNumber).siteLevel(needSendNode.getSiteLecel(isArrival)).warehouse(sendData.getWarehouseName()) + .receiveOrSend(needSendNode.getReceiveOrSend()) + .shipmentSpitCode(shipmentSplitNo).shipmentCode(collect.get(sendData.getPackageCode() + sendData.getOrderCode()).get(0).getShipmentNo()) + .receivable(0).receipts(0) + .type(needSendNode.getValue()) + .typeCode(needSendNode.getCode()) + .packageCode(deliveryNoteEntity.getSn()) + .build(); + pushEntities.add(entity1); + } + factoryNodeAllPushEntity.setPackageCode(checkList.stream().map(DeliveryNoteEntity::getSn).collect(Collectors.joining(","))); } else { for (PushData data : value) { if (snMap.containsKey(data.getPackageCode())) { From 21f714e173fe72f5c65ae22954f824ea4bda22da Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 26 Mar 2025 16:44:30 +0800 Subject: [PATCH 19/29] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BasicdataFactoryCategoryImporter.java | 7 ++-- .../controller/ReportTimeController.java | 34 ------------------- .../logpm/report/mapper/ReportTimeMapper.xml | 34 ++++++++++++++----- .../report/vo/ReportOpenTimeDetailVO.java | 4 +++ .../controller/AdvanceDetailController.java | 9 +++-- .../logpm/trunkline/dto/PackageCodeDTO.java | 13 +++++++ .../ITrunklineAdvanceDetailService.java | 3 +- .../TrunklineAdvanceDetailServiceImpl.java | 23 +++++++------ .../impl/TrunklineCarsLoadServiceImpl.java | 19 +++++++++++ 9 files changed, 85 insertions(+), 61 deletions(-) create mode 100644 blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/PackageCodeDTO.java diff --git a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java index eda5a0231..0588eb70d 100644 --- a/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java +++ b/blade-service/logpm-basicdata/src/main/java/com/logpm/basicdata/excel/BasicdataFactoryCategoryImporter.java @@ -248,6 +248,9 @@ public class BasicdataFactoryCategoryImporter implements ExcelImporter '2024-10-22 00:00:00' - and waw.business_line = #{param.businessLine} - and lta.brand = #{param.brand} - and lta.warehouse_id = #{param.warehouseId} + + and waw.business_line = #{param.businessLine} + + + and lta.brand = #{param.brand} + + + and lta.warehouse_id = #{param.warehouseId} + and waw.business_line in @@ -1788,6 +1799,7 @@ lta.store_name storeName, lta.warehouse_id warehouseId, lta.warehouse_name warehouseName, + min(ltad.incoming_time) incomingTime, GROUP_CONCAT(DISTINCT ltad.incoming_warehouse_name) incomingWarehouseName, lta.site_name siteName, lta.brand brand, @@ -1832,9 +1844,15 @@ left join logpm_warehouse_waybill lww on lww.waybill_no = lta.waybill_no left join logpm_trunkline_advance_detail ltad on ltad.advance_id = lta.id where lta.create_time > '2024-10-22 00:00:00' - and waw.business_line = #{param.businessLine} - and lta.brand = #{param.brand} - and lta.warehouse_id = #{param.warehouseId} + + and waw.business_line = #{param.businessLine} + + + and lta.brand = #{param.brand} + + + and lta.warehouse_id = #{param.warehouseId} + and waw.business_line in diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeDetailVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeDetailVO.java index b4715a865..664c8ddaf 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeDetailVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/ReportOpenTimeDetailVO.java @@ -30,6 +30,10 @@ public class ReportOpenTimeDetailVO implements Serializable { private Long warehouseId; @ExcelProperty(value = "导入仓库") private String warehouseName; + + @ExcelProperty(value = "入库时间") + @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date incomingTime; @ExcelProperty(value = "入库仓库") private String incomingWarehouseName; diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java index 7206534b1..fe13f6648 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/controller/AdvanceDetailController.java @@ -8,6 +8,7 @@ import com.logpm.basicdata.feign.IBasicdataWarehouseClient; import com.logpm.distribution.vo.OrderPackgeCodeDataVO; import com.logpm.trunkline.dto.AdvanceDetailDTO; import com.logpm.trunkline.dto.OrderDetailsDTO; +import com.logpm.trunkline.dto.PackageCodeDTO; import com.logpm.trunkline.service.ITrunklineAdvanceDetailService; import com.logpm.trunkline.vo.TrunklineAdvanceDetailVO; import io.swagger.annotations.Api; @@ -17,10 +18,8 @@ import lombok.extern.slf4j.Slf4j; import org.springblade.common.exception.CustomerException; import org.springblade.core.tool.api.R; import org.springframework.web.bind.annotation.*; -import springfox.documentation.annotations.ApiIgnore; import java.util.List; -import java.util.Map; import java.util.Objects; @Slf4j @@ -62,14 +61,14 @@ public class AdvanceDetailController { } - @GetMapping("/showAdvancePackgeCode") + @PostMapping("/showAdvancePackgeCode") @ApiOperationSupport(order = 2) @ApiOperation(value = "返回模板和模板内容") - public R showAdvancePackgeCode(@ApiIgnore @RequestParam Map params){ + public R showAdvancePackgeCode(@RequestBody PackageCodeDTO packageCodeDTO){ OrderPackgeCodeDataVO orderPackgeCodeDataVo= null; try { - orderPackgeCodeDataVo = advanceDetailService.showAdvancePackgeCode(params); + orderPackgeCodeDataVo = advanceDetailService.showAdvancePackgeCode(packageCodeDTO); } catch (Exception e) { return R.fail(e.getMessage()); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/PackageCodeDTO.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/PackageCodeDTO.java new file mode 100644 index 000000000..b4ac476ee --- /dev/null +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/dto/PackageCodeDTO.java @@ -0,0 +1,13 @@ +package com.logpm.trunkline.dto; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +@Data +public class PackageCodeDTO implements Serializable { + + private List orderPackageCodes; + +} diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java index 84b0e0f72..9be8e14e1 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/ITrunklineAdvanceDetailService.java @@ -6,6 +6,7 @@ import com.logpm.distribution.vo.OrderPackgeCodeDataVO; import com.logpm.trunkline.dto.AdvanceDTO; import com.logpm.trunkline.dto.AdvanceDetailDTO; import com.logpm.trunkline.dto.OrderDetailsDTO; +import com.logpm.trunkline.dto.PackageCodeDTO; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.vo.*; import com.logpm.warehouse.entity.WarehouseWaybillEntity; @@ -41,7 +42,7 @@ public interface ITrunklineAdvanceDetailService extends BaseService params) throws Exception; + OrderPackgeCodeDataVO showAdvancePackgeCode(PackageCodeDTO packageCodeDTO) throws Exception; List findListByAdvanceId(Long advanceId); diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java index b6c8b4bb7..9b807483e 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineAdvanceDetailServiceImpl.java @@ -6,7 +6,6 @@ import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; 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.logpm.basic.entity.BasicPrintTemplateEntity; @@ -17,6 +16,7 @@ import com.logpm.distribution.vo.OrderPackgeCodeDataVO; import com.logpm.trunkline.dto.AdvanceDTO; import com.logpm.trunkline.dto.AdvanceDetailDTO; import com.logpm.trunkline.dto.OrderDetailsDTO; +import com.logpm.trunkline.dto.PackageCodeDTO; import com.logpm.trunkline.entity.ReportPackageBasicEntity; import com.logpm.trunkline.entity.TrunklineAdvanceDetailEntity; import com.logpm.trunkline.entity.TrunklineAdvanceEntity; @@ -35,6 +35,7 @@ import org.springblade.common.constant.broadcast.FanoutConstants; import org.springblade.common.constant.printTemplate.PrintTemplateStatusConstant; import org.springblade.common.enums.BizOperationEnums; import org.springblade.common.enums.PackageTypeEnums; +import org.springblade.common.exception.CustomerException; import org.springblade.common.model.FanoutMsg; import org.springblade.common.model.NodeFanoutMsg; import org.springblade.common.model.PackageData; @@ -157,7 +158,7 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl params) throws Exception { + public OrderPackgeCodeDataVO showAdvancePackgeCode(PackageCodeDTO packageCodeDTO) throws Exception { log.info("----------------------------------------111111111"); OrderPackgeCodeDataVO orderPackgeCodeDataVO = new OrderPackgeCodeDataVO(); List data = new ArrayList<>(); @@ -170,15 +171,10 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl orderPackageCodes = packageCodeDTO.getOrderPackageCodes(); - String[] idArray = orderPackageCodes.split(","); - if (ObjectUtils.isNull(idArray)) { - throw new ServiceException("参数错误"); - - } log.info("----------------------------------------333333333"); - for (String orderPackageCode : idArray) { + orderPackageCodes.forEach(orderPackageCode -> { DistributionStockArticleQRCodeVO vo = new DistributionStockArticleQRCodeVO(); log.info("----------------------------------------444444444444444444"); TrunklineAdvanceDetailEntity advanceDetailEntity = baseMapper.findEntityByOrderPackageCodelimit1(orderPackageCode); @@ -241,9 +237,14 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl updateStockArticleList = new ArrayList<>(); groupedByLoadId.keySet().forEach(loadId -> { + TrunklineCarsLoadLineEntity loadLineEntity = trunklineCarsLoadLineService.findEntityByLoadIdAndNodeId(loadId, warehouseId); + if (Objects.isNull(loadLineEntity)) { + log.warn("##################removeCarsLoadScan: 配载计划不存在 loadId={}", loadId); + throw new CustomerException(405,"配载计划不存在"); + } + + String nodeStatus = loadLineEntity.getNodeStatus(); + if("20".equals(nodeStatus)){ + log.warn("##################removeCarsLoadScan: 当前节点已发车 loadId={} warehouseId={}", loadId,warehouseId); + throw new CustomerException(405,"当前节点已发车"); + } + if("0".equals(nodeStatus)){ + log.warn("##################removeCarsLoadScan: 当前节点未到达 loadId={} warehouseId={}", loadId,warehouseId); + throw new CustomerException(405,"当前节点未到达"); + } + List loadScanEntityList = groupedByLoadId.get(loadId); if(CollUtil.isNotEmpty(loadScanEntityList)){ //把loadScanEntityList通过fromNodeId进行分组 From 7ea826df3dda286f42e941f8940c446830e863c2 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Wed, 26 Mar 2025 17:42:08 +0800 Subject: [PATCH 20/29] =?UTF-8?q?feat(all):=20=E9=85=8D=E9=80=81=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E4=BB=B7=E6=A0=BC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 增加删除配送成本模版时,如果存在服务商绑定时不能删除的控制 --- .../ExpenseDispatchPriceTemplateController.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java index b86fcfce4..3c6bf1783 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceTemplateController.java @@ -16,13 +16,17 @@ */ package com.logpm.statistics.controller; +import cn.hutool.core.collection.CollUtil; import cn.hutool.core.convert.Convert; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; +import com.logpm.statistics.entity.ExpenseDispatchPriceServiceEntity; import com.logpm.statistics.entity.ExpenseDispatchPriceTemplateEntity; import com.logpm.statistics.excel.ExpenseDispatchPriceTemplateExcel; import com.logpm.statistics.query.ExpenseDispatchPriceTemplateQuery; +import com.logpm.statistics.service.IExpenseDispatchPriceServiceService; import com.logpm.statistics.service.IExpenseDispatchPriceTemplateService; import com.logpm.statistics.vo.ExpenseDispatchPriceTemplateVO; import com.logpm.statistics.wrapper.ExpenseDispatchPriceTemplateWrapper; @@ -65,6 +69,7 @@ import java.util.Map; public class ExpenseDispatchPriceTemplateController extends BladeController { private final IExpenseDispatchPriceTemplateService expenseDispatchPriceTemplateService; + private final IExpenseDispatchPriceServiceService expenseDispatchPriceServiceService; /** * 成本配送价格模版 详情 @@ -136,7 +141,13 @@ public class ExpenseDispatchPriceTemplateController extends BladeController { @ApiOperationSupport(order = 7) @ApiOperation(value = "逻辑删除", notes = "传入ids") public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - return R.status(expenseDispatchPriceTemplateService.deleteLogic(Func.toLongList(ids))); + List list = expenseDispatchPriceServiceService.list(Wrappers.lambdaQuery() + .in(ExpenseDispatchPriceServiceEntity::getTemplateId, Func.toLong(ids))); + if(CollUtil.isNotEmpty(list)){ + return R.fail("选择的模版存在绑定的服务商,不能删除"); + } + boolean b = expenseDispatchPriceTemplateService.deleteLogic(Func.toLongList(ids)); + return R.status(b); } From 19718d40c328351112094be3c560c4b3d6a0e594 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Wed, 26 Mar 2025 17:46:59 +0800 Subject: [PATCH 21/29] =?UTF-8?q?feat(all):=20=E9=85=8D=E9=80=81=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E4=BB=B7=E6=A0=BC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改代码错误问题 --- .../controller/ExpenseDispatchPriceServiceController.java | 1 + 1 file changed, 1 insertion(+) diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceServiceController.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceServiceController.java index 88467f842..dd4802fc2 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceServiceController.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/controller/ExpenseDispatchPriceServiceController.java @@ -150,6 +150,7 @@ public class ExpenseDispatchPriceServiceController extends BladeController { List list = expenseDispatchPriceServiceService.list(); if (CollUtil.isNotEmpty(list)) { Set collect = list.stream() + .filter(item -> ObjectUtil.isNotEmpty(item.getDriverId())) .filter(item -> !item.getDriverId().equals(byId.getDriverId())) .map(ExpenseDispatchPriceServiceEntity::getDriverId).collect(Collectors.toSet()); if (collect.contains(expenseDispatchPriceService.getDriverId())) { From a54c86a496504e74fc8ca3906c3a2e8cf8a29a93 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Wed, 26 Mar 2025 23:19:50 +0800 Subject: [PATCH 22/29] =?UTF-8?q?1.=E5=B9=B2=E7=BA=BFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/TrunklineCarsLoadServiceImpl.java | 278 +++++++++--------- 1 file changed, 141 insertions(+), 137 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java index 35bb24ade..104582ce5 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/TrunklineCarsLoadServiceImpl.java @@ -13327,156 +13327,159 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl carsLoadScanEntities = trunklineCarsLoadScanService.findUnloadNoDataList(loadId,warehouseId); - //把carsLoadScanEntities中所有元素的scanCode放入一个Set集合 - Set scanCodeSet = carsLoadScanEntities.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toSet()); + if(CollUtil.isNotEmpty(carsLoadScanEntities)){ + //把carsLoadScanEntities中所有元素的scanCode放入一个Set集合 + Set scanCodeSet = carsLoadScanEntities.stream().map(TrunklineCarsLoadScanEntity::getScanCode).collect(Collectors.toSet()); - log.info("###############syncNoSystemData: 当前同步的数据 {}",scanCodeSet); + log.info("###############syncNoSystemData: 当前同步的数据 {}",scanCodeSet); - List scanCodeList = new ArrayList<>(scanCodeSet); + List scanCodeList = new ArrayList<>(scanCodeSet); - List allAdvanceDetailList = new ArrayList<>(); + List allAdvanceDetailList = new ArrayList<>(); - int packageBatchSize = 500; - List> orderPackageCodeGroups = new ArrayList<>(); + int packageBatchSize = 500; + List> orderPackageCodeGroups = new ArrayList<>(); - for (int i = 0; i < scanCodeList.size(); i += packageBatchSize) { - int endIndex = Math.min(i + packageBatchSize, scanCodeList.size()); - orderPackageCodeGroups.add(scanCodeList.subList(i, endIndex)); - } + for (int m = 0; m < scanCodeList.size(); m += packageBatchSize) { + int endIndex = Math.min(m + packageBatchSize, scanCodeList.size()); + orderPackageCodeGroups.add(scanCodeList.subList(m, endIndex)); + } - orderPackageCodeGroups.forEach(orderPackageCodeGroup -> { - List advanceDetailEntityList = trunklineAdvanceDetailService.findListByOrderPackageCodeList(orderPackageCodeGroup); - allAdvanceDetailList.addAll(advanceDetailEntityList); - }); + orderPackageCodeGroups.forEach(orderPackageCodeGroup -> { + List advanceDetailEntityList = trunklineAdvanceDetailService.findListByOrderPackageCodeList(orderPackageCodeGroup); + allAdvanceDetailList.addAll(advanceDetailEntityList); + }); - //把allAdvanceDetailList中所有advanceId放入一个Set集合 - Set advanceIdSet = allAdvanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getAdvanceId).collect(Collectors.toSet()); - List advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet)); - //把advanceEntities转化成id为key的Map - Map advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity())); + //把allAdvanceDetailList中所有advanceId放入一个Set集合 + Set advanceIdSet = allAdvanceDetailList.stream().map(TrunklineAdvanceDetailEntity::getAdvanceId).collect(Collectors.toSet()); + List advanceEntities = advanceService.findListByIds(new ArrayList<>(advanceIdSet)); + //把advanceEntities转化成id为key的Map + Map advanceMap = advanceEntities.stream().collect(Collectors.toMap(TrunklineAdvanceEntity::getId, Function.identity())); - //把allAdvanceDetailList转化成orderPackageCode为key的Map - Map advanceDetailMap = allAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity())); + //把allAdvanceDetailList转化成orderPackageCode为key的Map + Map advanceDetailMap = allAdvanceDetailList.stream().collect(Collectors.toMap(TrunklineAdvanceDetailEntity::getOrderPackageCode, Function.identity())); - List updateScanList = new ArrayList<>(); - List incomingAdvanceDetailList = new ArrayList<>(); - List udateAdvanceDetailList = new ArrayList<>(); - List orderPackageCodeList = new ArrayList<>(); - Set orderPackageCodeSet = new HashSet<>(); - - carsLoadScanEntities.forEach(carsLoadScanEntity -> { - String orderPackageCode = carsLoadScanEntity.getScanCode(); - Date unloadTime = carsLoadScanEntity.getUnloadTime(); - TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailMap.get(orderPackageCode); - if(!Objects.isNull(trunklineAdvanceDetailEntity)){ - Long advanceId = trunklineAdvanceDetailEntity.getAdvanceId(); - - orderPackageCodeSet.add(orderPackageCode); - TrunklineCarsLoadScanEntity updateScanEntity = new TrunklineCarsLoadScanEntity(); - updateScanEntity.setId(carsLoadScanEntity.getId()); - - String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus(); - if(packageStatus.equals("0")){ - updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getWarehouseId()); - incomingAdvanceDetailList.add(trunklineAdvanceDetailEntity); - }else{ - updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId()); - trunklineAdvanceDetailEntity.setReserve5(CommonUtil.dateToStringGeneral(unloadTime)); - udateAdvanceDetailList.add(trunklineAdvanceDetailEntity); + List updateScanList = new ArrayList<>(); + List incomingAdvanceDetailList = new ArrayList<>(); + List udateAdvanceDetailList = new ArrayList<>(); + List orderPackageCodeList = new ArrayList<>(); + Set orderPackageCodeSet = new HashSet<>(); + + carsLoadScanEntities.forEach(carsLoadScanEntity -> { + String orderPackageCode = carsLoadScanEntity.getScanCode(); + Date unloadTime = carsLoadScanEntity.getUnloadTime(); + TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity = advanceDetailMap.get(orderPackageCode); + if(!Objects.isNull(trunklineAdvanceDetailEntity)){ + Long advanceId = trunklineAdvanceDetailEntity.getAdvanceId(); + + orderPackageCodeSet.add(orderPackageCode); + TrunklineCarsLoadScanEntity updateScanEntity = new TrunklineCarsLoadScanEntity(); + updateScanEntity.setId(carsLoadScanEntity.getId()); + + String packageStatus = trunklineAdvanceDetailEntity.getPackageStatus(); + if(packageStatus.equals("0")){ + updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getWarehouseId()); + incomingAdvanceDetailList.add(trunklineAdvanceDetailEntity); + }else{ + updateScanEntity.setFromWarehouseId(trunklineAdvanceDetailEntity.getNowWarehouseId()); + trunklineAdvanceDetailEntity.setReserve5(CommonUtil.dateToStringGeneral(unloadTime)); + udateAdvanceDetailList.add(trunklineAdvanceDetailEntity); + } + updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode()); + updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId()); + updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo()); + TrunklineAdvanceEntity advanceEntity = advanceMap.get(advanceId); + if(!Objects.isNull(advanceEntity)){ + updateScanEntity.setCustomerName(advanceEntity.getCustomerName()); + updateScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone()); + updateScanEntity.setCustomerAddress(advanceEntity.getCustomerAddress()); + } + updateScanEntity.setFirsts(trunklineAdvanceDetailEntity.getFirstPackName()); + updateScanEntity.setSenconds(trunklineAdvanceDetailEntity.getSecondPackName()); + updateScanEntity.setThirds(trunklineAdvanceDetailEntity.getThirdPackName()); + updateScanEntity.setMaterialCode(trunklineAdvanceDetailEntity.getMaterialCode()); + updateScanEntity.setMaterialName(trunklineAdvanceDetailEntity.getMaterialName()); + updateScanEntity.setIsData(1); + updateScanList.add(updateScanEntity); } - updateScanEntity.setOrderCode(trunklineAdvanceDetailEntity.getOrderCode()); - updateScanEntity.setWaybillId(trunklineAdvanceDetailEntity.getWaybillId()); - updateScanEntity.setWaybillNo(trunklineAdvanceDetailEntity.getWaybillNo()); - TrunklineAdvanceEntity advanceEntity = advanceMap.get(advanceId); - if(!Objects.isNull(advanceEntity)){ - updateScanEntity.setCustomerName(advanceEntity.getCustomerName()); - updateScanEntity.setCustomerTelephone(advanceEntity.getCustomerPhone()); - updateScanEntity.setCustomerAddress(advanceEntity.getCustomerAddress()); - } - updateScanEntity.setFirsts(trunklineAdvanceDetailEntity.getFirstPackName()); - updateScanEntity.setSenconds(trunklineAdvanceDetailEntity.getSecondPackName()); - updateScanEntity.setThirds(trunklineAdvanceDetailEntity.getThirdPackName()); - updateScanEntity.setMaterialCode(trunklineAdvanceDetailEntity.getMaterialCode()); - updateScanEntity.setMaterialName(trunklineAdvanceDetailEntity.getMaterialName()); - updateScanEntity.setIsData(1); - updateScanList.add(updateScanEntity); - } - }); + }); - if(CollUtil.isNotEmpty(incomingAdvanceDetailList)){ + if(CollUtil.isNotEmpty(incomingAdvanceDetailList)){ - for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : incomingAdvanceDetailList) { - InComingDTO inComingDTO = new InComingDTO(); - inComingDTO.setOrderPackageCode(trunklineAdvanceDetailEntity.getOrderPackageCode()); - inComingDTO.setIncomingType(IncomingTypeEnum.SYNC_INCOMING.getCode()); - inComingDTO.setWarehouseId(warehouseId); - R r = inComingService.incomingPackage(inComingDTO); - if(r.getCode() != 200){ - throw new CustomerException(405,"入库失败"); + for (TrunklineAdvanceDetailEntity trunklineAdvanceDetailEntity : incomingAdvanceDetailList) { + InComingDTO inComingDTO = new InComingDTO(); + inComingDTO.setOrderPackageCode(trunklineAdvanceDetailEntity.getOrderPackageCode()); + inComingDTO.setIncomingType(IncomingTypeEnum.SYNC_INCOMING.getCode()); + inComingDTO.setWarehouseId(warehouseId); + R r = inComingService.incomingPackage(inComingDTO); + if(r.getCode() != 200){ + throw new CustomerException(405,"入库失败"); + } } } - } - if(CollUtil.isNotEmpty(udateAdvanceDetailList)){ + if(CollUtil.isNotEmpty(udateAdvanceDetailList)){ - advanceService.saveOrderAndPackages(udateAdvanceDetailList, warehouseId); + advanceService.saveOrderAndPackages(udateAdvanceDetailList, warehouseId); - List updateNowWarehouseList = new ArrayList<>(); - List updateParceList = new ArrayList<>(); - udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> { + List updateNowWarehouseList = new ArrayList<>(); + List updateParceList = new ArrayList<>(); + udateAdvanceDetailList.forEach(trunklineAdvanceDetailEntity -> { - String orderPackageCode = trunklineAdvanceDetailEntity.getOrderPackageCode(); - String reserve5 = trunklineAdvanceDetailEntity.getReserve5(); - Date unloadTime = CommonUtil.StringToDate(reserve5); + String orderPackageCode = trunklineAdvanceDetailEntity.getOrderPackageCode(); + String reserve5 = trunklineAdvanceDetailEntity.getReserve5(); + Date unloadTime = CommonUtil.StringToDate(reserve5); - orderPackageCodeList.add(orderPackageCode); + orderPackageCodeList.add(orderPackageCode); - //查询是否有在系统无编码后进行卸车的数据 - int unloadNum = trunklineCarsLoadScanService.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime); - if(unloadNum > 0){ - DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId); - if(!Objects.isNull(parcelListEntity)){ - DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); - updateEntity.setId(parcelListEntity.getId()); - updateEntity.setOrderPackageStatus("60"); - updateEntity.setOrderCode(parcelListEntity.getOrderCode()); - updateEntity.setWarehouseId(parcelListEntity.getWarehouseId()); - updateParceList.add(updateEntity); - } - }else{ - List list = distributionParcelListClient.findListByOrderPackageCodeAndStatusAndNoWarehouseId(orderPackageCode,"20",warehouseId); - if(CollUtil.isNotEmpty(list)) { - list.forEach(distributionParcelListEntity -> { + //查询是否有在系统无编码后进行卸车的数据 + int unloadNum = trunklineCarsLoadScanService.findEntityByOrderPackageCodeAndUnloadTime(orderPackageCode,unloadTime); + if(unloadNum > 0){ + DistributionParcelListEntity parcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(orderPackageCode, warehouseId); + if(!Objects.isNull(parcelListEntity)){ DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); - updateEntity.setId(distributionParcelListEntity.getId()); + updateEntity.setId(parcelListEntity.getId()); updateEntity.setOrderPackageStatus("60"); - updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode()); - updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId()); + updateEntity.setOrderCode(parcelListEntity.getOrderCode()); + updateEntity.setWarehouseId(parcelListEntity.getWarehouseId()); updateParceList.add(updateEntity); - }); + } + }else{ + List list = distributionParcelListClient.findListByOrderPackageCodeAndStatusAndNoWarehouseId(orderPackageCode,"20",warehouseId); + if(CollUtil.isNotEmpty(list)) { + list.forEach(distributionParcelListEntity -> { + DistributionParcelListEntity updateEntity = new DistributionParcelListEntity(); + updateEntity.setId(distributionParcelListEntity.getId()); + updateEntity.setOrderPackageStatus("60"); + updateEntity.setOrderCode(distributionParcelListEntity.getOrderCode()); + updateEntity.setWarehouseId(distributionParcelListEntity.getWarehouseId()); + updateParceList.add(updateEntity); + }); + } + TrunklineAdvanceDetailEntity updateEntity = new TrunklineAdvanceDetailEntity(); + updateEntity.setId(trunklineAdvanceDetailEntity.getId()); + updateEntity.setNowWarehouseId(warehouseId); + updateEntity.setNowWarehouseName(warehouseName); + updateNowWarehouseList.add(updateEntity); } - TrunklineAdvanceDetailEntity updateEntity = new TrunklineAdvanceDetailEntity(); - updateEntity.setId(trunklineAdvanceDetailEntity.getId()); - updateEntity.setNowWarehouseId(warehouseId); - updateEntity.setNowWarehouseName(warehouseName); - updateNowWarehouseList.add(updateEntity); - } - }); + }); - if(CollUtil.isNotEmpty(updateParceList)){ - distributionParcelListClient.updateList(updateParceList); - } + if(CollUtil.isNotEmpty(updateParceList)){ + distributionParcelListClient.updateList(updateParceList); + } - if(CollUtil.isNotEmpty(updateNowWarehouseList)){ - trunklineAdvanceDetailService.updateBatchById(updateNowWarehouseList); - } + if(CollUtil.isNotEmpty(updateNowWarehouseList)){ + trunklineAdvanceDetailService.updateBatchById(updateNowWarehouseList); + } - if(CollUtil.isNotEmpty(updateScanList)){ - trunklineCarsLoadScanService.updateBatchById(updateScanList); - } + if(CollUtil.isNotEmpty(updateScanList)){ + trunklineCarsLoadScanService.updateBatchById(updateScanList); + } @@ -13507,32 +13510,33 @@ public class TrunklineCarsLoadServiceImpl extends BaseServiceImpl(orderPackageCodeSet)); - dealWithAbnormalVO.setCarsNo(carsLoadEntity.getCarsNo()); - dealWithAbnormalVO.setWarehouseName(warehouseName); - dealWithAbnormalVO.setNickName(AuthUtil.getNickName()); - dealWithAbnormalVO.setRemark("数据同步系统自动处理("+warehouseName+" "+carsLoadEntity.getCarsNo()+" "+AuthUtil.getNickName()+")"); - abnormalRecordClient.dealwithOrderPackageCodes(dealWithAbnormalVO); + //完结所有包件异常列表 + if(CollUtil.isNotEmpty(orderPackageCodeSet)){ + i = orderPackageCodeSet.size(); + DealWithAbnormalVO dealWithAbnormalVO = new DealWithAbnormalVO(); + dealWithAbnormalVO.setOrderPackageCodes(new ArrayList<>(orderPackageCodeSet)); + dealWithAbnormalVO.setCarsNo(carsLoadEntity.getCarsNo()); + dealWithAbnormalVO.setWarehouseName(warehouseName); + dealWithAbnormalVO.setNickName(AuthUtil.getNickName()); + dealWithAbnormalVO.setRemark("数据同步系统自动处理("+warehouseName+" "+carsLoadEntity.getCarsNo()+" "+AuthUtil.getNickName()+")"); + abnormalRecordClient.dealwithOrderPackageCodes(dealWithAbnormalVO); - List orderPackageCodes = new ArrayList<>(orderPackageCodeSet); + List orderPackageCodes = new ArrayList<>(orderPackageCodeSet); - orderPackageCodes.removeAll(orderPackageCodeList); + orderPackageCodes.removeAll(orderPackageCodeList); - String content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:" + IncomingTypeEnum.getValue(IncomingTypeEnum.SYNC_INCOMING.getCode()); - packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(), content); + String content = "包件在 " + warehouseName + "卸车,车次号:"+carsLoadEntity.getCarsNo()+" 卸车方式:" + IncomingTypeEnum.getValue(IncomingTypeEnum.SYNC_INCOMING.getCode()); + packageTrackLogAsyncService.addPackageTrackLog(AuthUtil.getTenantId(), AuthUtil.getUserId(), Func.firstLong(AuthUtil.getDeptId()), AuthUtil.getNickName(), orderPackageCodes, warehouseId, warehouseName, WorkNodeEnums.UNLOAD_INCOMING_WAREHOUSE.getCode(), content); + } } + + bladeRedis.del(key); return R.success("同步成功"+i+"条"); } From 17b06d4a3ec8072aabc9d3772ebe6e2d025db559 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Thu, 27 Mar 2025 10:56:21 +0800 Subject: [PATCH 23/29] =?UTF-8?q?feat(all):=20=E9=85=8D=E9=80=81=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E4=BB=B7=E6=A0=BC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改代码错误问题 --- .../distribution/receiver/report/QualityDeliverAddListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java index 5c8e7edf2..3f4a11923 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/QualityDeliverAddListener.java @@ -335,8 +335,8 @@ public class QualityDeliverAddListener implements ReportService { TrunklineWaybillOrderEntity entityByWaybillNoAndOrderCode = waybillOrderClient.findEntityByWaybillNoAndOrderCode(waybillNumber, orderCode); if (ObjectUtil.isNotEmpty(entityByWaybillNoAndOrderCode)) { qualityDeliverEntity.setOrderWaybillNumber(entityByWaybillNoAndOrderCode.getTotalNumber()); + redisCache.setEx(key, entityByWaybillNoAndOrderCode.getTotalNumber(), 60L); } - redisCache.setEx(key, entityByWaybillNoAndOrderCode.getTotalNumber(), 60L); } } } From ab1608886274a5c7f7e3d85ccf8f1b5feb56d8b2 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Thu, 27 Mar 2025 15:23:39 +0800 Subject: [PATCH 24/29] =?UTF-8?q?=E5=8F=B8=E6=9C=BA=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E7=AD=BE=E6=94=B6BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/DistributionSignforServiceImpl.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 7886fba9f..9d60e70e2 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 @@ -3984,6 +3984,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl Date: Thu, 27 Mar 2025 15:27:01 +0800 Subject: [PATCH 25/29] =?UTF-8?q?=E5=8F=B8=E6=9C=BA=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E7=AD=BE=E6=94=B6BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/DistributionSignforServiceImpl.java | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) 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 9d60e70e2..0d2faa721 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 @@ -6093,13 +6093,10 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl map = new HashMap<>(); -// map.put("orderPackageCode", collected); -// map.put("warehouseId", myCurrentWarehouse.getId()); -// warehouseUpdownTypeClient.downDeliveryPackage(map); -// trunklinePackageTrackLogClient.addPackageTrackLog(aaa); -// } + } //维护客户信息状态 -// reservationEntity.setLoadingStatus(ReservationLoadingStatusConstant.yizhuangche.getValue()); -// reservationEntity.setSigningStatus(ReservationSigningStatusConstant.yiqianshou.getValue()); -// distributionReservationMapper.updateById(reservationEntity); //更新配送装车时间 distributionDeliveryListEntity.setDeliveryStatus(DeliveryStatusConstant.peisongzhong.getValue()); distributionDeliveryListEntity.setDeliveryListLoadingStatus(DeliveryLoadingStatusConstant.yizhuangche.getValue()); From f5eda3d0a16c0a353e4ec59ab3761663ff3f3144 Mon Sep 17 00:00:00 2001 From: zhaoqiaobo <583671871@qq.com> Date: Thu, 27 Mar 2025 15:53:12 +0800 Subject: [PATCH 26/29] =?UTF-8?q?feat(all):=20=E9=85=8D=E9=80=81=E6=88=90?= =?UTF-8?q?=E6=9C=AC=E4=BB=B7=E6=A0=BC=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1 修改代码错误问题 --- .../receiver/report/DeliverFinishReportListener.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java index ba463406a..42749876e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/receiver/report/DeliverFinishReportListener.java @@ -160,6 +160,9 @@ public class DeliverFinishReportListener implements ReportService { entity.setWaybillNumber(qualityDeliverEntity.getWaybillNumber()); entity.setConditions(qualityDeliverEntity.getConditions()); entity.setSignNum(qualityDeliverEntity.getSignNum()); + entity.setArriveProvince(qualityDeliverEntity.getArriveProvince()); + entity.setArriveCity(qualityDeliverEntity.getArriveCity()); + entity.setArriveDistrict(qualityDeliverEntity.getArriveDistrict()); // 查询品类 BasicdataFactoryCategoryEntity param = new BasicdataFactoryCategoryEntity(); param.setBrand(qualityDeliverEntity.getBrandName()); @@ -770,9 +773,11 @@ public class DeliverFinishReportListener implements ReportService { Collection values = valueMap.values(); // 按省市区分组后的数量 arriveProvince arriveCity arriveDistrict if(CollUtil.isNotEmpty(values)){ - Set collect1 = values.stream().map(v -> { - return v.getArriveProvince() + v.getArriveCity() + v.getArriveDistrict(); - }).collect(Collectors.toSet()); + Set collect1 = values.stream() + .filter(v -> StrUtil.isNotEmpty(v.getArriveProvince() + v.getArriveCity() + v.getArriveDistrict())) + .map(v -> { + return v.getArriveProvince() + v.getArriveCity() + v.getArriveDistrict(); + }).collect(Collectors.toSet()); if(CollUtil.isNotEmpty(collect1)){ dkp = collect1.size(); } From 16b667f23afcbd72005c958acd4264c0639aeca8 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Thu, 27 Mar 2025 16:33:16 +0800 Subject: [PATCH 27/29] =?UTF-8?q?1.=E5=BC=80=E5=8D=95=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E6=95=B0=E6=8D=AE=E6=97=A5=E5=BF=97=E6=89=93?= =?UTF-8?q?=E5=8D=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 74170ede8..181a5f8c0 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 @@ -1027,6 +1027,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { }); if (CollUtil.isNotEmpty(updateStockArticleList)) { + log.info("###############openWaybill: 更新订单列表, {}", updateStockArticleList); distributionStockArticleClient.updateByBatchId(updateStockArticleList); } } From 6d2056f09436584e09b2003fd4c3d1ce2a10361b Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Thu, 27 Mar 2025 16:57:27 +0800 Subject: [PATCH 28/29] =?UTF-8?q?1.=E6=97=B6=E6=95=88=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E9=80=BB=E8=BE=91=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../logpm/report/mapper/ReportTimeMapper.xml | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml index 9a7ffd939..1ca670eb3 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/mapper/ReportTimeMapper.xml @@ -245,9 +245,10 @@ from logpm_trunkline_advance_detail lta left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 + left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where lta.create_time > '2024-10-22 00:00:00' + and lww.document_making_time > '2024-10-22 00:00:00' and lww.departure_warehouse_id != lww.destination_warehouse_id and waw.business_line is not null @@ -305,9 +306,10 @@ from logpm_trunkline_advance_detail lta left join logpm_warehouse_waybill lww on lww.id = lta.waybill_id left join logpm_warehouse_warehouse waw on waw.id = lta.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 + left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = lta.order_package_code and ltcls.warehouse_id = lta.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where lta.create_time > '2024-10-22 00:00:00' + and lww.document_making_time > '2024-10-22 00:00:00' and lww.departure_warehouse_id != lww.destination_warehouse_id and waw.business_line is not null @@ -579,7 +581,7 @@ round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/sum( if(ltcls.id is not null or ldpl.order_package_status != '20',1,0))/3600,1) avgTime from logpm_distribution_parcel_list ldpl left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 + left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where ldpl.is_transfer = 1 and ldpl.create_time > '2024-10-22 00:00:00' @@ -648,7 +650,7 @@ round(sum(TIMESTAMPDIFF(SECOND, ldpl.create_time, ltcll.start_date))/sum( if(ltcls.id is not null or ldpl.order_package_status != '20',1,0))/3600,1) avgTime from logpm_distribution_parcel_list ldpl left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 + left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where ldpl.is_transfer = 1 and ldpl.create_time > '2024-10-22 00:00:00' @@ -1405,6 +1407,7 @@ left join logpm_reportconfig_order_all oat on oat.departure_warehouse_id = lww.departure_warehouse_id and oat.destination_warehouse_id = lww.destination_warehouse_id and oat.is_deleted = 0 where ltad.waybill_id is not null and ltad.create_time > '2024-10-22 00:00:00' + and lww.document_making_time > '2024-10-22 00:00:00' and lww.departure_warehouse_id != lww.destination_warehouse_id and waw.business_line in @@ -2762,9 +2765,10 @@ left join logpm_trunkline_advance lta on lta.id = ltad.advance_id left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 + left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where ltad.create_time > '2024-10-22 00:00:00' + and lww.document_making_time > '2024-10-22 00:00:00' and lww.departure_warehouse_id != lww.destination_warehouse_id and waw.business_line is not null and waw.business_line = #{param.businessLine} @@ -2863,9 +2867,10 @@ left join logpm_trunkline_advance lta on lta.id = ltad.advance_id left join logpm_warehouse_waybill lww on lww.id = ltad.waybill_id left join logpm_warehouse_warehouse waw on waw.id = ltad.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 + left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ltad.order_package_code and ltcls.warehouse_id = ltad.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where ltad.create_time > '2024-10-22 00:00:00' + and lww.document_making_time > '2024-10-22 00:00:00' and lww.departure_warehouse_id != lww.destination_warehouse_id and waw.business_line is not null and waw.business_line = #{param.businessLine} @@ -2963,7 +2968,7 @@ from logpm_distribution_parcel_list ldpl left join logpm_trunkline_advance lta on lta.id = ldpl.advance_id left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 + left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where ldpl.is_transfer = 1 and ldpl.create_time > '2024-10-22 00:00:00' @@ -3064,7 +3069,7 @@ from logpm_distribution_parcel_list ldpl left join logpm_trunkline_advance lta on lta.id = ldpl.advance_id left join logpm_warehouse_warehouse waw on waw.id = ldpl.warehouse_id - left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 + left join logpm_trunkline_cars_load_scan ltcls on ltcls.scan_code = ldpl.order_package_code and ltcls.warehouse_id = ldpl.warehouse_id and ltcls.type = 1 and ltcls.scan_status != 4 left join logpm_trunkline_cars_load_line ltcll on ltcll.load_id = ltcls.load_id and ltcll.node_id = ltcls.warehouse_id where ldpl.is_transfer = 1 and ldpl.create_time > '2024-10-22 00:00:00' From a7d5605429e261b0e8c63b5a18559445c87a88b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E9=BE=99?= Date: Fri, 28 Mar 2025 09:59:20 +0800 Subject: [PATCH 29/29] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8B=86=E5=8D=95?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...DistributionSplitOrderTaskServiceImpl.java | 183 +++++++++++------- 1 file changed, 112 insertions(+), 71 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java index 7d3b6ef0a..22175185e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionSplitOrderTaskServiceImpl.java @@ -24,11 +24,11 @@ import com.logpm.distribution.service.IDistributionStockArticleService; import com.logpm.distribution.vo.SplitPackageOrderVO; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springblade.common.constant.order.OrderReservationStatusConstant; import org.springblade.common.constant.order.OrderSplitAllTaskStateConstant; import org.springblade.common.constant.order.OrderSplitStateConstant; -import org.springblade.common.constant.orderpackage.OrderPackageReservationStatusConstant; -import org.springblade.common.constant.orderpackage.OrderPackageSplitStateConstant; -import org.springblade.common.constant.orderpackage.OrderPackageStatusConstant; +import org.springblade.common.constant.order.OrderStatusConstant; +import org.springblade.common.constant.orderpackage.*; import org.springblade.common.exception.CustomerException; import org.springblade.core.mp.base.BaseServiceImpl; import org.springblade.core.mp.support.Condition; @@ -43,6 +43,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.ArrayList; import java.util.HashMap; import java.util.List; +import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @@ -106,6 +107,27 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaQuery() + .in(DistributionParcelListEntity::getStockArticleId, stockArticleId) + .ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()) + .eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) + .eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) + .eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue()) + .eq(DistributionParcelListEntity::getIsTransfer, 0) + ); + long packageAllCount = distributionParcelListService.count( + Wrappers.lambdaQuery() + .in(DistributionParcelListEntity::getStockArticleId, stockArticleId) + ); + if (packageAllowCount == 0 || packageAllCount == 1) { + return R.fail("订单"+ distributionStockArticle.getOrderCode() +"包件数量不足,不允许拆单"); + } taskLock(stockArticleId, () -> { String allTaskNo = getAllTaskNo(); @@ -210,6 +232,28 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaQuery() + .in(DistributionParcelListEntity::getOrderPackageCode, packageCodes) + .ne(DistributionParcelListEntity::getOrderPackageStatus, OrderPackageStatusConstant.yiqianshou.getValue()) + .eq(DistributionParcelListEntity::getOrderPackageReservationStatus, OrderPackageReservationStatusConstant.daiyuyue.getValue()) + .eq(DistributionParcelListEntity::getOrderPackageLoadingStatus, OrderPackageLoadingStatusConstant.weizhuancghe.getValue()) + .eq(DistributionParcelListEntity::getOrderPackageFreezeStatus, OrderPackageFreezeStatusConstant.weidongjie.getValue()) + .eq(DistributionParcelListEntity::getIsTransfer, 0) + ); + if (count != packageCodes.size()) { + return R.fail("提交包件包含预约、签收状态的包件"); + } + long currentOrderCount = distributionParcelListService.count( + Wrappers.lambdaQuery() + .in(DistributionParcelListEntity::getOrderPackageCode, packageCodes) + .eq(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId()) + ); + if (currentOrderCount < packageCodes.size()){ + return R.fail("提交包件包含不属于当前拆单订单的包件"); + } + try { List existsList = distributionSplitOrderDetailService.list(Wrappers.lambdaQuery() .in(DistributionSplitOrderDetailEntity::getOrderPackageCode, packageCodes) @@ -617,48 +661,12 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl packageList = distributionSplitOrderDetailService.list(Wrappers.lambdaQuery() - .eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, taskId) - .eq(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.finish.getValue()) - ); - - DistributionStockArticleEntity originalOrder = distributionStockArticleService.getById(task.getStockArticleId()); - originalOrder.setTotalNumber(originalOrder.getTotalNumber() - packageList.size()); - originalOrder.setHandQuantity(Math.max(originalOrder.getHandQuantity() - packageList.size(), 0)); - originalOrder.setIncomingNum(Math.max(originalOrder.getIncomingNum() - packageList.size(), 0)); - distributionStockArticleService.updateById(originalOrder); - - DistributionStockArticleEntity newOrder = distributionStockArticleService.getById(task.getNewStockArticleId()); - if (newOrder == null) { - newOrder = SerializationUtils.clone(originalOrder); - newOrder.setId(null); - newOrder.setOrderCode(task.getNewOrderCode()); - } - newOrder.setTotalNumber(packageList.size()); - newOrder.setHandQuantity(packageList.size()); - newOrder.setIncomingNum(packageList.size()); - if (newOrder.getId() != null) { - distributionStockArticleService.updateById(newOrder); - }else{ - distributionStockArticleService.save(newOrder); - } - - task.setNewStockArticleId(newOrder.getId()); task.setState(OrderSplitStateConstant.finish.getValue()); task.setFinishTime(DateUtil.now()); task.setFinishUsername(AuthUtil.getUser().getUserName()); task.setFinishUser(AuthUtil.getUser().getUserId()); updateById(task); - distributionParcelListService.update(Wrappers.lambdaUpdate() - .in(DistributionParcelListEntity::getOrderPackageCode, packageList.stream().map(DistributionSplitOrderDetailEntity::getOrderPackageCode).collect(Collectors.toList())) - .eq(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId()) - .set(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId()) - .set(DistributionParcelListEntity::getOrderCode, task.getNewOrderCode()) - ); - - distributionSplitOrderLogService.record(task, "完成拆单任务", AuthUtil.getUser().getUserName()); - } catch (Exception e) { if (e instanceof CustomerException) { throw new CustomerException(e.getMessage()); @@ -670,50 +678,67 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl packageList = distributionSplitOrderDetailService.list(Wrappers.lambdaQuery() + .eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, task.getId()) + .eq(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.finish.getValue()) + ); + + DistributionStockArticleEntity originalOrder = distributionStockArticleService.getById(task.getStockArticleId()); + originalOrder.setTotalNumber(originalOrder.getTotalNumber() - packageList.size()); + originalOrder.setHandQuantity(Math.max(originalOrder.getHandQuantity() - packageList.size(), 0)); + originalOrder.setIncomingNum(Math.max(originalOrder.getIncomingNum() - packageList.size(), 0)); + distributionStockArticleService.updateById(originalOrder); + + DistributionStockArticleEntity newOrder = distributionStockArticleService.getById(task.getNewStockArticleId()); + if (newOrder == null) { + newOrder = SerializationUtils.clone(originalOrder); + newOrder.setId(null); + newOrder.setOrderCode(task.getNewOrderCode()); + } + newOrder.setTotalNumber(packageList.size()); + newOrder.setHandQuantity(packageList.size()); + newOrder.setIncomingNum(packageList.size()); + if (newOrder.getId() != null) { + distributionStockArticleService.updateById(newOrder); + }else{ + distributionStockArticleService.save(newOrder); + } + + task.setNewStockArticleId(newOrder.getId()); + updateById(task); + + distributionParcelListService.update(Wrappers.lambdaUpdate() + .in(DistributionParcelListEntity::getOrderPackageCode, packageList.stream().map(DistributionSplitOrderDetailEntity::getOrderPackageCode).collect(Collectors.toList())) + .eq(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId()) + .set(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId()) + .set(DistributionParcelListEntity::getOrderCode, task.getNewOrderCode()) + ); + + distributionSplitOrderLogService.record(task, "完成拆单任务", AuthUtil.getUser().getUserName()); + } + + /** + * 取消完成 + * @param taskId + * @return + */ @Override public R cancelTask(Long taskId) { DistributionSplitOrderTaskEntity task = getById(taskId); if (!task.getState().equals(OrderSplitStateConstant.InProgress.getValue())) { - return R.fail("任务未已完成或已取消,无法操作"); + return R.fail("任务未已完成,无法操作"); } DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(task.getSplitOrderAllTaskId()); if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.InProgress.getValue())) { - return R.fail("拆单总任务已完成或已取消,无法操作"); + return R.fail("拆单总任务已完成,无法操作"); } try { - List packageList = distributionSplitOrderDetailService.list(Wrappers.lambdaQuery() - .eq(DistributionSplitOrderDetailEntity::getSplitOrderTaskId, taskId) - .eq(DistributionSplitOrderDetailEntity::getState, OrderPackageSplitStateConstant.finish.getValue()) - ); - - DistributionStockArticleEntity originalOrder = distributionStockArticleService.getById(task.getStockArticleId()); - originalOrder.setTotalNumber(originalOrder.getTotalNumber() + packageList.size()); - originalOrder.setHandQuantity(originalOrder.getHandQuantity() + packageList.size()); - distributionStockArticleService.updateById(originalOrder); - - DistributionStockArticleEntity newOrder = distributionStockArticleService.getById(task.getNewStockArticleId()); - - if (newOrder != null) { - newOrder.setTotalNumber(0); - newOrder.setHandQuantity(0); - distributionStockArticleService.updateById(newOrder); - } - - task.setNumber(0); task.setState(OrderSplitStateConstant.cancel.getValue()); updateById(task); - if (!packageList.isEmpty()) { - distributionParcelListService.update(Wrappers.lambdaUpdate() - .in(DistributionParcelListEntity::getOrderPackageCode, packageList.stream().map(DistributionSplitOrderDetailEntity::getOrderPackageCode).collect(Collectors.toList())) - .eq(DistributionParcelListEntity::getStockArticleId, task.getNewStockArticleId()) - .set(DistributionParcelListEntity::getStockArticleId, task.getStockArticleId()) - .set(DistributionParcelListEntity::getOrderCode, task.getOrderCode()) - ); - } - distributionSplitOrderLogService.record(task, "撤消拆单任务", AuthUtil.getUser().getUserName()); } catch (Exception e) { @@ -731,16 +756,24 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpl cancelAllTask(Long allTaskId) { DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId); if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.finish.getValue())) { - return R.fail("拆单总任务未完成或已取消,无法操作"); + return R.fail("拆单总任务已完成,无法操作"); } - allTask.setState(OrderSplitAllTaskStateConstant.InProgress.getValue()); + if (!list(Wrappers.lambdaQuery() + .eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, allTaskId) + .eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.finish.getValue()) + ).isEmpty()) { + return R.fail("拆单总任务中存在已完成拆单任务,无法操作"); + } + + allTask.setState(OrderSplitAllTaskStateConstant.cancel.getValue()); distributionSplitOrderAllTaskService.updateById(allTask); return R.success("success"); } @Override + @Transactional public R finishAllTask(Long allTaskId) { DistributionSplitOrderAllTaskEntity allTask = distributionSplitOrderAllTaskService.getById(allTaskId); if (!allTask.getState().equals(OrderSplitAllTaskStateConstant.InProgress.getValue())) { @@ -756,8 +789,16 @@ public class DistributionSplitOrderTaskServiceImpl extends BaseServiceImpllambdaQuery() + .eq(DistributionSplitOrderTaskEntity::getSplitOrderAllTaskId, allTaskId) + .eq(DistributionSplitOrderTaskEntity::getState, OrderSplitStateConstant.finish.getValue()) + ).forEach(this::packageTransfer); + return R.success("success"); }