From 624e8361bc19d6265768129345e65d548141dc23 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 29 Jan 2024 13:40:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E9=80=81=E4=BB=BB=E5=8A=A1=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=8A=82=E7=82=B9=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/node/BillLadingNode.java | 20 ++--- .../springblade/common/node/DeliveryNode.java | 18 ++--- .../common/node/ReservationNode.java | 26 +++---- .../springblade/common/node/StockUpNode.java | 35 +++++++++ .../mapper/DistributionStockMapper.java | 7 ++ .../mapper/DistributionStockMapper.xml | 3 + .../mapper/DistributionStockupMapper.java | 15 ++++ .../mapper/DistributionStockupMapper.xml | 17 +++++ .../service/IDistributionStockupService.java | 8 ++ .../impl/DistributionSignforServiceImpl.java | 76 ++++++++++++++++++- .../impl/DistributionStockupServiceImpl.java | 15 ++++ 11 files changed, 204 insertions(+), 36 deletions(-) create mode 100644 blade-biz-common/src/main/java/org/springblade/common/node/StockUpNode.java diff --git a/blade-biz-common/src/main/java/org/springblade/common/node/BillLadingNode.java b/blade-biz-common/src/main/java/org/springblade/common/node/BillLadingNode.java index 4b1b48b85..f68ca7089 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/node/BillLadingNode.java +++ b/blade-biz-common/src/main/java/org/springblade/common/node/BillLadingNode.java @@ -2,11 +2,11 @@ package org.springblade.common.node; public enum BillLadingNode { - chuangjianchenggong("创建成功","10"), - qianshouzhong("签收中","20"), - qianshouwancheng("签收完成","20"), + chuangjianchenggong("创建成功"), + qianshouzhong("签收中"), + qianshouwancheng("签收完成"), - yiwancheng("已完成","30"); + yiwancheng("已完成"); /** @@ -16,11 +16,11 @@ public enum BillLadingNode { /** * 值 */ - private String value; +// private String value; - BillLadingNode(String name, String value) { + BillLadingNode(String name) { this.name = name; - this.value = value; +// this.value = value; } @@ -28,7 +28,7 @@ public enum BillLadingNode { return name; } - public String getValue() { - return value; - } +// public String getValue() { +// return value; +// } } diff --git a/blade-biz-common/src/main/java/org/springblade/common/node/DeliveryNode.java b/blade-biz-common/src/main/java/org/springblade/common/node/DeliveryNode.java index 22a048d4e..1e4d2719f 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/node/DeliveryNode.java +++ b/blade-biz-common/src/main/java/org/springblade/common/node/DeliveryNode.java @@ -2,9 +2,9 @@ package org.springblade.common.node; public enum DeliveryNode { - chuangjianchenggong("创建成功","10"), - peisongzhong("配送中","20"), - yiwancheng("已完成","30"); + chuangjianchenggong("创建成功"), + peisongzhong("配送中"), + yiwancheng("已完成"); /** @@ -14,11 +14,11 @@ public enum DeliveryNode { /** * 值 */ - private String value; +// private String value; - DeliveryNode(String name, String value) { + DeliveryNode(String name) { this.name = name; - this.value = value; +// this.value = value; } @@ -26,7 +26,7 @@ public enum DeliveryNode { return name; } - public String getValue() { - return value; - } +// public String getValue() { +// return value; +// } } diff --git a/blade-biz-common/src/main/java/org/springblade/common/node/ReservationNode.java b/blade-biz-common/src/main/java/org/springblade/common/node/ReservationNode.java index 5b51066b2..b47676f24 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/node/ReservationNode.java +++ b/blade-biz-common/src/main/java/org/springblade/common/node/ReservationNode.java @@ -2,13 +2,13 @@ package org.springblade.common.node; public enum ReservationNode { - chuangjianchenggong("创建成功","10"), - peisongchuangjian("配送创建","20"), - zhuangchezhong("装车中","30"), - zhuangchewancheng("装车完成","40"), - qianshouzhong("签收中","50"), - qianshouwancheng("签收完成","60"), - fuhewancheng("复核完成","70"); + chuangjianchenggong("创建成功"), + peisongchuangjian("配送创建"), + zhuangchezhong("装车中"), + zhuangchewancheng("装车完成"), + qianshouzhong("签收中"), + qianshouwancheng("签收完成"), + fuhewancheng("复核完成"); /** @@ -18,11 +18,11 @@ public enum ReservationNode { /** * 值 */ - private String value; +// private String value; - ReservationNode(String name, String value) { + ReservationNode(String name) { this.name = name; - this.value = value; +// this.value = value; } @@ -30,7 +30,7 @@ public enum ReservationNode { return name; } - public String getValue() { - return value; - } +// public String getValue() { +// return value; +// } } diff --git a/blade-biz-common/src/main/java/org/springblade/common/node/StockUpNode.java b/blade-biz-common/src/main/java/org/springblade/common/node/StockUpNode.java new file mode 100644 index 000000000..82c780b82 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/node/StockUpNode.java @@ -0,0 +1,35 @@ +package org.springblade.common.node; + +public enum StockUpNode { + + chuangjianchenggong("创建成功"), + + yizhipai("已指派"), + beihuozhong("备货中"), + + yiwancheng("已完成"); + + + /** + * 状态 + */ + private String name; + /** + * 值 + */ +// private String value; + + StockUpNode(String name) { + this.name = name; +// this.value = value; + } + + + public String getName() { + return name; + } + +// public String getValue() { +// return value; +// } +} diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java index 9bb0f98f8..be5176a44 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockMapper.java @@ -85,4 +85,11 @@ public interface DistributionStockMapper extends BaseMapper + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java index 880ae65fb..f529a23f2 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.java @@ -255,4 +255,19 @@ public interface DistributionStockupMapper extends BaseMapper exportStockUptInventoryDetail(@Param("ids")List list); + + /** + * 根据备货编码查询出备货任务信息 + * @param id + * @param searchCode + * @return + */ + DistributionStockupEntity selectStockUpByStockUpCode(@Param("warehouseId") Long warehouseId,@Param("stockupCode") String stockupCode); + + /** + * 查询备货任务计划备货数量 + * @param id + * @return + */ + Integer selectStockUpPlanNum(@Param("stockUpId") Long stockUpId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml index a31bba5e8..afd4162d3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionStockupMapper.xml @@ -1234,5 +1234,22 @@ #{id} + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java index 6b886548b..5be9b48f0 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionStockupService.java @@ -284,4 +284,12 @@ public interface IDistributionStockupService extends BaseService exportStockUptDetail(List list); + + + /** + * 根据备货编码查询备货任务 + * @param searchCode + * @return + */ + DistributionStockupEntity selectStockUpByStockUpCode(String searchCode); } 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 c91b9f527..19d7e6994 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 @@ -64,10 +64,12 @@ import org.springblade.common.constant.orderpackage.*; import org.springblade.common.constant.reservation.*; import org.springblade.common.constant.signing.SignforDriverSigningStatusConstant; import org.springblade.common.constant.signing.SignforStatusConstant; +import org.springblade.common.constant.stockup.StockAssignStatusConstant; import org.springblade.common.exception.CustomerException; import org.springblade.common.node.BillLadingNode; import org.springblade.common.node.DeliveryNode; import org.springblade.common.node.ReservationNode; +import org.springblade.common.node.StockUpNode; import org.springblade.common.serviceConstant.ServiceConstant; import org.springblade.common.utils.CommonUtil; import org.springblade.common.utils.FileUtil; @@ -194,6 +196,12 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl handleStockUp(DistributionStockupEntity distributionStockupEntity) { + List nodeVos = new ArrayList<>(); + try { + StringBuilder sb = new StringBuilder(); + DeliveryNodeVo startStockUpNodeVo = new DeliveryNodeVo(); + startStockUpNodeVo.setTime(distributionStockupEntity.getCreateTime()); + startStockUpNodeVo.setNodeName(StockUpNode.chuangjianchenggong.getName()); + startStockUpNodeVo.setNodeUserName(userClient.userInfoById(distributionStockupEntity.getCreateUser()).getData().getName()); + //查询备货任务数量 + Integer stockUpPlanNum = distributionStockupMapper.selectStockUpPlanNum(distributionStockupEntity.getId()); + startStockUpNodeVo.setNodeInfo("计划备货"+stockUpPlanNum+"件;"); + nodeVos.add(startStockUpNodeVo); + if (distributionStockupEntity.getAssignStatus().equals(StockAssignStatusConstant.yizhipai.getValue())){ + DeliveryNodeVo assignStockUpNodeVo = new DeliveryNodeVo(); + assignStockUpNodeVo.setNodeName(StockUpNode.yizhipai.getName()); + assignStockUpNodeVo.setTime(distributionStockupEntity.getAssignTime()); + assignStockUpNodeVo.setNodeInfo("指派"+distributionStockupEntity.getLoaderName()+"计划备货"+stockUpPlanNum+"件;"); + assignStockUpNodeVo.setNodeUserName(userClient.userInfoById(distributionStockupEntity.getCreateUser()).getData().getName()); + nodeVos.add(assignStockUpNodeVo); + } + //查询是否存在备货扫描的数据 + Integer stockupNum = distributionStockMapper.selectStockNumByStockupId(distributionStockupEntity.getId()); + if (stockupNum > 0){ + DeliveryNodeVo middleStockUpNodeVo = new DeliveryNodeVo(); + middleStockUpNodeVo.setNodeName(StockUpNode.beihuozhong.getName()); + //查询备货扫描列表 + List distributionStockEntities = distributionStockMapper.selectList(Wrappers.query().lambda() + .eq(DistributionStockEntity::getStockupId, distributionStockupEntity.getId()) + ); + List userId = distributionStockEntities.stream().map(DistributionStockEntity::getCreateUser).distinct().collect(Collectors.toList()); + List scanUser = new ArrayList<>(); + for (Long id : userId) { + R userR = userClient.userInfoById(id); + if (Func.isNotEmpty(userR)){ + scanUser.add(userR.getData().getName()); + } + } + middleStockUpNodeVo.setNodeUserName(String.join(",", scanUser)); + List collect = distributionStockEntities.stream().map(DistributionStockEntity::getCreateTime).distinct().collect(Collectors.toList()); + middleStockUpNodeVo.setTime(Collections.max(collect)); + if (stockupNum == stockUpPlanNum){ + middleStockUpNodeVo.setNodeName(StockUpNode.yiwancheng.getName()); + } + middleStockUpNodeVo.setNodeInfo("计划备货"+stockUpPlanNum+"件;"+"备货"+stockupNum+"件;"); + nodeVos.add(middleStockUpNodeVo); + } + }catch (Exception e){ + throw new RuntimeException(e); + } + + + return nodeVos; + } + private List handleBillLading(DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) { List nodeVos = new ArrayList<>(); try { @@ -838,7 +906,6 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl0){ - StringBuilder sb = new StringBuilder(); //存在装车环境,进行数量的比对 DeliveryNodeVo middleBillLadingNodeVo = new DeliveryNodeVo(); middleBillLadingNodeVo.setNodeName(BillLadingNode.qianshouzhong.getName()); @@ -849,6 +916,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl distributionBillLadingScanEntityList = distributionBillLadingScanService.list(Wrappers.query().lambda() .eq(DistributionBillLadingScanEntity::getBillLadingId,distrilbutionBillLadingEntity.getId()) ); + List userName = new ArrayList<>(); if (Func.isNotEmpty(distributionBillLadingScanEntityList)){ List userIds = distributionBillLadingScanEntityList.stream().map(DistributionBillLadingScanEntity::getCreateUser).collect(Collectors.toList()); if (Func.isNotEmpty(userIds)){ @@ -856,7 +924,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl userR = userClient.userInfoById(userId); if (Func.isNotEmpty(userR)){ - sb.append(userR.getData().getName()+","); + userName.add(userR.getData().getName()+","); } } } @@ -864,7 +932,7 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl collect = distributionBillLadingScanEntityList.stream().map(DistributionBillLadingScanEntity::getCreateTime).distinct().collect(Collectors.toList()); Date max = Collections.max(collect); middleBillLadingNodeVo.setTime(max); - middleBillLadingNodeVo.setNodeUserName(sb.delete(sb.length()-1, sb.length()).toString()); + middleBillLadingNodeVo.setNodeUserName(String.join(",",userName)); middleBillLadingNodeVo.setNodeInfo("计划自提"+billLadingNum+"件,"+"装车"+loadingNum+"件"); nodeVos.add(middleBillLadingNodeVo); } 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 13bc31eb2..d17546604 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 @@ -3299,4 +3299,19 @@ public class DistributionStockupServiceImpl extends BaseServiceImpl