From 8586eb67f75648295ff0bf9d63d36527fef96591 Mon Sep 17 00:00:00 2001 From: PigBaoBei <2739175034@qq.com> Date: Thu, 28 Nov 2024 17:06:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9C=8B=E6=9D=BF=E3=80=81?= =?UTF-8?q?=E8=BF=90=E5=8D=95=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2BUG?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E3=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DistributionDeliveryListServiceImpl.java | 1 + .../impl/WarehouseIndexServiceImpl.java | 84 ++++++++++--------- .../vo/indexCount/IndexSignforDataVO.java | 1 + .../impl/WarehouseWaybillServiceImpl.java | 31 +++---- 4 files changed, 61 insertions(+), 56 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java index 07300c89d..4c99cee01 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/service/impl/DistributionDeliveryListServiceImpl.java @@ -8251,6 +8251,7 @@ public class DistributionDeliveryListServiceImpl extends BaseServiceImpl monthData = bladeRedis.get(monthKey); Map> dayDataMap = null; Map> monthDataMap = null; - if (!Objects.isNull(dayData)){ - dayDataMap = dayData.stream().collect(Collectors.groupingBy(IndexSignforDataVO::getWarehouseId)); + if (!Objects.isNull(dayData)) { + dayDataMap = dayData.stream().collect(Collectors.groupingBy(IndexSignforDataVO::getWarehouseId)); } - if (!Objects.isNull(monthData)){ + if (!Objects.isNull(monthData)) { monthDataMap = monthData.stream().collect(Collectors.groupingBy(IndexSignforDataVO::getWarehouseId)); } - Map map = new HashMap<>(); + Map map = new HashMap<>(); if (!warehouseIds.isEmpty()) { List dayData1 = new ArrayList<>(); List monthData1 = new ArrayList<>(); for (Long warehouseId : warehouseIds) { BasicdataWarehouseEntity warehouseEntity = warehouseClient.getEntityWarehouseId(warehouseId); - if (!warehouseEntity.getName().contains("测试")){ - if (dayDataMap != null && !Objects.isNull(dayDataMap.get(warehouseId))){ + if (!warehouseEntity.getName().contains("测试")) { + if (dayDataMap != null && !Objects.isNull(dayDataMap.get(warehouseId))) { List indexSignforDayDataVO = dayDataMap.get(warehouseId); dayData1.addAll(indexSignforDayDataVO); } else { @@ -635,7 +635,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexBillSignforDayDataVO.setWarehouseName(warehouseEntity.getName()); dayData1.add(indexBillSignforDayDataVO); } - if (monthDataMap != null && !Objects.isNull(monthDataMap.get(warehouseId))){ + if (monthDataMap != null && !Objects.isNull(monthDataMap.get(warehouseId))) { List indexSignforDataVOS = monthDataMap.get(warehouseId); monthData1.addAll(indexSignforDataVOS); } else { @@ -647,8 +647,8 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexBillSignforMonthDataVO.setWarehouseName(warehouseEntity.getName()); monthData1.add(indexBillSignforMonthDataVO); } - map.put("dayData",dayData1); - map.put("monthData",monthData1); + map.put("dayData", dayData1); + map.put("monthData", monthData1); } } bladeRedis.setEx(dayKey, dayData1, 3600L); @@ -659,42 +659,42 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { private IndexSignforDataVO handleBillDataByMonth(Long warehouseId) { IndexSignforDataVO indexBillLadingSignforMonthDataVO = new IndexSignforDataVO(); - indexBillLadingSignforMonthDataVO.setWarehouseId(warehouseId); - indexBillLadingSignforMonthDataVO.setType(2); - //查询自提当月签收情况 - String monthBillLadingSignfor = warehouseIndexMapper.findBillLadingSignforByMonth(warehouseId); - indexBillLadingSignforMonthDataVO.setSignNum(monthBillLadingSignfor); - //查询自提当月未签数量 - String monthBillLadingUnSignfor = warehouseIndexMapper.findBillLadingUnSignforByMonth(warehouseId); - indexBillLadingSignforMonthDataVO.setUnSignNum(monthBillLadingUnSignfor); - //计算当月的签收率 + indexBillLadingSignforMonthDataVO.setWarehouseId(warehouseId); + indexBillLadingSignforMonthDataVO.setType(2); + //查询自提当月签收情况 + String monthBillLadingSignfor = warehouseIndexMapper.findBillLadingSignforByMonth(warehouseId); + indexBillLadingSignforMonthDataVO.setSignNum(monthBillLadingSignfor); + //查询自提当月未签数量 + String monthBillLadingUnSignfor = warehouseIndexMapper.findBillLadingUnSignforByMonth(warehouseId); + indexBillLadingSignforMonthDataVO.setUnSignNum(monthBillLadingUnSignfor); + //计算当月的签收率 indexBillLadingSignforMonthDataVO.setSignScale("0.0000"); if (!"0".equals(monthBillLadingSignfor) && !"0".equals(monthBillLadingUnSignfor)) { - BigDecimal bd1 = new BigDecimal(monthBillLadingSignfor); - BigDecimal bd2 = new BigDecimal(monthBillLadingUnSignfor); - BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); - String signScale = multiply.toString(); - indexBillLadingSignforMonthDataVO.setSignScale(signScale); - } - //查询当月文员签收数 - String monthBillLadingSignforNum = warehouseIndexMapper.findBillLadingSignForNumByMonth(warehouseId); - indexBillLadingSignforMonthDataVO.setClerkSignNum(monthBillLadingSignforNum); - //查询当月文员超时签收数 - String monthBillLadingOverTimeNum = warehouseIndexMapper.findBillLadingOverTimeNumByMonth(warehouseId); - indexBillLadingSignforMonthDataVO.setClerkOverTimeSignfoNum(monthBillLadingOverTimeNum); - //查询当月计划总数 - String monthBillLadingPlanNum = warehouseIndexMapper.findBillLadingPlanNumByMonth(warehouseId); + BigDecimal bd1 = new BigDecimal(monthBillLadingSignfor); + BigDecimal bd2 = new BigDecimal(monthBillLadingUnSignfor); + BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); + String signScale = multiply.toString(); + indexBillLadingSignforMonthDataVO.setSignScale(signScale); + } + //查询当月文员签收数 + String monthBillLadingSignforNum = warehouseIndexMapper.findBillLadingSignForNumByMonth(warehouseId); + indexBillLadingSignforMonthDataVO.setClerkSignNum(monthBillLadingSignforNum); + //查询当月文员超时签收数 + String monthBillLadingOverTimeNum = warehouseIndexMapper.findBillLadingOverTimeNumByMonth(warehouseId); + indexBillLadingSignforMonthDataVO.setClerkOverTimeSignfoNum(monthBillLadingOverTimeNum); + //查询当月计划总数 + String monthBillLadingPlanNum = warehouseIndexMapper.findBillLadingPlanNumByMonth(warehouseId); + indexBillLadingSignforMonthDataVO.setClerkSignNum(monthBillLadingPlanNum); indexBillLadingSignforMonthDataVO.setClerkOverTimeScale("0.0000"); - if (!"0".equals(monthBillLadingOverTimeNum) && !"0".equals(monthBillLadingPlanNum)) { - //计算当月的超时签收率 - BigDecimal bd1 = new BigDecimal(monthBillLadingOverTimeNum); - BigDecimal bd2 = new BigDecimal(monthBillLadingPlanNum); - BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); - String signScale = multiply.toString(); - indexBillLadingSignforMonthDataVO.setClerkOverTimeScale(signScale); - } + //计算当月的超时签收率 + BigDecimal bd1 = new BigDecimal(monthBillLadingOverTimeNum); + BigDecimal bd2 = new BigDecimal(monthBillLadingPlanNum); + BigDecimal multiply = bd1.divide(bd1.add(bd2), 4, BigDecimal.ROUND_CEILING); + String signScale = multiply.toString(); + indexBillLadingSignforMonthDataVO.setClerkOverTimeScale(signScale); + } return indexBillLadingSignforMonthDataVO; } @@ -720,7 +720,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { } //查询当天计划数 String dayBillLadingPlanNum = warehouseIndexMapper.findBillLadingPlanNumByDay(warehouseId); - + indexBillLadingSignforDayDataVO.setPlanNum(dayBillLadingPlanNum); indexBillLadingSignforDayDataVO.setClerkOverTimeScale("0.0000"); //查询当天文员复核数 String dayBillLadingSignforNum = warehouseIndexMapper.findBillLadingSignForNumByDay(warehouseId); @@ -763,6 +763,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { String monthClerkSignforNum = warehouseIndexMapper.findClerkSignforNumByMonth(warehouseId); indexSignforMonthDataVO.setClerkSignNum(monthClerkSignforNum); String monthPlan = warehouseIndexMapper.findPlanNumByMonth(warehouseId); + indexSignforMonthDataVO.setClerkSignNum(monthPlan); if (!"0".equals(monthClerkSignforNum) && !"0".equals(monthPlan)) { BigDecimal bd1 = new BigDecimal(monthClerkSignforNum); BigDecimal bd2 = new BigDecimal(monthPlan); @@ -808,6 +809,7 @@ public class WarehouseIndexServiceImpl implements IWarehouseIndexService { indexSignforDayDataVO.setClerkSignNum(dayClerkSignforNum); //查询计划数量 String dayPlanByday = warehouseIndexMapper.findPlanNumByDay(warehouseId); + indexSignforDayDataVO.setPlanNum(dayClerkSignforNum); //计算文员签收率 indexSignforDayDataVO.setClerkSignforScale("0.0000"); if (!"0".equals(dayClerkSignforNum) && !"0".equals(dayPlanByday)) { diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java index 5c18eb272..b10053236 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/vo/indexCount/IndexSignforDataVO.java @@ -26,6 +26,7 @@ public class IndexSignforDataVO implements Serializable { private String ClerkSignforScale; //复核数 private String clerkSignNum; + private String planNum; //仓库名称 private String warehouseName; private Long warehouseId; diff --git a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java index 4533c08e4..eddf63742 100644 --- a/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java +++ b/blade-service/logpm-warehouse/src/main/java/com/logpm/warehouse/service/impl/WarehouseWaybillServiceImpl.java @@ -722,22 +722,23 @@ public class WarehouseWaybillServiceImpl extends BaseServiceImpl> map = wayBillDetailList.stream().collect(Collectors.groupingBy(WarehouseWayBillDetail::getWaybillId)); for (WarehouseWaybillVO record : records) { Long waybillId = record.getId(); - List warehouseWayBillDetails = map.get(waybillId); - - // 将集合 warehouseWayBillDetails 中的productName 按照, 进行拼接 - String productNames = warehouseWayBillDetails.stream().filter(s -> StringUtil.isNotBlank(s.getProductName())).map(WarehouseWayBillDetail::getProductName).collect(Collectors.joining(",")); - record.setGoodsName(productNames); - String productNum = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getNum())).map(s -> s.getNum().toString()).collect(Collectors.joining(",")); - record.setProductNum(productNum); - String productPrice = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getPrice())).map(s -> s.getPrice().toString()).collect(Collectors.joining(",")); - record.setProductPrice(productPrice); - // 对集合中的weight 进行求和 - BigDecimal sumWeight = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getWeight())).map(WarehouseWayBillDetail::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add); - record.setTotalWeight(sumWeight); - BigDecimal productVolume = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getVolume())).map(WarehouseWayBillDetail::getVolume).reduce(BigDecimal.ZERO, BigDecimal::add); - record.setTotalVolume(productVolume); + if (!Objects.isNull(map.get(waybillId))){ + List warehouseWayBillDetails = map.get(waybillId); + // 将集合 warehouseWayBillDetails 中的productName 按照, 进行拼接 + String productNames = warehouseWayBillDetails.stream().filter(s -> StringUtil.isNotBlank(s.getProductName())).map(WarehouseWayBillDetail::getProductName).collect(Collectors.joining(",")); + record.setGoodsName(productNames); + String productNum = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getNum())).map(s -> s.getNum().toString()).collect(Collectors.joining(",")); + record.setProductNum(productNum); + String productPrice = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getPrice())).map(s -> s.getPrice().toString()).collect(Collectors.joining(",")); + record.setProductPrice(productPrice); + // 对集合中的weight 进行求和 + BigDecimal sumWeight = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getWeight())).map(WarehouseWayBillDetail::getWeight).reduce(BigDecimal.ZERO, BigDecimal::add); + record.setTotalWeight(sumWeight); + BigDecimal productVolume = warehouseWayBillDetails.stream().filter(s -> !Objects.isNull(s.getVolume())).map(WarehouseWayBillDetail::getVolume).reduce(BigDecimal.ZERO, BigDecimal::add); + record.setTotalVolume(productVolume); + record.setDetailList(warehouseWayBillDetails); + } - record.setDetailList(warehouseWayBillDetails); } pageList.setRecords(records); }