From a4415e659b202c5c78c3fe34156cb2732b81402e Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Fri, 26 Jan 2024 14:15:24 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E9=85=8D=E9=80=81=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E6=9F=A5=E8=AF=A2=E3=80=81=E8=87=AA=E6=8F=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/node/BillLadingNode.java | 32 ++++ .../common/node/ReservationNode.java | 36 ++++ .../mapper/DistributionReservationMapper.java | 8 + .../mapper/DistributionReservationMapper.xml | 4 + .../mapper/DistributionSignforMapper.java | 4 +- .../mapper/DistributionSignforMapper.xml | 3 + .../mapper/DistrilbutionBillLadingMapper.java | 15 ++ .../mapper/DistrilbutionBillLadingMapper.xml | 10 ++ .../IDistributionReservationService.java | 8 +- .../IDistrilbutionBillLadingService.java | 14 ++ .../DistributionReservationServiceImpl.java | 17 +- .../impl/DistributionSignforServiceImpl.java | 164 +++++++++++++++++- .../DistrilbutionBillLadingServiceImpl.java | 23 +++ 13 files changed, 333 insertions(+), 5 deletions(-) create mode 100644 blade-biz-common/src/main/java/org/springblade/common/node/BillLadingNode.java create mode 100644 blade-biz-common/src/main/java/org/springblade/common/node/ReservationNode.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 new file mode 100644 index 000000000..75968721e --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/node/BillLadingNode.java @@ -0,0 +1,32 @@ +package org.springblade.common.node; + +public enum BillLadingNode { + + chuangjianchenggong("创建成功","10"), + qianshouzhong("签收中","20"), + yiwancheng("已完成","30"); + + + /** + * 状态 + */ + private String name; + /** + * 值 + */ + private String value; + + BillLadingNode(String name, String value) { + this.name = name; + this.value = value; + } + + + public String getName() { + return name; + } + + 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 new file mode 100644 index 000000000..5b51066b2 --- /dev/null +++ b/blade-biz-common/src/main/java/org/springblade/common/node/ReservationNode.java @@ -0,0 +1,36 @@ +package org.springblade.common.node; + +public enum ReservationNode { + + chuangjianchenggong("创建成功","10"), + peisongchuangjian("配送创建","20"), + zhuangchezhong("装车中","30"), + zhuangchewancheng("装车完成","40"), + qianshouzhong("签收中","50"), + qianshouwancheng("签收完成","60"), + fuhewancheng("复核完成","70"); + + + /** + * 状态 + */ + private String name; + /** + * 值 + */ + private String value; + + ReservationNode(String name, String value) { + 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/DistributionReservationMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java index a2f2b3649..c3b60558e 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.java @@ -357,4 +357,12 @@ public interface DistributionReservationMapper extends BaseMapper selectInvenToryPackageByReservationInfo(@Param("param") Map reservationPackageDTO,IPage page); List getReservationPackageNew(@Param("param")Map distributionDeliveryInfoDTO); + + /** + * 根据预约单号查询预约 + * @param warehouseCode + * @param searchCode + * @return + */ + DistributionReservationEntity selectByReservationCode(@Param("warehouseId") Long warehouseId,@Param("reservationCode") String reservationCode); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml index 254ecd992..c8de2a25a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionReservationMapper.xml @@ -1693,4 +1693,8 @@ + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java index 37e274f25..6ac9ea56f 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.java @@ -319,5 +319,7 @@ public interface DistributionSignforMapper extends BaseMapper selectReservationByDeliveryId(Long deliveryId); + List selectReservationByDeliveryId(@Param("deliveryId") Long deliveryId); + + DistributionSignforEntity selectByReservationId(@Param("reservationId") Long reservationId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml index c511c3a8b..bce2d6ec6 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionSignforMapper.xml @@ -1286,4 +1286,7 @@ AND ldr.is_deleted = 0 AND lds.is_deleted = 0 + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java index a4dea576e..c9b85f24c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.java @@ -112,4 +112,19 @@ public interface DistrilbutionBillLadingMapper extends BaseMapper selectBillLadingPackage(@Param("ids")List ids); List selectBillLadingInventory(@Param("ids")List ids); + + /** + * 根据自提单号查询自提单 + * @param id + * @param searchCode + * @return + */ + DistrilbutionBillLadingEntity selectByBillLadingCode(@Param("warehouseId") Long id,@Param("pickupBatch") String pickupBatch); + + /** + * 查询自提单计划件数 + * @param id + * @return + */ + Integer selectBillLadingPlanNum(@Param("billLadingId") Long billLadingId); } diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml index b6cb2d3fe..e2a77243c 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistrilbutionBillLadingMapper.xml @@ -470,6 +470,16 @@ #{id} + + diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java index 680034c36..00288840a 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/IDistributionReservationService.java @@ -220,8 +220,6 @@ public interface IDistributionReservationService extends BaseService packageDTO,IPage page); @@ -271,4 +269,10 @@ public interface IDistributionReservationService extends BaseService p.getOrderPackageLoadingStatus().equals(OrderPackageLoadingStatusConstant.yizhuangche.getValue())); - signStatus = distributionParcelListEntities.stream().anyMatch(p->p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); + signStatus = distributionParcelListEntities.stream().allMatch(p->p.getOrderPackageStatus().equals(OrderPackageStatusConstant.yiqianshou.getValue())); } if (Func.isNotEmpty(disStockListDetailEntities)){ @@ -3663,4 +3663,19 @@ public class DistributionReservationServiceImpl extends BaseServiceImpl handleBillLading(DistrilbutionBillLadingEntity distrilbutionBillLadingEntity) { + List nodeVos = new ArrayList<>(); + try { + DeliveryNodeVo billLadingNodeVo = new DeliveryNodeVo(); + billLadingNodeVo.setTime(distrilbutionBillLadingEntity.getCreateTime()); + billLadingNodeVo.setNodeName(BillLadingNode.chuangjianchenggong.getName()); + String name = userClient.userInfoById(distrilbutionBillLadingEntity.getCreateUser()).getData().getName(); + billLadingNodeVo.setNodeUserName(name); + //查询自提的自提数量 + Integer billLadingNum = distrilbutionBillLadingService.selectBillLadingPlanNum(distrilbutionBillLadingEntity.getId()); + billLadingNodeVo.setNodeInfo("计划自提"+billLadingNum+"件"); + nodeVos.add(billLadingNodeVo); + //查询自提扫描数量 + + + }catch (Exception e){ + + } + + return nodeVos; + } + + private List handleReservationNode(DistributionReservationEntity reservationEntity) { + + List nodeVos = new ArrayList<>(); + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + + try { + DeliveryNodeVo reservationNodeVo = new DeliveryNodeVo(); + int projectNum = reservationEntity.getReservationNum() + reservationEntity.getReservationStockListNum(); + reservationNodeVo.setTime(reservationEntity.getCreateTime()); + String name = userClient.userInfoById(reservationEntity.getCreateUser()).getData().getName(); + reservationNodeVo.setNodeUserName(name); + reservationNodeVo.setNodeName(ReservationNode.chuangjianchenggong.getName()); + reservationNodeVo.setNodeInfo("计划配送"+projectNum+"件"); + nodeVos.add(reservationNodeVo); + //查询装车 + Integer loadingNum = distributionLoadscanMapper.selectLoadingNumByReservationId(reservationEntity.getId()); + if (loadingNum > 0){ + DeliveryNodeVo middleReservationNodeVo = new DeliveryNodeVo(); + middleReservationNodeVo.setNodeName(ReservationNode.zhuangchezhong.getName()); + //查询预约装车操作人有那些 + List loadscanEntityList = distributionLoadscanMapper.selectList(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getReservationId, reservationEntity.getId()) + .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) + ); + List scanUser = new ArrayList<>(); + List loadingTime = new ArrayList<>(); + + if (Func.isNotEmpty(loadscanEntityList)){ + List packageScanUser = loadscanEntityList.stream().map(DistributionLoadscanEntity::getScanUser).collect(Collectors.toList()); + scanUser.addAll(packageScanUser); + List packagheLoadingTime = loadscanEntityList.stream().map(DistributionLoadscanEntity::getScanTime).collect(Collectors.toList()); + loadingTime.addAll(packagheLoadingTime); + } + List inventoryLoading = distributionLoadscaninvnMapper.selectList(Wrappers.query().lambda() + .eq(DistributionLoadscaninvnEntity::getReservationId, reservationEntity.getId()) + .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) + ); + if (Func.isNotEmpty(inventoryLoading)){ + List InventoryScanUser = inventoryLoading.stream().map(DistributionLoadscaninvnEntity::getScanUser).collect(Collectors.toList()); + scanUser.addAll(InventoryScanUser); + List inventoryLoadingTime = inventoryLoading.stream().map(DistributionLoadscaninvnEntity::getScanTime).collect(Collectors.toList()); + loadingTime.addAll(inventoryLoadingTime); + } + if (Func.isNotEmpty(scanUser)){ + String scanUsers = scanUser.stream().distinct().collect(Collectors.joining(",")); + middleReservationNodeVo.setNodeUserName(scanUsers); + } + if (Func.isNotEmpty(loadingTime)){ + String max = Collections.max(loadingTime); + middleReservationNodeVo.setTime(sdf.parse(max)); + } + if (reservationEntity.getLoadingStatus().equals(ReservationLoadingStatusConstant.yizhuangche.getValue())){ + middleReservationNodeVo.setNodeName(ReservationNode.zhuangchewancheng.getName()); + } + middleReservationNodeVo.setNodeInfo("计划配送"+projectNum+"件"+"装车"+loadingNum+"件"); + nodeVos.add(middleReservationNodeVo); + + } + Integer signingNum = distributionLoadscanMapper.selectSigningNumByReservationId(reservationEntity.getId()); + + if (signingNum>0){ + DeliveryNodeVo endReservationNodeVo = new DeliveryNodeVo(); + endReservationNodeVo.setNodeName(ReservationNode.qianshouzhong.getName()); + //查询预约装车操作人有那些 + List loadscanEntityList = distributionLoadscanMapper.selectList(Wrappers.query().lambda() + .eq(DistributionLoadscanEntity::getReservationId, reservationEntity.getId()) + .eq(DistributionLoadscanEntity::getSignforState, LoadScanSigningStatusConstant.yiqianshou.getValue()) + .ne(DistributionLoadscanEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) + ); + List scanUser = new ArrayList<>(); + List signTime = new ArrayList<>(); + if (Func.isNotEmpty(loadscanEntityList)){ + List packageScanUser = loadscanEntityList.stream().map(DistributionLoadscanEntity::getScanUser).collect(Collectors.toList()); + scanUser.addAll(packageScanUser); + List packagheSignTimeTime = loadscanEntityList.stream().map(DistributionLoadscanEntity::getSigningTime).collect(Collectors.toList()); + signTime.addAll(packagheSignTimeTime); + + } + List inventoryLoading = distributionLoadscaninvnMapper.selectList(Wrappers.query().lambda() + .eq(DistributionLoadscaninvnEntity::getReservationId, reservationEntity.getId()) + .eq(DistributionLoadscaninvnEntity::getSignforState, LoadScanSigningStatusConstant.yiqianshou.getValue()) + .ne(DistributionLoadscaninvnEntity::getScanStatus, LoadingStatusConstant.quxiao.getValue()) + ); + if (Func.isNotEmpty(inventoryLoading)){ + List inventoryScanUser = inventoryLoading.stream().map(DistributionLoadscaninvnEntity::getScanUser).collect(Collectors.toList()); + scanUser.addAll(inventoryScanUser); + List inventorySignTimeTime = inventoryLoading.stream().map(DistributionLoadscaninvnEntity::getSigningTime).collect(Collectors.toList()); + signTime.addAll(inventorySignTimeTime); + } + if (Func.isNotEmpty(scanUser)){ + String scanUsers = scanUser.stream().distinct().collect(Collectors.joining(",")); + endReservationNodeVo.setNodeUserName(scanUsers); + } + if (Func.isNotEmpty(signTime)){ + String max = Collections.max(signTime); + endReservationNodeVo.setTime(sdf.parse(max)); + } + + if (reservationEntity.getSigningStatus().equals(ReservationSigningStatusConstant.yiqianshou.getValue())){ + endReservationNodeVo.setNodeName(ReservationNode.qianshouwancheng.getName()); + } + endReservationNodeVo.setNodeInfo("计划配送"+projectNum+"件;"+"装车"+loadingNum+"件;"+"签收"+signingNum+"件"); + nodeVos.add(endReservationNodeVo); + } + //查询此预约是否完成复核 + DistributionSignforEntity signforEntity = distributionSignforMapper.selectByReservationId(reservationEntity.getId()); + if (Func.isNotEmpty(signforEntity)){ + if (signforEntity.getSigningStatus().equals(SignforStatusConstant.yiqianshou.getValue())){ + DeliveryNodeVo signReservationNodeVo = new DeliveryNodeVo(); + signReservationNodeVo.setTime(sdf.parse(signforEntity.getSigningTime())); + signReservationNodeVo.setNodeUserName(signforEntity.getExamineUserName()); + signReservationNodeVo.setNodeName(ReservationNode.fuhewancheng.getName()); + signReservationNodeVo.setNodeInfo("计划配送"+projectNum+"件;"+"装车"+loadingNum+"件;"+"签收"+signingNum+"件"); + nodeVos.add(signReservationNodeVo); + } + } + }catch (Exception e){ + throw new RuntimeException(e); + + } + return nodeVos; + } + private List handleDeliveryNode(DistributionDeliveryListEntity deliveryListEntity) { List nodeVos = new ArrayList<>(); try { 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 393b59ef0..e0f7b2cee 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 @@ -685,6 +685,29 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl ids) { String method = "##########类DistrilbutionBillLadingServiceImpl执行方法cancelBillLoding,"; From 166cc8b9a2bb809fe6bf6a1951efe1a02f60209a Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Fri, 26 Jan 2024 16:43:47 +0800 Subject: [PATCH 2/4] =?UTF-8?q?1.dev=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/springblade/common/constant/LauncherConstant.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java b/blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java index 022b1ee6b..ffbd3c95e 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java +++ b/blade-biz-common/src/main/java/org/springblade/common/constant/LauncherConstant.java @@ -45,7 +45,7 @@ public interface LauncherConstant { /** * nacos dev 地址 */ - String NACOS_DEV_ADDR = "192.168.10.46:8848"; + String NACOS_DEV_ADDR = "192.168.2.100:8848"; /** @@ -77,7 +77,7 @@ public interface LauncherConstant { /** * seata dev 地址 */ - String SEATA_DEV_ADDR = "192.168.10.46:8091"; + String SEATA_DEV_ADDR = "192.168.2.100:8091"; /** From 978d4f0f9110c5081bdb26e3f1be978b271d3b72 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Fri, 26 Jan 2024 16:44:06 +0800 Subject: [PATCH 3/4] =?UTF-8?q?1.dev=E7=8E=AF=E5=A2=83=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../springblade/common/launch/LauncherServiceImpl.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java b/blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java index 7d5c44bb6..2749bc113 100644 --- a/blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java +++ b/blade-biz-common/src/main/java/org/springblade/common/launch/LauncherServiceImpl.java @@ -41,10 +41,10 @@ public class LauncherServiceImpl implements LauncherService { PropsUtil.setProperty(props, "spring.cloud.nacos.config.server-addr", LauncherConstant.nacosAddr(profile)); - PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos"); - PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123"); - PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos"); - PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123"); +// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.username","nacos"); +// PropsUtil.setProperty(props, "spring.cloud.nacos.discovery.password","Nacos123123"); +// PropsUtil.setProperty(props, "spring.cloud.nacos.config.username","nacos"); +// PropsUtil.setProperty(props, "spring.cloud.nacos.config.password","Nacos123123"); PropsUtil.setProperty(props, "spring.cloud.sentinel.transport.dashboard", LauncherConstant.sentinelAddr(profile)); From b4c983f227987631acdfbcb0b3aa720691137df7 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Fri, 26 Jan 2024 17:04:56 +0800 Subject: [PATCH 4/4] =?UTF-8?q?1.=E8=A1=A5=E4=B8=81=E7=A8=8B=E5=BA=8F-?= =?UTF-8?q?=E5=A4=84=E7=90=86=E5=8C=85=E4=BB=B6=E7=AD=BE=E6=94=B6=E5=AE=8C?= =?UTF-8?q?=EF=BC=8C=E8=AE=A2=E5=8D=95=E7=8A=B6=E6=80=81=E6=9C=AA=E7=AD=BE?= =?UTF-8?q?=E6=94=B6=E7=9A=84=E8=AE=A2=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../patch/jobhandle/OrderDataRepair.java | 40 +++++++++++++++++++ .../logpm/patch/mapper/OrderDataMapper.java | 16 ++++++++ .../logpm/patch/mapper/OrderDataMapper.xml | 21 ++++++++++ .../patch/service/IOrderDataService.java | 9 +++++ .../service/impl/OrderDataServiceImpl.java | 28 +++++++++++++ 5 files changed, 114 insertions(+) create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java new file mode 100644 index 000000000..b0fb86d2e --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/OrderDataRepair.java @@ -0,0 +1,40 @@ +package com.logpm.patch.jobhandle; + +import com.logpm.patch.service.IOrderDataService; +import com.xxl.job.core.biz.model.ReturnT; +import com.xxl.job.core.handler.annotation.XxlJob; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +import java.util.List; + +@Slf4j +@AllArgsConstructor +@Component +public class OrderDataRepair { + + private final IOrderDataService orderDataService; + + @XxlJob("repairOrderSignStatus") + public ReturnT repairOrderSignStatus(String param) { + log.info("####################repairOrderSignStatus: 修复订单签收状态 开始"); + + //查询所有包件已入库并且已签收的订单状态不为已签收的数据修复状态 + List ls = orderDataService.findAllNoSignStatusOrder(); + for (Long orderId : ls) { + try{ + log.info("#############repairOrderSignStatus: 当前处理的订单id为{}",orderId); + orderDataService.updateOrderStatusByOrderId(orderId,"80"); + }catch (Exception e){ + log.error("##############repairOrderSignStatus: 处理订单id为{}的订单失败",orderId); + continue; + } + } + + log.info("####################repairOrderSignStatus: 修复订单签收状态 完成"); + return ReturnT.SUCCESS; + } + + +} diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java new file mode 100644 index 000000000..4ed3e9065 --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.java @@ -0,0 +1,16 @@ +package com.logpm.patch.mapper; + +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +@Mapper +public interface OrderDataMapper { + + + List findAllNoSignStatusOrder(); + + void updateOrderStatusByOrderId(@Param("orderId") Long orderId, @Param("orderStatus") String orderStatus); + +} diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml new file mode 100644 index 000000000..53ab0a555 --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/OrderDataMapper.xml @@ -0,0 +1,21 @@ + + + + + + + + update logpm_distribution_stock_article + set order_status = #{orderStatus} + where id = #{orderId} + + + diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java new file mode 100644 index 000000000..3d3091713 --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IOrderDataService.java @@ -0,0 +1,9 @@ +package com.logpm.patch.service; + +import java.util.List; + +public interface IOrderDataService { + List findAllNoSignStatusOrder(); + + void updateOrderStatusByOrderId(Long orderId, String orderStatus); +} diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java new file mode 100644 index 000000000..b2a4c100f --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/OrderDataServiceImpl.java @@ -0,0 +1,28 @@ +package com.logpm.patch.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.logpm.patch.mapper.OrderDataMapper; +import com.logpm.patch.service.IOrderDataService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +import java.util.List; + +@Slf4j +@Service +@AllArgsConstructor +public class OrderDataServiceImpl implements IOrderDataService { + + private final OrderDataMapper orderDataMapper; + + @Override + public List findAllNoSignStatusOrder() { + return orderDataMapper.findAllNoSignStatusOrder(); + } + + @Override + public void updateOrderStatusByOrderId(Long orderId, String orderStatus) { + orderDataMapper.updateOrderStatusByOrderId(orderId,orderStatus); + } +}