Browse Source

fix:修复审核的结算单审核爆粗的问题

master
pref_mail@163.com 5 months ago
parent
commit
027fa38778
  1. 2
      blade-service/logpm-distribution/src/main/java/com/logpm/distribution/mapper/DistributionParcelListMapper.xml
  2. 50
      blade-service/logpm-statisticsdata/src/main/java/com/logpm/statistics/service/impl/StatisticsOrderInfoServiceImpl.java

2
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
<foreach collection="orderPackageCodes" item="item" separator="," open="(" close=")">
<foreach collection="orderPackageCodeList" item="item" separator="," open="(" close=")">
#{item}
</foreach>
and order_package_status = '70'

50
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<StatisticsOr
merchantStatisticsDTO.setWarehouseIds(warehouseIds);
}
IPage<StatisticsOrderInfoVO> statisticsOrderInfoVOIPage = baseMapper.pageList(page, merchantStatisticsDTO);
List<StatisticsOrderInfoVO> records = statisticsOrderInfoVOIPage.getRecords();
if(CollUtil.isEmpty(records)){
return statisticsOrderInfoVOIPage;
}
//把records中所有的orderInfoId放入一个集合
List<Long> orderInfoIdList = records.stream().map(StatisticsOrderInfoVO::getOrderInfoId).collect(Collectors.toList());
// 得到运单ID
@ -105,8 +108,6 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
// 通过运单号进行分组
Map<Long, List<WaybillDetailByWaybillNoVo>> waybillDetailByWaybillIdMap = waybillDetailByWaybillId.stream().collect(Collectors.groupingBy(WaybillDetailByWaybillNoVo::getWaybillId));
Map<Long, StatisticsPackageFeeInfoVO> orderPackageInfoMap;
if(CollUtil.isNotEmpty(orderInfoIdList)){
List<StatisticsPackageFeeInfoVO> orderPackageInfoList = baseMapper.findPackageListByOrderIdsGroupById(orderInfoIdList);
@ -125,9 +126,6 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
records.forEach(statisticsOrderInfoVO -> {
// Long waybillId = statisticsOrderInfoVO.getWaybillId();
Long orderInfoId = statisticsOrderInfoVO.getOrderInfoId();
if(orderPackageInfoMap!=null){
@ -138,33 +136,35 @@ public class StatisticsOrderInfoServiceImpl extends BaseServiceImpl<StatisticsOr
// statisticsPackageFeeInfoVO.setGoodsName(statisticsOrderInfoVO.getGoodsName());
BeanUtil.copy(statisticsPackageFeeInfoVO, statisticsOrderInfoVO);
String[] split = statisticsOrderInfoVO.getGoodsName().split(",");
List<WaybillDetailByWaybillNoVo> waybillDetailByWaybillNoVos = waybillDetailByWaybillIdMap.get(statisticsOrderInfoVO.getWaybillId());
if(StringUtil.isNotBlank(statisticsOrderInfoVO.getGoodsName())){
String[] split = statisticsOrderInfoVO.getGoodsName().split(",");
List<WaybillDetailByWaybillNoVo> 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<WaybillDetailByWaybillNoVo> first = waybillDetailByWaybillNoVos.stream().filter(waybillDetailByWaybillNoVo -> waybillDetailByWaybillNoVo.getProductName().equals(s)).findFirst();
Optional<WaybillDetailByWaybillNoVo> 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());
}
}
}

Loading…
Cancel
Save