From de51e85c149dee1015601b174963c3cabbf5c375 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Mon, 25 Nov 2024 18:40:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E4=BB=A3=E7=A0=81=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=20=20=E5=B7=A5=E5=8D=95BUG=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/AftersalesWorkOrderMapper.xml | 2 +- .../controller/WarehouseIndexController.java | 3 +- .../service/IWarehouseIndexService.java | 3 +- .../impl/WarehouseIndexServiceImpl.java | 90 +++++++++++-------- 4 files changed, 59 insertions(+), 39 deletions(-) diff --git a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml index 52f7589b1..03edaabed 100644 --- a/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml +++ b/blade-service/logpm-aftersales/src/main/java/com/logpm/aftersales/mapper/AftersalesWorkOrderMapper.xml @@ -719,7 +719,7 @@ lap.is_deleted AS is_deleted from logpm_aftersales_work_order lawo left JOIN - logpm_aftersales_processor lap on lap.work_order_id= lawo.id + logpm_aftersales_processor lap on lap.work_order_id= lawo.id AND lap.types_of != 3 AND lap.processing_status = 4 left join logpm_aftersales_abnormal_package laap on laap.work_order_id=lawo.id AND laap.is_deleted = 0 LEFT JOIN logpm_distribution_stock_article ldsa ON ldsa.id = laap.order_id LEFT JOIN logpm_aftersales_processing_results lapr ON lapr.work_order_id = lap.work_order_id AND lapr.is_deleted = 0 diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java index 0e4b74fcc..63573c444 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/controller/WarehouseIndexController.java @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.*; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.Objects; import java.util.stream.Collectors; @@ -294,7 +295,7 @@ public class WarehouseIndexController { indexDTO.setWarehouseIds(warehouseIds); //查询订制品打托列表 - List indexDeliveryDataVO = warehouseIndexService.deliveryData(indexDTO); + Map> indexDeliveryDataVO = warehouseIndexService.deliveryData(indexDTO); return R.data(indexDeliveryDataVO); } catch (CustomerException e) { log.warn(e.message); diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java index db6118147..41a65a9d4 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/IWarehouseIndexService.java @@ -6,6 +6,7 @@ import com.logpm.report.vo.indexCount.IndexDeliveryDataVO; import com.logpm.report.vo.indexCount.IndexSignforDataVO; import java.util.List; +import java.util.Map; public interface IWarehouseIndexService { IndexOpenOrderDataVO openOrderData(IndexDTO indexDTO); @@ -27,7 +28,7 @@ public interface IWarehouseIndexService { * @param indexDTO * @return */ - List deliveryData(IndexDTO indexDTO); + Map> deliveryData(IndexDTO indexDTO); /** * 查询当前签收率 diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java index e715e1710..b1a5e0f04 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/service/impl/WarehouseIndexServiceImpl.java @@ -495,12 +495,19 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { } @Override - public List deliveryData(IndexDTO indexDTO) { + public Map> deliveryData(IndexDTO indexDTO) { BladeUser user = AuthUtil.getUser(); - String key = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "deliveryData:" + indexDTO.toString()); -// List indexDeliveryDataVOList = bladeRedis.get(key); + String deliveryKey = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "deliveryData:" + indexDTO.toString()); + String billKey = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "deliveryData:" + indexDTO.toString()); + String tripartiteDeliveryKey = CacheNames.tenantKey(user.getTenantId(), user.getUserId() + "", "deliveryData:" + indexDTO.toString()); +// List indexDeliveryDataVOList = bladeRedis.get(deliveryKey); +// List indexBillDataVOList = bladeRedis.get(billKey); +// List indexBillDataVOList = bladeRedis.get(tripartiteDeliveryKey); List indexDeliveryDataVOList= null; + List indexBillDataVOList= null; + List indexTripartiteDeliveryDataVOList= null; + Map> map = new HashMap<>(); if (Objects.isNull(indexDeliveryDataVOList)) { //查询商市配的信息 indexDeliveryDataVOList = new ArrayList<>(); @@ -521,47 +528,58 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { // indexDeliveryDataVO.setTotalRoadNum(totalRoadNum); } indexDeliveryDataVOList.addAll(indexDeliveryDataVOS); + bladeRedis.setEx(deliveryKey, indexDeliveryDataVOList, 3600L); } - - //查询自提信息 - List indexDeliveryDataVO = warehouseIndexMapper.findBillLadingTotal(indexDTO); - if (Func.isNotEmpty(indexDeliveryDataVO)) { - for (IndexDeliveryDataVO deliveryDataVO : indexDeliveryDataVO) { - //查询自提总件数 - Integer billLadingTotalNum = warehouseIndexMapper.findBillLadingTotalNum(deliveryDataVO.getWarehouseId()); - deliveryDataVO.setTotalDeliveryNum(billLadingTotalNum); - //查询总重量 - BigDecimal billLadingTotalWeight = warehouseIndexMapper.findBillLadingTotalWeight(deliveryDataVO.getWarehouseId()); - deliveryDataVO.setTotalWeight(billLadingTotalWeight); - //查询总包件体积 - BigDecimal billLadingTotalVolume = warehouseIndexMapper.findBillLadingTotalVolume(deliveryDataVO.getWarehouseId()); - deliveryDataVO.setTotalVolume(billLadingTotalVolume); - //查询在途件数 + map.put("data1",indexDeliveryDataVOList); + if (indexBillDataVOList.isEmpty()){ + indexBillDataVOList = new ArrayList<>(); + //查询自提信息 + List indexDeliveryDataVO = warehouseIndexMapper.findBillLadingTotal(indexDTO); + if (Func.isNotEmpty(indexDeliveryDataVO)) { + for (IndexDeliveryDataVO deliveryDataVO : indexDeliveryDataVO) { + //查询自提总件数 + Integer billLadingTotalNum = warehouseIndexMapper.findBillLadingTotalNum(deliveryDataVO.getWarehouseId()); + deliveryDataVO.setTotalDeliveryNum(billLadingTotalNum); + //查询总重量 + BigDecimal billLadingTotalWeight = warehouseIndexMapper.findBillLadingTotalWeight(deliveryDataVO.getWarehouseId()); + deliveryDataVO.setTotalWeight(billLadingTotalWeight); + //查询总包件体积 + BigDecimal billLadingTotalVolume = warehouseIndexMapper.findBillLadingTotalVolume(deliveryDataVO.getWarehouseId()); + deliveryDataVO.setTotalVolume(billLadingTotalVolume); + //查询在途件数 // Integer billLadingRoadTotalNum = warehouseIndexMapper.findBillLadingRoadTotalNum(deliveryDataVO.getWarehouseId()); // deliveryDataVO.setTotalRoadNum(billLadingRoadTotalNum); + } + indexBillDataVOList.addAll(indexDeliveryDataVO); } - indexDeliveryDataVOList.addAll(indexDeliveryDataVO); + bladeRedis.setEx(billKey, indexBillDataVOList, 3600L); } - //查询尊外协信息 - List indexTripartiteDeliveryDataVOS = warehouseIndexMapper.findTripartiteDeliveryTotal(indexDTO); - if (!indexTripartiteDeliveryDataVOS.isEmpty()) { - for (IndexDeliveryDataVO indexTripartiteDeliveryDataVO : indexTripartiteDeliveryDataVOS) { - //总包件数量 - Integer deLiveryTotalNum = warehouseIndexMapper.findDeLiveryTotalNum(indexTripartiteDeliveryDataVO.getType(),indexTripartiteDeliveryDataVO.getWarehouseId(),2); - indexTripartiteDeliveryDataVO.setTotalDeliveryNum(deLiveryTotalNum); - //查询总重量 - BigDecimal totalWeight = warehouseIndexMapper.findDeliveryTotalWeight( indexTripartiteDeliveryDataVO.getType(),indexTripartiteDeliveryDataVO.getWarehouseId(),2); - indexTripartiteDeliveryDataVO.setTotalWeight(totalWeight); - //查询总包件体积 - BigDecimal totalVolume = warehouseIndexMapper.findDeliveryTotalVolume( indexTripartiteDeliveryDataVO.getType(),indexTripartiteDeliveryDataVO.getWarehouseId(),2); - indexTripartiteDeliveryDataVO.setTotalVolume(totalVolume); - + map.put("data2",indexBillDataVOList); + if (indexTripartiteDeliveryDataVOList.isEmpty()){ + //查询尊外协信息 + indexTripartiteDeliveryDataVOList = new ArrayList<>(); + List indexTripartiteDeliveryDataVOS = warehouseIndexMapper.findTripartiteDeliveryTotal(indexDTO); + if (!indexTripartiteDeliveryDataVOS.isEmpty()) { + for (IndexDeliveryDataVO indexTripartiteDeliveryDataVO : indexTripartiteDeliveryDataVOS) { + //总包件数量 + Integer deLiveryTotalNum = warehouseIndexMapper.findDeLiveryTotalNum(indexTripartiteDeliveryDataVO.getType(),indexTripartiteDeliveryDataVO.getWarehouseId(),2); + indexTripartiteDeliveryDataVO.setTotalDeliveryNum(deLiveryTotalNum); + //查询总重量 + BigDecimal totalWeight = warehouseIndexMapper.findDeliveryTotalWeight( indexTripartiteDeliveryDataVO.getType(),indexTripartiteDeliveryDataVO.getWarehouseId(),2); + indexTripartiteDeliveryDataVO.setTotalWeight(totalWeight); + //查询总包件体积 + BigDecimal totalVolume = warehouseIndexMapper.findDeliveryTotalVolume( indexTripartiteDeliveryDataVO.getType(),indexTripartiteDeliveryDataVO.getWarehouseId(),2); + indexTripartiteDeliveryDataVO.setTotalVolume(totalVolume); + + } + indexTripartiteDeliveryDataVOList.addAll(indexTripartiteDeliveryDataVOS); + bladeRedis.setEx(tripartiteDeliveryKey, indexTripartiteDeliveryDataVOList, 3600L); } } - - bladeRedis.setEx(key, indexDeliveryDataVOList, 3600L); + map.put("data3",indexTripartiteDeliveryDataVOList); } - return indexDeliveryDataVOList; + + return map; } @Override