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"; /** 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)); 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,"; 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); + } +}