From 9f42122de5340421073d2c344c6317cff930f5e7 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sat, 11 May 2024 13:53:23 +0800 Subject: [PATCH 01/10] =?UTF-8?q?1.=E5=AF=BC=E5=85=A5=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E6=95=B0=E9=87=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/OpenOrderServiceImpl.java | 24 +++++++++++-------- 1 file changed, 14 insertions(+), 10 deletions(-) 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 2c8e111aa..0d8df1cb4 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 @@ -1097,11 +1097,11 @@ public class OpenOrderServiceImpl implements IOpenOrderService { List hasOrderPackageCodeList = new ArrayList<>(); //把orderPackageCodeKeys每2000个元素为一组 - int batchSize = 2000; + int packageBatchSize = 1000; List> orderPackageCodeGroups = new ArrayList<>(); - for (int i = 0; i < orderPackageCodeKeys.size(); i += batchSize) { - int endIndex = Math.min(i + batchSize, orderPackageCodeKeys.size()); + for (int i = 0; i < orderPackageCodeKeys.size(); i += packageBatchSize) { + int endIndex = Math.min(i + packageBatchSize, orderPackageCodeKeys.size()); orderPackageCodeGroups.add(orderPackageCodeKeys.subList(i, endIndex)); } @@ -1141,6 +1141,8 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //把orderCodeList分成每2000个元素一组 List> orderedGroups = new ArrayList<>(); + + int batchSize = 1000; for (int i = 0; i < orderCodeList.size(); i += batchSize) { int endIndex = Math.min(i + batchSize, orderCodeList.size()); orderedGroups.add(orderCodeList.subList(i, endIndex)); @@ -1411,11 +1413,11 @@ public class OpenOrderServiceImpl implements IOpenOrderService { List hasOrderPackageCodeList = new ArrayList<>(); //把orderPackageCodeKeys每2000个元素为一组 - int batchSize = 2000; + int packageBatchSize = 1000; List> orderPackageCodeGroups = new ArrayList<>(); - for (int i = 0; i < orderPackageCodeKeys.size(); i += batchSize) { - int endIndex = Math.min(i + batchSize, orderPackageCodeKeys.size()); + for (int i = 0; i < orderPackageCodeKeys.size(); i += packageBatchSize) { + int endIndex = Math.min(i + packageBatchSize, orderPackageCodeKeys.size()); orderPackageCodeGroups.add(orderPackageCodeKeys.subList(i, endIndex)); } @@ -1447,6 +1449,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //把orderCodeList分成每2000个元素一组 List> orderedGroups = new ArrayList<>(); + int batchSize = 1000; for (int i = 0; i < orderCodeList.size(); i += batchSize) { int endIndex = Math.min(i + batchSize, orderCodeList.size()); orderedGroups.add(orderCodeList.subList(i, endIndex)); @@ -1672,11 +1675,11 @@ public class OpenOrderServiceImpl implements IOpenOrderService { List hasOrderPackageCodeList = new ArrayList<>(); //把orderPackageCodeKeys每2000个元素为一组 - int batchSize = 2000; + int packageBatchSize = 1000; List> orderPackageCodeGroups = new ArrayList<>(); - for (int i = 0; i < orderPackageCodeKeys.size(); i += batchSize) { - int endIndex = Math.min(i + batchSize, orderPackageCodeKeys.size()); + for (int i = 0; i < orderPackageCodeKeys.size(); i += packageBatchSize) { + int endIndex = Math.min(i + packageBatchSize, orderPackageCodeKeys.size()); orderPackageCodeGroups.add(orderPackageCodeKeys.subList(i, endIndex)); } @@ -1714,6 +1717,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //把orderCodeList分成每2000个元素一组 List> orderedGroups = new ArrayList<>(); + int batchSize = 1000; for (int i = 0; i < orderCodeList.size(); i += batchSize) { int endIndex = Math.min(i + batchSize, orderCodeList.size()); orderedGroups.add(orderCodeList.subList(i, endIndex)); @@ -2247,7 +2251,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //把orderCodes转成List List orderCodeList = new ArrayList<>(orderCodes); //把orderCodeList分成每2000个元素一组 - int batchSize = 2000; + int batchSize = 1000; List> orderedGroups = new ArrayList<>(); for (int i = 0; i < orderCodeList.size(); i += batchSize) { From de9ca230ffe80f84ea920409ff82971244cc8a95 Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sat, 11 May 2024 14:58:25 +0800 Subject: [PATCH 02/10] =?UTF-8?q?1.=E5=AF=BC=E5=85=A5=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=AE=A2=E5=8D=95bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trunkline/service/IAsyncService.java | 2 + .../service/impl/AsyncServiceImpl.java | 10 ++- .../service/impl/OpenOrderServiceImpl.java | 72 ++++++++++++++++++- 3 files changed, 80 insertions(+), 4 deletions(-) diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java index 6e07875d5..00f01fade 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/IAsyncService.java @@ -11,4 +11,6 @@ public interface IAsyncService { CompletableFuture getResponseFromCp(List list, int queryType); CompletableFuture saveAdvanceEntity(List list, int queryType); + + CompletableFuture updateAdvanceEntity(List list, int queryType); } diff --git a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java index e9d916f24..a88f53a8f 100644 --- a/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java +++ b/blade-service/logpm-trunkline/src/main/java/com/logpm/trunkline/service/impl/AsyncServiceImpl.java @@ -7,7 +7,6 @@ import com.logpm.trunkline.service.ITrunklineAdvanceDetailService; import com.logpm.trunkline.service.ITrunklineAdvanceService; import org.springblade.common.annotations.LogpmAsync; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import java.util.List; @@ -39,4 +38,13 @@ public class AsyncServiceImpl implements IAsyncService { ); } + @LogpmAsync("asyncExecutor") + @Override + public CompletableFuture updateAdvanceEntity(List list, int queryType) { + return CompletableFuture + .completedFuture( + advanceService.updateBatchById(list) + ); + } + } 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 0d8df1cb4..e3bfd4c6f 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 @@ -1162,6 +1162,8 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceEntityMap.put(key,advanceEntity); }); + List updateAdvanceEntityList = new ArrayList<>(); + listMap.keySet().forEach(str -> { List excelDTOS = listMap.get(str); PacakgeDetailExcelDTO pacakgeDetailExcelDTO = excelDTOS.get(0); @@ -1219,14 +1221,16 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceEntity.setCreateUserName(AuthUtil.getNickName()); advanceEntityList.add(advanceEntity); } else { + advanceEntity.setTotalNum(advanceEntity.getTotalNum() + excelDTOS.size()); + updateAdvanceEntityList.add(advanceEntity); advanceIds.add(advanceEntity.getId()); advanceEntityMap.put(advanceEntity.getOrderCode()+"&"+(StringUtil.isBlank(trainNumber)?"null":trainNumber),advanceEntity); } }); if (!advanceEntityList.isEmpty()) { - //把advanceDetailEntities分成相等数量的10个集合 - List> advanceEntitiesList = advanceEntityList.stream().collect(Collectors.groupingBy(item -> advanceDetailEntities.indexOf(item) / 1000)).entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList()); + //把advanceEntityList每1000个元素分组 + List> advanceEntitiesList = advanceEntityList.stream().collect(Collectors.groupingBy(item -> advanceEntityList.indexOf(item) / 1000)).entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList()); List comlist = new ArrayList<>(); for (int i = 0; i < advanceEntitiesList.size(); i++) { List list = advanceEntitiesList.get(i); @@ -1237,6 +1241,21 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } + if (!updateAdvanceEntityList.isEmpty()) { + //把advanceDetailEntities分成相等数量的10个集合 + List> advanceEntitiesList = updateAdvanceEntityList.stream().collect(Collectors.groupingBy(item -> updateAdvanceEntityList.indexOf(item) / 1000)).entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList()); + List comlist = new ArrayList<>(); + for (int i = 0; i < advanceEntitiesList.size(); i++) { + List list = advanceEntitiesList.get(i); + CompletableFuture fromCpFirstReq = asyncService.updateAdvanceEntity(list, i+1); + comlist.add(fromCpFirstReq); + } + CompletableFuture.allOf(comlist.toArray(new CompletableFuture[0])).join(); + + } + + + advanceEntityList.forEach(advanceEntity -> { advanceIds.add(advanceEntity.getId()); String trainNumber = advanceEntity.getTrainNumber(); @@ -1430,6 +1449,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { importCustomizedOuPaiDTOS = importCustomizedOuPaiDTOS.stream().filter(item -> !hasOrderPackageCodeList.contains(item.getOrderPackageCode())).collect(Collectors.toList()); List advanceEntityList = new ArrayList<>(); + List updateAdvanceEntityList = new ArrayList<>(); if(importCustomizedOuPaiDTOS.isEmpty()){ log.warn("##################importCustomizedOuPai: 没有需要处理的数据 importCustomizedOuPaiDTOS={}",importCustomizedOuPaiDTOS); @@ -1528,6 +1548,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceEntity.setHasPackage(1); advanceEntityList.add(advanceEntity); } else { + advanceEntity.setTotalNum(advanceEntity.getTotalNum() + excelDTOS.size()); + + updateAdvanceEntityList.add(advanceEntity); advanceIds.add(advanceEntity.getId()); String trainNumber = advanceEntity.getTrainNumber(); advanceEntityMap.put(advanceEntity.getOrderCode()+"&"+(StringUtil.isBlank(trainNumber)?"null":trainNumber),advanceEntity); @@ -1536,7 +1559,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { if (!advanceEntityList.isEmpty()) { //把advanceDetailEntities分成相等数量的10个集合 - List> advanceEntitiesList = advanceEntityList.stream().collect(Collectors.groupingBy(item -> advanceDetailEntities.indexOf(item) / 1000)).entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList()); + List> advanceEntitiesList = advanceEntityList.stream().collect(Collectors.groupingBy(item -> advanceEntityList.indexOf(item) / 1000)).entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList()); List comlist = new ArrayList<>(); for (int i = 0; i < advanceEntitiesList.size(); i++) { List list = advanceEntitiesList.get(i); @@ -1547,6 +1570,20 @@ public class OpenOrderServiceImpl implements IOpenOrderService { } + if (!updateAdvanceEntityList.isEmpty()) { + //把advanceDetailEntities分成相等数量的10个集合 + List> advanceEntitiesList = updateAdvanceEntityList.stream().collect(Collectors.groupingBy(item -> updateAdvanceEntityList.indexOf(item) / 1000)).entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList()); + List comlist = new ArrayList<>(); + for (int i = 0; i < advanceEntitiesList.size(); i++) { + List list = advanceEntitiesList.get(i); + CompletableFuture fromCpFirstReq = asyncService.updateAdvanceEntity(list, i+1); + comlist.add(fromCpFirstReq); + } + CompletableFuture.allOf(comlist.toArray(new CompletableFuture[0])).join(); + + } + + advanceEntityList.forEach(advanceEntity -> { advanceIds.add(advanceEntity.getId()); String trainNumber = advanceEntity.getTrainNumber(); @@ -1692,6 +1729,7 @@ public class OpenOrderServiceImpl implements IOpenOrderService { importStandardOuPaiDTOS = importStandardOuPaiDTOS.stream().filter(item -> !hasOrderPackageCodeList.contains(item.getOrderPackageCode())).collect(Collectors.toList()); List advanceEntityList = new ArrayList<>(); + List updateAdvanceEntityList = new ArrayList<>(); if(importStandardOuPaiDTOS.isEmpty()){ log.warn("##################importStandardOuPai: 没有需要处理的数据 importStandardOuPaiDTOS={}",importStandardOuPaiDTOS); @@ -1785,6 +1823,9 @@ public class OpenOrderServiceImpl implements IOpenOrderService { advanceEntity.setHasPackage(1); advanceEntityList.add(advanceEntity); } else { + advanceEntity.setTotalNum(advanceEntity.getTotalNum()+excelDTOS.size()); + + updateAdvanceEntityList.add(advanceEntity); advanceIds.add(advanceEntity.getId()); String trainNumber = advanceEntity.getTrainNumber(); advanceEntityMap.put(advanceEntity.getOrderCode()+"&"+(StringUtil.isBlank(trainNumber)?"null":trainNumber),advanceEntity); @@ -1800,6 +1841,18 @@ public class OpenOrderServiceImpl implements IOpenOrderService { comlist.add(fromCpFirstReq); } CompletableFuture.allOf(comlist.toArray(new CompletableFuture[0])).join(); + } + + if (!updateAdvanceEntityList.isEmpty()) { + //把advanceDetailEntities分成相等数量的10个集合 + List> advanceEntitiesList = updateAdvanceEntityList.stream().collect(Collectors.groupingBy(item -> updateAdvanceEntityList.indexOf(item) / 1000)).entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toList()); + List comlist = new ArrayList<>(); + for (int i = 0; i < advanceEntitiesList.size(); i++) { + List list = advanceEntitiesList.get(i); + CompletableFuture fromCpFirstReq = asyncService.updateAdvanceEntity(list, i+1); + comlist.add(fromCpFirstReq); + } + CompletableFuture.allOf(comlist.toArray(new CompletableFuture[0])).join(); } @@ -2241,6 +2294,19 @@ public class OpenOrderServiceImpl implements IOpenOrderService { //把importOrderNoPackageExcelDTOS中的orderCode存入一个set集合 Set orderCodes = importOrderNoPackageExcelDTOS.parallelStream().map(ImportOrderNoPackageExcelDTO::getOrderCode).collect(Collectors.toSet()); + Map orderCodeCounts = importOrderNoPackageExcelDTOS.stream() + .collect(Collectors.groupingBy(a -> a.getOrderCode() + "&" + a.getTrainNumber(), Collectors.counting())); + + Set duplicateOrderCodes = orderCodeCounts.entrySet().stream() + .filter(entry -> entry.getValue() > 1) + .map(Map.Entry::getKey) + .collect(Collectors.toSet()); + + if(!duplicateOrderCodes.isEmpty()){ + log.warn("#####################openLabelHasPacakage: 订单重复 {}",duplicateOrderCodes); + return R.fail(405, "包条码重复"+duplicateOrderCodes); + } + //把importOrderNoPackageExcelDTOS的每个元素提取成一个key为orderCode和trainNumber的拼接,value为元素本身的map Map importOrderNoPackageExcelDTOMap = importOrderNoPackageExcelDTOS.parallelStream().collect(Collectors.toMap(a -> a.getOrderCode() + "&" + a.getTrainNumber(), a -> a)); From 03a83653274e948ff1f4f42c78bcc41ca17f92db Mon Sep 17 00:00:00 2001 From: zhenghaoyu Date: Sat, 11 May 2024 15:42:03 +0800 Subject: [PATCH 03/10] =?UTF-8?q?1.=E5=AF=BC=E5=85=A5=E6=89=B9=E9=87=8F?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=AE=A2=E5=8D=95bug=E4=BF=AE=E5=A4=8D=202.?= =?UTF-8?q?=E8=80=81=E7=B3=BB=E7=BB=9F=E5=8C=85=E4=BB=B6=E6=89=AB=E7=A0=81?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E9=80=BB=E8=BE=91=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/FactoryCommonServiceImpl.java | 2 +- .../receiver/OpReceivingDataHandler.java | 2 +- .../pan/service/IPanFactoryDataService.java | 2 +- .../impl/PanFactoryDataServiceImpl.java | 20 ++++++++++--------- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java index bb98e847e..cb7a207a7 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/comfac/service/impl/FactoryCommonServiceImpl.java @@ -153,7 +153,7 @@ public class FactoryCommonServiceImpl implements IFactoryCommonService { try { if ("1".equals(status) || "4".equals(status)) { // 始发仓和目的仓入库 - panFactoryDataService.handleDataToPlatform(unitNo, operationTime); + panFactoryDataService.handleDataToPlatform(unitNo, operationTime,Integer.parseInt(currentWarehouseId)); } else { log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>> 错误的状态"); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java index 196b2057a..f509c2f46 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/oupai/receiver/OpReceivingDataHandler.java @@ -38,7 +38,7 @@ public class OpReceivingDataHandler { String receivingTime = object.getString("receivingTime"); //真正处理需要的数据 try { - panFactoryDataService.handleDataToPlatform(orderPackageCode, receivingTime); + panFactoryDataService.handleDataToPlatform(orderPackageCode, receivingTime,null); } catch (CustomerException e) { log.error("##################opReceivingDataHandler: 处理欧派收货数据到新系统,orderPackageCode:{},receivingTime:{},msg:{}", diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryDataService.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryDataService.java index a924c595a..f929a42d6 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryDataService.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/IPanFactoryDataService.java @@ -18,7 +18,7 @@ public interface IPanFactoryDataService { R hwyHandleStatusData(OrderStatusDTO orderStatusDTO); - void handleDataToPlatform(String unitNo,String operationTime); + void handleDataToPlatform(String unitNo,String operationTime,Integer oldWarehouseId); Long saveData(PanFactoryOrderDTO factoryOrderDTO); } diff --git a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java index dd9b57ea6..74da067c5 100644 --- a/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java +++ b/blade-service/logpm-factory/src/main/java/com/logpm/factory/pan/service/impl/PanFactoryDataServiceImpl.java @@ -23,7 +23,6 @@ import com.logpm.distribution.feign.IDistributionParcelListClient; import com.logpm.distribution.feign.IDistributionStockArticleClient; import com.logpm.factory.comfac.dto.OrderInfoDTO; import com.logpm.factory.comfac.dto.OrderStatusDTO; -import com.logpm.factory.comfac.service.IOrderStatusLogService; import com.logpm.factory.pan.dto.PanFactoryOrderDTO; import com.logpm.factory.pan.dto.PanPackageInfoDTO; import com.logpm.factory.pan.dto.PanPackageListDTO; @@ -455,11 +454,19 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { @Transactional(rollbackFor = Exception.class) @Override - public void handleDataToPlatform(String unitNo, String operationTime) { + public void handleDataToPlatform(String unitNo, String operationTime,Integer oldWarehouseId) { log.info("############handleDataToPlatform: 处理数据到platform unitNo={}", unitNo); + BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.getWarehouseByOldId(oldWarehouseId); + if(Objects.isNull(basicdataWarehouseEntity)){ + log.warn("############handleDataToPlatform: 仓库信息不存在 oldWarehouseId={}",oldWarehouseId); + throw new CustomerException(405, "仓库信息不存在"); + } + + Long warehouseId = basicdataWarehouseEntity.getId(); + //先查询包件是否已存入到新系统数据库 - List distributionParcelListEntity = distributionParcelListClient.findByPacketBarCode(unitNo); + DistributionParcelListEntity distributionParcelListEntity = distributionParcelListClient.findByPacketBarCodeAndWarehouseId(unitNo,warehouseId); if (ObjectUtils.isEmpty(distributionParcelListEntity)) { //未找到包件信息那就去新增 //1.根据包条码去老系统数据库找到对应的包条信息 @@ -501,12 +508,7 @@ public class PanFactoryDataServiceImpl implements IPanFactoryDataService { // Integer oldId = orderDetailEntity.getNowWarehouseId(); // 查询数据对应的仓库名称 - BasicdataWarehouseEntity basicdataWarehouseEntity = basicdataWarehouseClient.findByName(destinationWarehouse); - if(Objects.isNull(basicdataWarehouseEntity)){ - log.warn("############handleDataToPlatform: 仓库信息不存在 destinationWarehouse={}",destinationWarehouse); - throw new CustomerException(405, "仓库信息不存在"); - } - Long warehouseId = basicdataWarehouseEntity.getId(); + // OrderCountEntity orderCountEntity = orderCountClient.getEntityByOrderCode(orderSelfNum,oldId); // if(Objects.isNull(orderCountEntity)){ From 58d5c3b462259913a746d4083e783420883dbe94 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Sat, 11 May 2024 16:57:26 +0800 Subject: [PATCH 04/10] =?UTF-8?q?=E8=87=AA=E6=8F=90=E6=8E=A8=E9=80=81?= =?UTF-8?q?=E8=80=81=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../distribution/mapper/DistributionReservationMapper.java | 2 +- .../distribution/mapper/DistributionReservationMapper.xml | 1 + .../distribution/mapper/DistrilbutionBillLadingMapper.xml | 4 ++-- .../service/impl/DistributionReservationServiceImpl.java | 4 ++-- 4 files changed, 6 insertions(+), 5 deletions(-) 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 a1f3f5734..e8f25d816 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 @@ -70,7 +70,7 @@ public interface DistributionReservationMapper extends BaseMapper selectStockupOrderList(@Param("reservationId")Long reservationId,@Param("isZero") String isZero); List selectStockupStockList(@Param("reservationId")Long reservationId); - List selectStockupStockListNew(@Param("reservationId")Long reservationId,@Param("warehouseId")Long warehouseId,@Param("mallName")String mallName); + List selectStockupStockListNew(@Param("reservationId")Long reservationId,@Param("warehouseId")Long warehouseId,@Param("mallName")String mallName,@Param("cargoNumber")String cargoNumber); Integer selectOrderNumByReservationId(@Param("reservationId")Long reservationId); Integer selectPlanNum(@Param("reservationId")Long reservationId); 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 90c473006..3b41295ea 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 @@ -1038,6 +1038,7 @@ WHERE stock_list_status IN ( '1', '3' ) AND reservation_id = #{reservationId} + AND is_deleted = 0 SELECT ldbl.id, - ldbl.warehouse_id AS warehouseId, + lww.old_id AS warehouseId, lww.name AS warehouseName, 3 AS type, 3 AS finishState, @@ -843,7 +843,7 @@ SELECT lddl.id id, - lww.name AS warehouseName, + lww.NAME AS warehouseName, lddl.train_number trainNumber, lddl.warehouse_name warehouseName, lddl.warehouse_id warehouseId, @@ -330,29 +330,33 @@ lddl.distribution_company distributionCompany, lddl.delivery_status deliveryStatus, lddl.delivery_list_loading_status deliveryListLoadingStatus, - GROUP_CONCAT(y.order_code) AS orderCode, - CASE lddl.kind - WHEN 1 THEN '自主配送' - WHEN 2 THEN '三方配送' - ELSE - '其他' + GROUP_CONCAT( y.order_code ) AS orderCode, + CASE + lddl.kind + WHEN 1 THEN + '自主配送' + WHEN 2 THEN + '三方配送' ELSE '其他' END kind, - CASE lddl.type - WHEN 1 THEN '商配' - WHEN 2 THEN '市配' + CASE + lddl.type + WHEN 1 THEN + '商配' + WHEN 2 THEN + '市配' END type, - CASE lddl.delivery_status - WHEN 1 THEN '待配送' - WHEN 2 THEN '配送中' - WHEN 3 THEN '已完成' - ELSE - '其他' + CASE + lddl.delivery_status + WHEN 1 THEN + '待配送' + WHEN 2 THEN + '配送中' + WHEN 3 THEN + '已完成' ELSE '其他' END state, ( SELECT - GROUP_CONCAT( - DISTINCT ldsu.forklift_name SEPARATOR ',' - ) + GROUP_CONCAT( DISTINCT ldsu.forklift_name SEPARATOR ',' ) FROM logpm_distribution_signfor lds JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id @@ -363,42 +367,42 @@ ) forkliftName, lddl.create_time createTime, ( - SELECT - COALESCE (COUNT(*), 0) + SELECT COALESCE + ( COUNT(*), 0 ) FROM - logpm_distribution_signfor lds INNER JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id + logpm_distribution_signfor lds + INNER JOIN logpm_distribution_reservation AS ldr ON lds.reservation_id = ldr.id WHERE - lds.delivery_id = lddl.id and ldr.reservation_status != '40' AND (ldr.reservation_num + ldr.reservation_stock_list_num) > 0 + lds.delivery_id = lddl.id + AND ldr.reservation_status != '40' + AND ( ldr.reservation_num + ldr.reservation_stock_list_num ) > 0 ) customersNumber, lddl.price price, lddl.added_services_id addedServicesId, ( - SELECT - COALESCE (COUNT(*), 0) + SELECT COALESCE + ( COUNT(*), 0 ) FROM logpm_distribution_signfor lds JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id JOIN logpm_distribution_reservation_stockarticle ldrs ON ldrs.reservation_id = ldr.id WHERE - lds.delivery_id = lddl.id and ldrs.stock_article_status != 2 + lds.delivery_id = lddl.id + AND ldrs.stock_article_status != 2 ) orderNumber, ( - SELECT - COALESCE (sum(ldr.reservation_num), 0) + SELECT COALESCE + ( sum( ldr.reservation_num ), 0 ) FROM logpm_distribution_signfor lds JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id WHERE - lds.delivery_id = lddl.id and ldr.reservation_status != '40' + lds.delivery_id = lddl.id + AND ldr.reservation_status != '40' ) deliveryNumber, ( - SELECT - COALESCE ( - sum( - ldr.reservation_stock_list_num - ), - 0 - ) + SELECT COALESCE + ( sum( ldr.reservation_stock_list_num ), 0 ) FROM logpm_distribution_signfor lds JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id @@ -407,9 +411,7 @@ ) reservationStockListNum, ( SELECT - GROUP_CONCAT( - DISTINCT lds.loader_name SEPARATOR ',' - ) + GROUP_CONCAT( DISTINCT lds.loader_name SEPARATOR ',' ) FROM logpm_distribution_signfor ldsf JOIN logpm_distribution_reservation ldr ON ldr.id = ldsf.reservation_id @@ -420,9 +422,7 @@ ) loadingTeamName, ( SELECT - GROUP_CONCAT( - DISTINCT lds.fix_time SEPARATOR ',' - ) + GROUP_CONCAT( DISTINCT lds.fix_time SEPARATOR ',' ) FROM logpm_distribution_signfor ldsf JOIN logpm_distribution_reservation ldr ON ldr.id = ldsf.reservation_id @@ -430,8 +430,6 @@ INNER JOIN logpm_distribution_stockup AS lds ON ldsi.stockup_id = lds.id WHERE ldsf.delivery_id = lddl.id - -- ) leadTime, - -- lds.delivery_id = lddl.id ) reservationId, lddl.order_id orderId, lddl.fee fee, @@ -440,13 +438,8 @@ lddl.note_number noteNumber, lddl.source source, ( - SELECT - COALESCE ( - sum( - ldr.reservation_stock_list_num - ), - 0 - ) + SELECT COALESCE + ( sum( ldr.reservation_stock_list_num ), 0 ) FROM logpm_distribution_signfor lds JOIN logpm_distribution_reservation ldr ON lds.reservation_id = ldr.id @@ -454,29 +447,44 @@ lds.delivery_id = lddl.id ) inventoryNub, ( - SELECT - COALESCE (sum(lds.loaded_number), 0) + COALESCE (sum(lds.loadedin_number), 0) + SELECT COALESCE + ( sum( lds.loaded_number ), 0 ) + COALESCE ( sum( lds.loadedin_number ), 0 ) FROM logpm_distribution_signfor lds WHERE lddl.id = lds.delivery_id ) scannedNumber, - (SELECT - COALESCE (sum(lds.received_quantity), 0) + COALESCE (sum(lds.receivedin_quantity), 0) + ( + SELECT COALESCE + ( sum( lds.received_quantity ), 0 ) + COALESCE ( sum( lds.receivedin_quantity ), 0 ) FROM logpm_distribution_signfor lds WHERE lddl.id = lds.delivery_id ) signingNumber, - GROUP_CONCAT(DISTINCT ldr.consignee SEPARATOR ',') consignee, - GROUP_CONCAT(DISTINCT ldr.mall_name SEPARATOR ',') mallName, - (SELECT group_concat( DISTINCT ldsa.order_code SEPARATOR ',' ) FROM logpm_distribution_delivery_list lddll LEFT JOIN logpm_distribution_signfor lds ON lddll.id = lds.delivery_id LEFT JOIN logpm_distribution_reservation_stockarticle AS ldrs ON lds.reservation_id = ldrs.reservation_id AND ldrs.stock_article_status != 2 LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldrs.stock_article_id = ldsa.id WHERE lddll.id = lddl.id GROUP BY lddl.id ) AS orderCode - FROM logpm_distribution_delivery_list lddl + GROUP_CONCAT( DISTINCT a.consignee SEPARATOR ',' ) consignee, + GROUP_CONCAT( DISTINCT a.mallName SEPARATOR ',' ) mallName, + ( + SELECT + group_concat( DISTINCT ldsa.order_code SEPARATOR ',' ) + FROM + logpm_distribution_delivery_list lddll + LEFT JOIN logpm_distribution_signfor lds ON lddll.id = lds.delivery_id + LEFT JOIN logpm_distribution_reservation_stockarticle AS ldrs ON lds.reservation_id = ldrs.reservation_id + AND ldrs.stock_article_status != 2 + LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldrs.stock_article_id = ldsa.id + WHERE + lddll.id = lddl.id + GROUP BY + lddl.id + ) AS orderCode + FROM + logpm_distribution_delivery_list lddl LEFT JOIN ( SELECT lddl.id, - a.consignee AS consignee, - a.mall_name AS mallName, + ldr.consignee AS consignee, + ldr.mall_name AS mallName FROM logpm_distribution_delivery_list lddl LEFT JOIN logpm_distribution_signfor lds ON lddl.id = lds.delivery_id @@ -487,25 +495,40 @@ IF ( lddl.inventory_nub IS NULL, 0, lddl.inventory_nub ) > 0 AND ( lddl.customers_number > 0 AND ldr.reservation_num + ldr.reservation_stock_list_num ) > 0 - AND lds.is_deleted = 0 AND lddl.is_deleted = 0 AND ldr.is_deleted = 0 + AND lds.is_deleted = 0 + AND lddl.is_deleted = 0 + AND ldr.is_deleted = 0 GROUP BY lddl.id - ) AS a On a.id = lddl.id - LEFT JOIN (SELECT lddl.id,ldsa.order_code FROM logpm_distribution_delivery_list lddl + ) AS a ON a.id = lddl.id + LEFT JOIN ( + SELECT + lddl.id, + ldsa.order_code + FROM + logpm_distribution_delivery_list lddl LEFT JOIN logpm_distribution_signfor lds ON lddl.id = lds.delivery_id - LEFT JOIN logpm_distribution_reservation_stockarticle AS ldrs ON lds.reservation_id = ldrs.reservation_id AND ldrs.stock_article_status != 2 - LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldrs.stock_article_id = ldsa.id ) AS y ON y.id = lddl.id + LEFT JOIN logpm_distribution_reservation_stockarticle AS ldrs ON lds.reservation_id = ldrs.reservation_id + AND ldrs.stock_article_status != 2 + LEFT JOIN logpm_distribution_stock_article AS ldsa ON ldrs.stock_article_id = ldsa.id + ) AS y ON y.id = lddl.id LEFT JOIN logpm_warehouse_warehouse AS lww ON lddl.warehouse_id = lww.id lddl.is_deleted = 0 AND (IF(lddl.delivery_number is null ,0,lddl.delivery_number) + IF(lddl.inventory_nub is null ,0,lddl.inventory_nub)) > 0 - AND (lddl.customers_number > 0 AND ldr.reservation_num + ldr.reservation_stock_list_num) >0 + AND lddl.customers_number > 0 + + and lddl.id in + + #{item} + + and lddl.train_number like concat('%',#{param.trainNumber},'%') - + and lddl.warehouse_id in - + #{item} 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 3f18802ac..5203fa849 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 @@ -2456,6 +2456,8 @@ public class DistributionSignforServiceImpl extends BaseServiceImpl abnormalEntities = distributionLoadscanAbnormalService.list(Wrappers.query().lambda() .eq(DistributionLoadscanAbnormalEntity::getPackageCode, distrilbutionloadingscanDTO.getBarcode()) + .eq(DistributionLoadscanAbnormalEntity::getAuditingStatus, 1) + //修改 状态 ); if (!abnormalEntities.isEmpty()) { boolean flag = abnormalEntities.stream().allMatch(a -> deliveryListEntity.getId().equals(a.getDeliveryListId()) ); diff --git a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/SignPushClient.java b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/SignPushClient.java index b68041f29..d48ab6818 100644 --- a/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/SignPushClient.java +++ b/blade-service/logpm-old-project/src/main/java/com/logpm/oldproject/feign/SignPushClient.java @@ -29,6 +29,7 @@ public class SignPushClient implements IOldSignPushClient { public Boolean pushOldSystemSignInfo(SignPushDataDTO signPushDataDTO) { //todo 这里存在调用老系统的接口 将数据会写给老系统 + int timeoutMilliseconds = 60000; Boolean result =false; log.info(">>>> pushOldSystemSignInfo 程序执行 start time: {}",System.currentTimeMillis()); @@ -39,7 +40,7 @@ public class SignPushClient implements IOldSignPushClient { String data = JSON.toJSONString(signPushDataDTO); log.info(">>>> pushOldSystemSignInfo request url:{} data:{}",url,data); - String body = HttpRequest.post(url).body(data).header("token", authCode).execute().body(); + String body = HttpRequest.post(url).body(data).header("token", authCode).setConnectionTimeout(timeoutMilliseconds).execute().body(); if (StringUtil.isNotBlank(body)) { JSONObject res = JSON.parseObject(body); if ("200".equals(res.getString("code"))) { From 5cac2f203130446ce4462280a1fde7acf10e7abe Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Sun, 12 May 2024 19:52:46 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=87=AA=E6=8F=90?= =?UTF-8?q?=E7=AD=BE=E6=94=B6=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistrilbutionBillLadingServiceImpl.java | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistrilbutionBillLadingServiceImpl.java index a3f27f09b..08a83fefc 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 @@ -1329,15 +1329,33 @@ public class DistrilbutionBillLadingServiceImpl extends BaseServiceImpl>>>> 推送老系统签收信息报错", e); + log.error(">>>>> 推送老系统自提签收信息报错", e); return false; } } + /** + * 转换老系统的ID + * @param delivery + */ + private void modifyWarehouseId(SignPushDataDTO delivery) { + + if(!Objects.isNull(delivery.getWarehouseId())){ + // 查询老系统的ID + BasicdataWarehouseEntity entityWarehouseId = warehouseClient.getEntityWarehouseId(delivery.getWarehouseId()); + if(Objects.nonNull(entityWarehouseId)){ + delivery.setWarehouseId(Long.parseLong(entityWarehouseId.getOldId()+"")); + } + } + + } + /** * 构建名称和电话号码 From f541204ae764fbc0dc32f947d9d51af15cdc5862 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Sun, 12 May 2024 22:46:23 +0800 Subject: [PATCH 10/10] =?UTF-8?q?fix:1.=E4=BF=AE=E6=94=B9=E9=85=8D?= =?UTF-8?q?=E9=80=81=E7=AD=BE=E6=94=B6=E7=9A=84=E4=BB=A3=E7=A0=81=E7=BB=93?= =?UTF-8?q?=E6=9E=84=202.=E5=A2=9E=E5=8A=A0=E8=87=AA=E6=8F=90=E7=AD=BE?= =?UTF-8?q?=E6=94=B6=E7=9A=84=E6=95=B0=E6=8D=AE=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/constant/LauncherConstant.java | 2 +- .../feign/DistributionSignforClient.java | 147 +---------- .../mapper/DistrilbutionBillLadingMapper.xml | 6 +- .../ClerkCheckPushBillDataQueueHandler.java | 154 +---------- .../ClerkCheckPushDataQueueHandler.java | 239 +---------------- .../service/IDistributionSignforService.java | 2 + .../impl/DistributionSignforServiceImpl.java | 248 +++++++++++++++--- .../DistrilbutionBillLadingServiceImpl.java | 32 ++- .../com/logpm/distribution/TestService.java | 14 +- .../jobhandle/DistributionDatarepair.java | 1 - 10 files changed, 285 insertions(+), 560 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 9d8e48b0d..cfce22cc1 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 @@ -93,7 +93,7 @@ public interface LauncherConstant { /** * 本地登录 dev地址 */ - String APPLICATION_DEV_LOGIN_ADDR = "192.168.3.2:13000"; + String APPLICATION_DEV_LOGIN_ADDR = "127.0.0.1:13000"; /** * 本地登录 test地址 */ diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java index 5f949c6c6..ed3aa21d3 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/feign/DistributionSignforClient.java @@ -103,151 +103,16 @@ public class DistributionSignforClient implements IDistributionSignforClient { } + /** + * 推送老系统签收 + * @param id + * @return + */ @Override public Boolean clerkCheckPushData(Long id) { - try { - log.info(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> 推送老系统签收队列"); - //得到审核的任务ID - if (ObjectUtil.isEmpty(id)) { - log.info(">>>>>>>>>>>>> clerkCheckPushDataHandler 签收ID为空"); - return false; - } - - //得到签收对象 - DistributionSignforEntity distributionSignforEntity = distributionSignforMapper.selectById(id); - - //需要检测文员是否进行复核了 - - if (ObjectUtil.isEmpty(distributionSignforEntity)) { - log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionSignforEntity {}", distributionSignforEntity); - return false; - } - // 得到配送计划 - DistributionDeliveryListEntity distributionDeliveryListEntity = distributionDeliveryListMapper.selectById(distributionSignforEntity.getDeliveryId()); - if (ObjectUtil.isEmpty(distributionDeliveryListEntity)) { - log.info(">>>>>>>>>>> clerkCheckPushDataHandler distributionDeliveryListEntity {}", distributionDeliveryListEntity); - return false; - } - - // 得到配送客户 - DistributionReservationEntity distributionReservationEntity = distributionReservationMapper.selectById(distributionSignforEntity.getReservationId()); - if (ObjectUtil.isEmpty(distributionReservationEntity)) { - log.info(">>>>>>>>>>>> clerkCheckPushDataHandler distributionReservationEntity {}", distributionReservationEntity); - return false; - } - - - //组合配送信息 - SignPushDataDTO delivery = distributionDeliveryListMapper.selectPushOldDelivery(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); - - WarehouseEntity warehouseEntity = warehouseClient.findByName(distributionReservationEntity.getWarehouseName()); - if (ObjectUtils.isNotNull(warehouseEntity)) { - // 需要增加老系统的仓库ID - delivery.setWarehouseId(Long.parseLong(warehouseEntity.getId() + "")); - delivery.setWarehouseName(warehouseEntity.getTitle()); - } - - - //还需要配送的出库人、配送人、操作人信息 - if (Func.isNotEmpty(delivery)) { - if ("1".equals(delivery.getKind())) { - //自主配送 - DistributionDeliverySelfEntity distributionDeliverySelfEntity = distributionDeliverySelfMapper.selectOne(Wrappers.query().lambda() - .eq(DistributionDeliverySelfEntity::getDeliveryId, delivery.getId()) - .eq(DistributionDeliverySelfEntity::getIsMaster, 2) - ); - if (Func.isNotEmpty(distributionDeliverySelfEntity)) { - delivery.setOutId(Long.parseLong(distributionDeliverySelfEntity.getDriverId())); - delivery.setOutName(distributionDeliverySelfEntity.getDriverName()); - delivery.setOutPhone(distributionDeliverySelfEntity.getDriverPhone()); - } - } else { - //外协 - DistributionDeliveryTripartiteEntity distributionDeliveryTripartiteEntity = distributionDeliveryTripartiteMapper.selectOne(Wrappers.query().lambda().eq(DistributionDeliveryTripartiteEntity::getDeliveryId, delivery.getId())); - if (Func.isNotEmpty(distributionDeliveryTripartiteEntity)) { - delivery.setOutName(distributionDeliveryTripartiteEntity.getDriverName()); - delivery.setOutPhone(distributionDeliveryTripartiteEntity.getDriverPhone()); - } - } - R userR = userClient.userInfoById(delivery.getAdministratorsId()); - if (Func.isNotEmpty(userR)) { - User user = userR.getData(); - delivery.setAdministratorsName(user.getName()); - delivery.setAdministratorsPhone(user.getPhone()); - } - DistributionStockupEntity distributionStockupEntity = distributionReservationMapper.selectStockup(distributionSignforEntity.getReservationId()); - if (Func.isNotEmpty(distributionStockupEntity)) { - if (distributionStockupEntity.getAssignStatus().equals(StockAssignStatusConstant.yizhipai.getValue())) { - delivery.setOutToId(distributionStockupEntity.getStockupUserId()); - delivery.setOutToName(distributionStockupEntity.getStockupUser()); - } - - } - - //查询客户信息 - List customer = distributionReservationMapper.selectPushOldCustomer(distributionSignforEntity.getReservationId()); - if (Func.isNotEmpty(customer)) { - //查询客户订单 - List signPushDataUnitDTOS = new ArrayList<>(); - if (distributionReservationEntity.getReservationNum() > 0) { - //查询包件扫描签收 - //查询包件扫描签收 - List pushOldPackageLoading = distributionSignforMapper.selectPushOldPackageLoading(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); - List pushOldPackageSigning = distributionSignforMapper.selectPushOldPackageSigning(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); - if (Func.isNotEmpty(pushOldPackageLoading)) { - buildNameAndPhone(pushOldPackageLoading); - signPushDataUnitDTOS.addAll(pushOldPackageLoading); - } - if (Func.isNotEmpty(pushOldPackageSigning)) { - buildNameAndPhone(pushOldPackageSigning); - signPushDataUnitDTOS.addAll(pushOldPackageSigning); - } - } - - if (distributionReservationEntity.getReservationStockListNum() > 0) { - //查询库存品扫描签收 - List loadingPushOldInventory = distributionSignforMapper.selectLoadingPushOldInventory(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); - List signingPushOldInventory = distributionSignforMapper.selectSigningPushOldInventory(distributionSignforEntity.getReservationId(), distributionSignforEntity.getDeliveryId()); - if (Func.isNotEmpty(loadingPushOldInventory)) { - buildNameAndPhone(loadingPushOldInventory); - signPushDataUnitDTOS.addAll(loadingPushOldInventory); - } - - if (Func.isNotEmpty(signingPushOldInventory)) { - buildNameAndPhone(signingPushOldInventory); - signPushDataUnitDTOS.addAll(signingPushOldInventory); - } - } - //查询签收图片 - List distributionSignPrintVOS = distributionSignforMapper.selectSignImgsUrl(distributionReservationEntity.getId()); - - if (Func.isNotEmpty(signPushDataUnitDTOS)) { - SignPushDataContactDTO signPushDataContactDTO = customer.get(0); - signPushDataContactDTO.setSignPushDataUnitDTOs(signPushDataUnitDTOS); - if (Func.isNotEmpty(distributionSignPrintVOS)) { - String urls = distributionSignPrintVOS.stream().map(DistributionSignPrintVO::getUrlRoute).collect(Collectors.joining(",")); - signPushDataContactDTO.setImage(urls); - } - if (Func.isNotEmpty(distributionSignforEntity.getClerkSignRemarks())) { - signPushDataContactDTO.setContact(distributionSignforEntity.getClerkSignRemarks()); - } - } - buildReservationNameAndPhone(customer); - //完成客户信息添加 - delivery.setSignPushDataContactDTOs(customer); - } - } - - - log.info(">>>> clerkCheckPushData SignPushDataDTO :{}",delivery); - Boolean b = oldSystemDataPushClient.pushOldSystemSignInfo(delivery); - return b; - } catch (Exception e) { - log.error(">>>>> 推送老系统签收信息报错", e); - } + return distributionSignforService.clerkCheckPushData(id); - return false; } private void buildNameAndPhone(List pushOldPackageSigning) { 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 7c4b98051..56e275b55 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 @@ -843,7 +843,7 @@