From 027fa387781720a0de9a1dde2d41d25917247406 Mon Sep 17 00:00:00 2001 From: "pref_mail@163.com" Date: Thu, 7 Nov 2024 10:20:41 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E7=9A=84=E7=BB=93=E7=AE=97=E5=8D=95=E5=AE=A1=E6=A0=B8=E7=88=86?= =?UTF-8?q?=E7=B2=97=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/DistributionParcelListMapper.xml | 2 +- .../impl/StatisticsOrderInfoServiceImpl.java | 50 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml index 2b04c9d50..1c8026612 100644 --- a/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml +++ b/blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml @@ -2308,7 +2308,7 @@ select order_package_code from logpm_distribution_parcel_list where order_package_code in - + #{item} and order_package_status = '70' diff --git a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java index 9aa741ce0..7108ab03d 100644 --- a/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java +++ b/blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java @@ -37,6 +37,7 @@ import org.springblade.core.secure.utils.AuthUtil; import org.springblade.core.tool.api.R; import org.springblade.core.tool.utils.BeanUtil; import org.springblade.core.tool.utils.DateUtil; +import org.springblade.core.tool.utils.StringUtil; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -90,10 +91,12 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO); - List records = statisticsOrderInfoVOIPage.getRecords(); + if(CollUtil.isEmpty(records)){ + return statisticsOrderInfoVOIPage; + } + //把records中所有的orderInfoId放入一个集合 List orderInfoIdList = records.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList()); // 得到运单ID @@ -105,8 +108,6 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl> waybillDetailByWaybillIdMap = waybillDetailByWaybillId.stream().collect(Collectors.groupingBy(WaybillDetailByWaybillNoVo::getWaybillId)); - - Map orderPackageInfoMap; if(CollUtil.isNotEmpty(orderInfoIdList)){ List orderPackageInfoList = baseMapper.findPackageListByOrderIdsGroupById(orderInfoIdList); @@ -125,9 +126,6 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl { // Long waybillId = statisticsOrderInfoVO.getWaybillId(); - - - Long orderInfoId = statisticsOrderInfoVO.getOrderInfoId(); if(orderPackageInfoMap!=null){ @@ -138,33 +136,35 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl waybillDetailByWaybillNoVos = waybillDetailByWaybillIdMap.get(statisticsOrderInfoVO.getWaybillId()); + if(StringUtil.isNotBlank(statisticsOrderInfoVO.getGoodsName())){ + String[] split = statisticsOrderInfoVO.getGoodsName().split(","); + List waybillDetailByWaybillNoVos = waybillDetailByWaybillIdMap.get(statisticsOrderInfoVO.getWaybillId()); - StringBuffer sb = new StringBuffer(); - StringBuffer sb1 = new StringBuffer(); + StringBuffer sb = new StringBuffer(); + StringBuffer sb1 = new StringBuffer(); - for (String s : split) { + for (String s : split) { - Optional first = waybillDetailByWaybillNoVos.stream().filter(waybillDetailByWaybillNoVo -> waybillDetailByWaybillNoVo.getProductName().equals(s)).findFirst(); + Optional first = waybillDetailByWaybillNoVos.stream().filter(waybillDetailByWaybillNoVo -> waybillDetailByWaybillNoVo.getProductName().equals(s)).findFirst(); - if(first.isPresent()){ - WaybillDetailByWaybillNoVo waybillDetailByWaybillNoVo = first.get(); + if(first.isPresent()){ + WaybillDetailByWaybillNoVo waybillDetailByWaybillNoVo = first.get(); - if(!sb.toString().isEmpty()){ - sb.append(","); - } - sb.append(waybillDetailByWaybillNoVo.getNum()); + if(!sb.toString().isEmpty()){ + sb.append(","); + } + sb.append(waybillDetailByWaybillNoVo.getNum()); - if(!sb1.toString().isEmpty()){ - sb1.append(","); + if(!sb1.toString().isEmpty()){ + sb1.append(","); + } + sb1.append(waybillDetailByWaybillNoVo.getPrice()); } - sb1.append(waybillDetailByWaybillNoVo.getPrice()); } - } - statisticsOrderInfoVO.setGoodsNum(sb.toString()); - statisticsOrderInfoVO.setGoodsPrice(sb1.toString()); + statisticsOrderInfoVO.setGoodsNum(sb.toString()); + statisticsOrderInfoVO.setGoodsPrice(sb1.toString()); + } } }