|
@@ -2,6 +2,7 @@ package com.sd.business.service.order.impl;
|
|
|
|
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
import com.fjhx.file.utils.ObsFileUtil;
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
import com.ruoyi.common.core.domain.BaseIdPo;
|
|
@@ -97,9 +98,31 @@ public class IssueBillServiceImpl implements IssueBillService {
|
|
|
|
|
|
Map<Long, List<String>> map = orderInfoList.stream().collect(
|
|
Map<Long, List<String>> map = orderInfoList.stream().collect(
|
|
Collectors.groupingBy(OrderInfo::getMasterOrderId, Collectors.mapping(OrderInfo::getCode, Collectors.toList())));
|
|
Collectors.groupingBy(OrderInfo::getMasterOrderId, Collectors.mapping(OrderInfo::getCode, Collectors.toList())));
|
|
- records.forEach(item -> {
|
|
|
|
- item.setGroupOrderCodeList(map.getOrDefault(item.getId(), Collections.emptyList()));
|
|
|
|
- });
|
|
|
|
|
|
+ records.forEach(item -> item.setGroupOrderCodeList(map.getOrDefault(item.getId(), Collections.emptyList())));
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ QueryWrapper<OrderEncasement> orderEncasementWrapper = new QueryWrapper<>();
|
|
|
|
+ orderEncasementWrapper.select(
|
|
|
|
+ "order_id as orderId",
|
|
|
|
+ "ifnull(sum(netWeight*total),0) totalNetWeight",
|
|
|
|
+ "ifnull(sum(length*width*height*total/1000000),0) totalVolume"
|
|
|
|
+ );
|
|
|
|
+ orderEncasementWrapper.in("order_id", orderIdList);
|
|
|
|
+ orderEncasementWrapper.groupBy("order_id");
|
|
|
|
+
|
|
|
|
+ List<Map<String, Object>> mapList = orderEncasementService.listMaps(orderEncasementWrapper);
|
|
|
|
+ Map<Long, Map<String, Object>> orderEncasementMap = mapList.stream().collect(Collectors.toMap(item -> (Long) item.get("orderId"), Function.identity()));
|
|
|
|
+
|
|
|
|
+ for (IssueBillVo record : records) {
|
|
|
|
+ Map<String, Object> itemMap = orderEncasementMap.get(record.getId());
|
|
|
|
+ if (itemMap != null) {
|
|
|
|
+ record.setTotalNetWeight((BigDecimal) itemMap.get("totalNetWeight"));
|
|
|
|
+ record.setTotalVolume((BigDecimal) itemMap.get("totalVolume"));
|
|
|
|
+ } else {
|
|
|
|
+ record.setTotalNetWeight(BigDecimal.ZERO);
|
|
|
|
+ record.setTotalVolume(BigDecimal.ZERO);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
return page;
|
|
return page;
|
|
}
|
|
}
|