From b21905cbb6c8f39948fcca16fd554e63492e2c03 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Tue, 25 Jun 2024 18:37:15 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=BA=93=E5=86=85bug=E4=BF=AE=E5=A4=8D=202.?= =?UTF-8?q?=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 --- .../patch/vo/PackageAllocationInfoVO.java | 16 + .../com/logpm/patch/vo/PackageTrayInfoVO.java | 19 ++ .../logpm/patch/vo/StockAllocationInfoVO.java | 15 + .../com/logpm/patch/vo/StockTrayInfoVO.java | 14 + .../logpm/patch/vo/ZeroAllocationInfoVO.java | 14 + .../com/logpm/patch/vo/ZeroTrayInfoVO.java | 14 + .../patch/jobhandle/SyncWarehouseData.java | 276 +++++++++++++++++- .../mapper/WarehouseMappingDataMapper.java | 15 +- .../mapper/WarehouseMappingDataMapper.xml | 62 ++++ .../patch/service/ISendFanoutService.java | 7 + .../service/IWarehouseMappingDataService.java | 14 +- .../service/impl/SendFanoutServiceImpl.java | 24 ++ .../impl/WarehouseMappingDataServiceImpl.java | 32 +- .../mapper/TrunklineCarsLoadMapper.xml | 1 + .../trunkline/mq/OpenOrderToLoadListener.java | 1 + .../service/impl/OpenOrderServiceImpl.java | 10 + .../TrunklineAdvanceDetailServiceImpl.java | 24 +- .../impl/TrunklineCarsLoadServiceImpl.java | 2 + .../impl/WarehouseTrayTypeServiceImpl.java | 1 - 19 files changed, 543 insertions(+), 18 deletions(-) create mode 100644 blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/PackageAllocationInfoVO.java create mode 100644 blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/PackageTrayInfoVO.java create mode 100644 blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/StockAllocationInfoVO.java create mode 100644 blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/StockTrayInfoVO.java create mode 100644 blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/ZeroAllocationInfoVO.java create mode 100644 blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/ZeroTrayInfoVO.java create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISendFanoutService.java create mode 100644 blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SendFanoutServiceImpl.java diff --git a/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/PackageAllocationInfoVO.java b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/PackageAllocationInfoVO.java new file mode 100644 index 000000000..a770570ec --- /dev/null +++ b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/PackageAllocationInfoVO.java @@ -0,0 +1,16 @@ +package com.logpm.patch.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PackageAllocationInfoVO implements Serializable { + + private String orderPackageCode; + private String orderPackageStatus; + private String allocationName; + private Integer conditions; + private Long warehouseId; + +} diff --git a/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/PackageTrayInfoVO.java b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/PackageTrayInfoVO.java new file mode 100644 index 000000000..2cb7231e3 --- /dev/null +++ b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/PackageTrayInfoVO.java @@ -0,0 +1,19 @@ +package com.logpm.patch.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class PackageTrayInfoVO implements Serializable { + + private Long packageId; + private String orderPackageCode; + private Long orderId; + private String orderCode; + private String orderPackageStatus; + private String trayName; + private Integer conditions; + private Long warehouseId; + +} diff --git a/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/StockAllocationInfoVO.java b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/StockAllocationInfoVO.java new file mode 100644 index 000000000..43fd3a2ed --- /dev/null +++ b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/StockAllocationInfoVO.java @@ -0,0 +1,15 @@ +package com.logpm.patch.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class StockAllocationInfoVO implements Serializable { + + private Long stockListId; + private Long warehouseId; + private String allocationName; + + +} diff --git a/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/StockTrayInfoVO.java b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/StockTrayInfoVO.java new file mode 100644 index 000000000..6041f86a2 --- /dev/null +++ b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/StockTrayInfoVO.java @@ -0,0 +1,14 @@ +package com.logpm.patch.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class StockTrayInfoVO implements Serializable { + + private Long stockListId; + private Long warehouseId; + private String trayName; + +} diff --git a/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/ZeroAllocationInfoVO.java b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/ZeroAllocationInfoVO.java new file mode 100644 index 000000000..664349272 --- /dev/null +++ b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/ZeroAllocationInfoVO.java @@ -0,0 +1,14 @@ +package com.logpm.patch.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ZeroAllocationInfoVO implements Serializable { + + private String orderCode; + private Long warehouseId; + private String allocationName; + +} diff --git a/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/ZeroTrayInfoVO.java b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/ZeroTrayInfoVO.java new file mode 100644 index 000000000..82846b150 --- /dev/null +++ b/blade-service-api/logpm-patch-api/src/main/java/com/logpm/patch/vo/ZeroTrayInfoVO.java @@ -0,0 +1,14 @@ +package com.logpm.patch.vo; + +import lombok.Data; + +import java.io.Serializable; + +@Data +public class ZeroTrayInfoVO implements Serializable { + + private String orderCode; + private Long warehouseId; + private String trayName; + +} diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java index 504821260..336f4586f 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/jobhandle/SyncWarehouseData.java @@ -5,16 +5,21 @@ import com.logpm.basicdata.entity.*; import com.logpm.basicdata.feign.*; import com.logpm.oldproject.entity.*; import com.logpm.oldproject.feign.*; +import com.logpm.patch.service.ISendFanoutService; import com.logpm.patch.service.IWarehouseMappingDataService; -import com.logpm.warehouse.feign.IWarehouseWaybillClient; +import com.logpm.patch.vo.*; +import com.logpm.warehouse.feign.IWarehouseUpdownTypeClient; 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.springblade.common.constant.broadcast.FanoutConstants; +import org.springblade.common.model.FanoutMsg; import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Component; import java.util.*; +import java.util.stream.Collectors; @Slf4j @AllArgsConstructor @@ -28,7 +33,8 @@ public class SyncWarehouseData { private final IBasicdataGoodsAllocationClient basicdataGoodsAllocationClient;//货位 private final IBasicdataTrayClient basicdataTrayClient;//托盘 - private final IWarehouseWaybillClient warehouseWaybillClient; + private final ISendFanoutService sendFanoutMsg; + private final IWarehouseUpdownTypeClient warehouseUpdownTypeClient; //-----------------老系统 private final IWarehouseClient warehouseClient;//仓库 @@ -377,4 +383,270 @@ public class SyncWarehouseData { return true; } + + @XxlJob("syncAllTrayAndAllocation") + public ReturnT syncAllTrayAndAllocation(String param) { + log.info("############syncAllTrayAndAllocation: 处理所有包件零担库存品的托盘库位信息 开始 param={}", param); + + //需要下架解托的包件Map + Map> delTrayAndAllocationPackageMap = new HashMap<>(); + + + //托盘信息 + //包件 + List packageTrayList = warehouseMappingDataService.findPackageTraysInfo(); + //把packageTrayList中所有元素根据orderPackageStatus进行分组 + Map> packageTrayMap = packageTrayList.stream().collect(Collectors.groupingBy(PackageTrayInfoVO::getOrderPackageStatus)); + packageTrayMap.keySet().forEach(orderPackageStatus -> { + List packageTrayInfoVOS = packageTrayMap.get(orderPackageStatus); + if(!packageTrayInfoVOS.isEmpty()){ + if("60".equals(orderPackageStatus) || "70".equals(orderPackageStatus)){ + //把packageTrayInfoVOS通过warehouseId进行分组,来分仓处理下架解托的包件 + Map> packageTrayInfoVOSMap = packageTrayInfoVOS.stream().collect(Collectors.groupingBy(PackageTrayInfoVO::getWarehouseId)); + packageTrayInfoVOSMap.keySet().forEach(warehouseId -> { + List packageTrayInfoVOS1 = packageTrayInfoVOSMap.get(warehouseId); + if(!packageTrayInfoVOS1.isEmpty()){ + //把packageTrayInfoVOS1中的orderPackageCode放入一个List + List orderPackageCodeList = packageTrayInfoVOS1.stream().map(PackageTrayInfoVO::getOrderPackageCode).collect(Collectors.toList()); + List list = delTrayAndAllocationPackageMap.get(warehouseId); + if(list.isEmpty()){ + delTrayAndAllocationPackageMap.put(warehouseId,orderPackageCodeList); + }else{ + list.addAll(orderPackageCodeList); + delTrayAndAllocationPackageMap.put(warehouseId,list); + } + } + }); + }else{ + //如果不是签收或者出库的包件 + //把packageTrayInfoVOS通过conditions进行分组 + Map> packageTrayInfoVOSMap = packageTrayInfoVOS.stream().collect(Collectors.groupingBy(PackageTrayInfoVO::getConditions)); + packageTrayInfoVOSMap.keySet().forEach(conditions -> { + List packageTrayInfoVOS1 = packageTrayInfoVOSMap.get(conditions); + if(!packageTrayInfoVOS1.isEmpty()){ + + //把packageTrayInfoVOS1中所有元素的warehouseId进行分组 + Map> packageTrayInfoVOSMap1 = packageTrayInfoVOS1.stream().collect(Collectors.groupingBy(PackageTrayInfoVO::getWarehouseId)); + packageTrayInfoVOSMap1.keySet().forEach(warehouseId -> { + List packageTrayInfoVOS2 = packageTrayInfoVOSMap1.get(warehouseId); + if(!packageTrayInfoVOS2.isEmpty()){ + //把packageTrayInfoVOS2中所有元素根据trayName进行分组 + Map> packageTrayInfoVOSMap2 = packageTrayInfoVOS2.stream().collect(Collectors.groupingBy(PackageTrayInfoVO::getTrayName)); + packageTrayInfoVOSMap2.keySet().forEach(trayName -> { + List packageTrayInfoVOS3 = packageTrayInfoVOSMap2.get(trayName); + if(!packageTrayInfoVOS3.isEmpty()){ + //订制品 + JSONObject jsonObject = new JSONObject(); + jsonObject.set("dataType",1); + jsonObject.set("operation",1); + jsonObject.set("conditions",conditions); + List orderPackageCodes = packageTrayInfoVOS3.stream().map(PackageTrayInfoVO::getOrderPackageCode).collect(Collectors.toList()); + jsonObject.set("orderPackageCodes",orderPackageCodes); + jsonObject.set("warehouseId",warehouseId); + jsonObject.set("trayName",trayName); + FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.TRAYTYPE.EXCHANGE).msg(jsonObject.toString()).build(); + sendFanoutMsg.sendFanoutMsg(fanoutMsg); + } + }); + + } + }); + } + }); + + } + } + }); + + //零担 + List zeroTrayList = warehouseMappingDataService.findZeroTraysInfo(); + //把zeroTrayList通过warehouseId进行分组 + Map> zeroTrayMap = zeroTrayList.stream().collect(Collectors.groupingBy(ZeroTrayInfoVO::getWarehouseId)); + zeroTrayMap.keySet().forEach(warehouseId -> { + List zeroTrayInfoVOS = zeroTrayMap.get(warehouseId); + if(!zeroTrayInfoVOS.isEmpty()){ + //把zeroTrayInfoVOS通过trayName进行分组 + Map> zeroTrayInfoVOSMap = zeroTrayInfoVOS.stream().collect(Collectors.groupingBy(ZeroTrayInfoVO::getTrayName)); + zeroTrayInfoVOSMap.keySet().forEach(trayName -> { + List zeroTrayInfoVOS1 = zeroTrayInfoVOSMap.get(trayName); + if(!zeroTrayInfoVOS1.isEmpty()){ + //把zeroTrayInfoVOS1中所有元素的orderCode放入一个List + List orderCodes = zeroTrayInfoVOS1.stream().map(ZeroTrayInfoVO::getOrderCode).collect(Collectors.toList()); + //订制品 + JSONObject jsonObject = new JSONObject(); + jsonObject.set("dataType",2); + jsonObject.set("operation",1); + jsonObject.set("orderCodes",orderCodes); + jsonObject.set("warehouseId",warehouseId); + jsonObject.set("trayName",trayName); + FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.TRAYTYPE.EXCHANGE).msg(jsonObject.toString()).build(); + sendFanoutMsg.sendFanoutMsg(fanoutMsg); + } + }); + } + }); + + + //无数据库存品 + List stockTrayList = warehouseMappingDataService.findStockTraysInfo(); + //把stockTrayList通过warehouseId分组 + Map> stockTrayMap = stockTrayList.stream().collect(Collectors.groupingBy(StockTrayInfoVO::getWarehouseId)); + stockTrayMap.keySet().forEach(warehouseId -> { + List stockTrayInfoVOS = stockTrayMap.get(warehouseId); + if(!stockTrayInfoVOS.isEmpty()){ + //把stockTrayInfoVOS通过trayName进行分组 + Map> stockTrayInfoVOSMap = stockTrayInfoVOS.stream().collect(Collectors.groupingBy(StockTrayInfoVO::getTrayName)); + stockTrayInfoVOSMap.keySet().forEach(trayName -> { + List stockTrayInfoVOS1 =stockTrayInfoVOSMap.get(trayName); + if(!stockTrayInfoVOS1.isEmpty()){ + //把stockTrayInfoVOS1中所有元素的stockListId放入一个List + JSONObject jsonObject = new JSONObject(); + jsonObject.set("dataType",3); + jsonObject.set("operation",1); + List stockListIds = stockTrayInfoVOS1.stream().map(StockTrayInfoVO::getStockListId).collect(Collectors.toList()); + jsonObject.set("stockListIds",stockListIds); + jsonObject.set("warehouseId",warehouseId); + jsonObject.set("trayName",trayName); + FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.TRAYTYPE.EXCHANGE).msg(jsonObject.toString()).build(); + sendFanoutMsg.sendFanoutMsg(fanoutMsg); + } + }); + } + }); + + //库位 + //包件 + List packageAllocationData = warehouseMappingDataService.findPackageAllocationData(); + //把packageTrayList中所有元素根据orderPackageStatus进行分组 + Map> packageAllocationMap = packageAllocationData.stream().collect(Collectors.groupingBy(PackageAllocationInfoVO::getOrderPackageStatus)); + packageAllocationMap.keySet().forEach(orderPackageStatus -> { + List packageAllocationInfoVOS = packageAllocationMap.get(orderPackageStatus); + if(!packageAllocationInfoVOS.isEmpty()){ + if("60".equals(orderPackageStatus) || "70".equals(orderPackageStatus)){ + //把packageTrayInfoVOS通过warehouseId进行分组,来分仓处理下架解托的包件 + Map> packageAllocationInfoVOSMap = packageAllocationInfoVOS.stream().collect(Collectors.groupingBy(PackageAllocationInfoVO::getWarehouseId)); + packageAllocationInfoVOSMap.keySet().forEach(warehouseId -> { + List packageAllocationInfoVOS1 = packageAllocationInfoVOSMap.get(warehouseId); + if(!packageAllocationInfoVOS1.isEmpty()){ + //把packageTrayInfoVOS1中的orderPackageCode放入一个List + List orderPackageCodeList = packageAllocationInfoVOS1.stream().map(PackageAllocationInfoVO::getOrderPackageCode).collect(Collectors.toList()); + List list = delTrayAndAllocationPackageMap.get(warehouseId); + if(list.isEmpty()){ + delTrayAndAllocationPackageMap.put(warehouseId,orderPackageCodeList); + }else{ + list.addAll(orderPackageCodeList); + delTrayAndAllocationPackageMap.put(warehouseId,list); + } + } + }); + }else{ + //如果不是签收或者出库的包件 + //把packageTrayInfoVOS通过conditions进行分组 + Map> packageAllocationInfoVOSMap = packageAllocationInfoVOS.stream().collect(Collectors.groupingBy(PackageAllocationInfoVO::getConditions)); + packageAllocationInfoVOSMap.keySet().forEach(conditions -> { + List packageAllocationInfoVOS1 = packageAllocationInfoVOSMap.get(conditions); + if(!packageAllocationInfoVOS1.isEmpty()){ + + //把packageTrayInfoVOS1中所有元素的warehouseId进行分组 + Map> packageAllocationInfoVOSMap1 = packageAllocationInfoVOS1.stream().collect(Collectors.groupingBy(PackageAllocationInfoVO::getWarehouseId)); + packageAllocationInfoVOSMap1.keySet().forEach(warehouseId -> { + List packageAllocationInfoVOS2 = packageAllocationInfoVOSMap1.get(warehouseId); + if(!packageAllocationInfoVOS2.isEmpty()){ + //把packageTrayInfoVOS2中所有元素根据trayName进行分组 + Map> packageAllocationInfoVOSMap2 = packageAllocationInfoVOS2.stream().collect(Collectors.groupingBy(PackageAllocationInfoVO::getAllocationName)); + packageAllocationInfoVOSMap2.keySet().forEach(allocationName -> { + List packageAllocationInfoVOS3 = packageAllocationInfoVOSMap2.get(allocationName); + if(!packageAllocationInfoVOS3.isEmpty()){ + //订制品 + JSONObject jsonObject = new JSONObject(); + jsonObject.set("dataType",1); + jsonObject.set("operation",3); + jsonObject.set("conditions",conditions); + List orderPackageCodes = packageAllocationInfoVOS3.stream().map(PackageAllocationInfoVO::getOrderPackageCode).collect(Collectors.toList()); + jsonObject.set("orderPackageCodes",orderPackageCodes); + jsonObject.set("warehouseId",warehouseId); + jsonObject.set("allocationName",allocationName); + FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toString()).build(); + sendFanoutMsg.sendFanoutMsg(fanoutMsg); + } + }); + } + }); + } + }); + + } + } + }); + + //零担 + List zeroAllocationList = warehouseMappingDataService.findZeroAllocationInfo(); + //把zeroTrayList通过warehouseId进行分组 + Map> zeroAllocationMap = zeroAllocationList.stream().collect(Collectors.groupingBy(ZeroAllocationInfoVO::getWarehouseId)); + zeroAllocationMap.keySet().forEach(warehouseId -> { + List zeroAllocationInfoVOS = zeroAllocationMap.get(warehouseId); + if(!zeroAllocationInfoVOS.isEmpty()){ + //把zeroTrayInfoVOS通过trayName进行分组 + Map> zeroAllocationInfoVOSMap = zeroAllocationInfoVOS.stream().collect(Collectors.groupingBy(ZeroAllocationInfoVO::getAllocationName)); + zeroAllocationInfoVOSMap.keySet().forEach(allocationName -> { + List zeroAllocationInfoVOS1 = zeroAllocationInfoVOSMap.get(allocationName); + if(!zeroAllocationInfoVOS1.isEmpty()){ + //把zeroTrayInfoVOS1中所有元素的orderCode放入一个List + List orderCodes = zeroAllocationInfoVOS1.stream().map(ZeroAllocationInfoVO::getOrderCode).collect(Collectors.toList()); + //订制品 + JSONObject jsonObject = new JSONObject(); + jsonObject.set("dataType",2); + jsonObject.set("operation",3); + jsonObject.set("orderCodes",orderCodes); + jsonObject.set("warehouseId",warehouseId); + jsonObject.set("allocationName",allocationName); + FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toString()).build(); + sendFanoutMsg.sendFanoutMsg(fanoutMsg); + } + }); + } + }); + + + //无数据库存品 + List stockAllocationList = warehouseMappingDataService.findStockAllocationInfo(); + //把stockTrayList通过warehouseId分组 + Map> stockAllocationMap = stockAllocationList.stream().collect(Collectors.groupingBy(StockAllocationInfoVO::getWarehouseId)); + stockAllocationMap.keySet().forEach(warehouseId -> { + List stockAllocationInfoVOS = stockAllocationMap.get(warehouseId); + if(!stockAllocationInfoVOS.isEmpty()){ + //把stockTrayInfoVOS通过trayName进行分组 + Map> stockAllocationInfoVOSMap = stockAllocationInfoVOS.stream().collect(Collectors.groupingBy(StockAllocationInfoVO::getAllocationName)); + stockAllocationInfoVOSMap.keySet().forEach(allocationName -> { + List stockAllocationInfoVOS1 =stockAllocationInfoVOSMap.get(allocationName); + if(!stockAllocationInfoVOS1.isEmpty()){ + //把stockTrayInfoVOS1中所有元素的stockListId放入一个List + JSONObject jsonObject = new JSONObject(); + jsonObject.set("dataType",3); + jsonObject.set("operation",3); + List stockListIds = stockAllocationInfoVOS1.stream().map(StockAllocationInfoVO::getStockListId).collect(Collectors.toList()); + jsonObject.set("stockListIds",stockListIds); + jsonObject.set("warehouseId",warehouseId); + jsonObject.set("allocationName",allocationName); + FanoutMsg fanoutMsg = FanoutMsg.builder().exchange(FanoutConstants.warehouse.ALLOCATION.EXCHANGE).msg(jsonObject.toString()).build(); + sendFanoutMsg.sendFanoutMsg(fanoutMsg); + } + }); + } + }); + + delTrayAndAllocationPackageMap.keySet().forEach(warehouseId -> { + List list = delTrayAndAllocationPackageMap.get(warehouseId); + if(!list.isEmpty()){ + Set orderPackageCodes = new HashSet<>(list); + warehouseUpdownTypeClient.downPackageOrDelTray(StringUtil.join(orderPackageCodes,","),warehouseId,"系统因为签收或者出库下架解托"); + } + }); + + + log.info("############syncAllTrayAndAllocation: 处理所有包件零担库存品的托盘库位信息 结束"); + return ReturnT.SUCCESS; + } + + } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java index 64bbae5be..4d217c5cc 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.java @@ -2,7 +2,7 @@ package com.logpm.patch.mapper; import cn.hutool.json.JSONObject; import com.logpm.patch.entity.WarehouseMappingDataEntity; -import com.logpm.patch.vo.SyncZeroOrderVO; +import com.logpm.patch.vo.*; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -109,5 +109,18 @@ public interface WarehouseMappingDataMapper { Integer findTrayTypeNum(@Param("trayCode") String trayCode); void updateTrayTypeNum(@Param("num") Integer num, @Param("aLong") Long aLong); + + List findPackageTraysInfo(); + + List findZeroTraysInfo(); + + List findStockTraysInfo(); + + List findPackageAllocationData(); + + List findZeroAllocationInfo(); + + List findStockAllocationInfo(); + } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml index 305e7657e..abcd68b6a 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/mapper/WarehouseMappingDataMapper.xml @@ -349,4 +349,66 @@ where id = #{aLong} + + + + + + + + + + + + diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISendFanoutService.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISendFanoutService.java new file mode 100644 index 000000000..f6bf478f7 --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/ISendFanoutService.java @@ -0,0 +1,7 @@ +package com.logpm.patch.service; + +import org.springblade.common.model.FanoutMsg; + +public interface ISendFanoutService { + void sendFanoutMsg(FanoutMsg fanoutMsg); +} diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java index 73c0d9fbe..390d86299 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/IWarehouseMappingDataService.java @@ -2,7 +2,7 @@ package com.logpm.patch.service; import cn.hutool.json.JSONObject; import com.logpm.patch.entity.WarehouseMappingDataEntity; -import com.logpm.patch.vo.SyncZeroOrderVO; +import com.logpm.patch.vo.*; import java.util.List; @@ -100,4 +100,16 @@ public interface IWarehouseMappingDataService { void updateTrayTypeNum(Integer num, Long aLong); + List findPackageTraysInfo(); + + List findZeroTraysInfo(); + + List findStockTraysInfo(); + + List findPackageAllocationData(); + + List findZeroAllocationInfo(); + + List findStockAllocationInfo(); + } diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SendFanoutServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SendFanoutServiceImpl.java new file mode 100644 index 000000000..4488ac910 --- /dev/null +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/SendFanoutServiceImpl.java @@ -0,0 +1,24 @@ +package com.logpm.patch.service.impl; + +import com.logpm.patch.service.ISendFanoutService; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.springblade.common.model.FanoutMsg; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.stereotype.Service; + +@Service +@AllArgsConstructor +@Slf4j +public class SendFanoutServiceImpl implements ISendFanoutService { + + private final RabbitTemplate rabbitTemplate; + +// @Retryable(value = Exception.class, maxAttempts = 3, backoff = @Backoff(value = 3000, multiplier = 1.5)) + @Override + public void sendFanoutMsg(FanoutMsg fanoutMsg) { + + rabbitTemplate.convertAndSend(fanoutMsg.getExchange(),null, fanoutMsg.getMsg()); + + } +} diff --git a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java index ed1b2b224..8fe26b650 100644 --- a/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java +++ b/blade-service/logpm-patch/src/main/java/com/logpm/patch/service/impl/WarehouseMappingDataServiceImpl.java @@ -4,7 +4,7 @@ import cn.hutool.json.JSONObject; import com.logpm.patch.entity.WarehouseMappingDataEntity; import com.logpm.patch.mapper.WarehouseMappingDataMapper; import com.logpm.patch.service.IWarehouseMappingDataService; -import com.logpm.patch.vo.SyncZeroOrderVO; +import com.logpm.patch.vo.*; import lombok.AllArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; @@ -235,4 +235,34 @@ public class WarehouseMappingDataServiceImpl implements IWarehouseMappingDataSer public void updateTrayTypeNum(Integer num, Long aLong) { warehouseMappingDataMapper.updateTrayTypeNum(num,aLong); } + + @Override + public List findPackageTraysInfo() { + return warehouseMappingDataMapper.findPackageTraysInfo(); + } + + @Override + public List findZeroTraysInfo() { + return warehouseMappingDataMapper.findZeroTraysInfo(); + } + + @Override + public List findStockTraysInfo() { + return warehouseMappingDataMapper.findStockTraysInfo(); + } + + @Override + public List findPackageAllocationData() { + return warehouseMappingDataMapper.findPackageAllocationData(); + } + + @Override + public List findZeroAllocationInfo() { + return warehouseMappingDataMapper.findZeroAllocationInfo(); + } + + @Override + public List findStockAllocationInfo() { + return warehouseMappingDataMapper.findStockAllocationInfo(); + } } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml index c05723bbb..bb33832da 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mapper/TrunklineCarsLoadMapper.xml @@ -84,6 +84,7 @@ ltcl.arrive_time arriveTime, ltcl.start_time startTime, ltcl.create_user_name createUserName, + ltcl.operator operator, ltcl.create_time createTime, ltcl.now_warehouse_id nowWarehouseId, sum(ltcll.now_transport_cost) nowTransportCost, diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java index 5b106c18b..8bf44e626 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/mq/OpenOrderToLoadListener.java @@ -100,6 +100,7 @@ public class OpenOrderToLoadListener { trunklineCarsOrderEntity.setNodeName(warehouseName); trunklineCarsOrderEntity.setLoadLineId(carsLoadLineEntity.getId()); trunklineCarsOrderEntity.setOrderCode(orderCode); + trunklineCarsOrderEntity.setWaybillId(waybillId); trunklineCarsOrderEntity.setWaybillNo(waybillNo); // Integer totalNum = waybillOrderService.findTotalNumByWaybillNoAndOrderCode(waybillId,orderCode); trunklineCarsOrderEntity.setTotalNum(advanceEntity.getTotalNum()); 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 6e5bb7afd..3d3fcd061 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 @@ -3713,6 +3713,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService { Long waybillId = waybillEntity.getId(); + Long newBrandId = openOrderDTO.getBrandId(); + String newBrand = openOrderDTO.getBrand(); + Long brandId = waybillEntity.getBrandId(); + String brand = waybillEntity.getBrand(); + if(!ObjectUtil.equals(newBrandId,brandId)){ + stringBuilder.append("品牌:").append(brand).append("-->").append(newBrand).append(";"); + waybillEntity.setBrandId(newBrandId); + waybillEntity.setBrand(newBrand); + } + String newDeparture = openOrderDTO.getDeparture(); String departure = waybillEntity.getDeparture(); if(!ObjectUtil.equals(newDeparture,departure)){ 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 4e83d5653..f49cbe8b2 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 @@ -160,24 +160,24 @@ public class TrunklineAdvanceDetailServiceImpl extends BaseServiceImpl