|
@@ -3,6 +3,7 @@ package com.slibra.business.service.impl;
|
|
|
import java.math.BigDecimal;
|
|
|
import java.math.RoundingMode;
|
|
|
import java.util.*;
|
|
|
+import java.util.stream.Collectors;
|
|
|
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.slibra.business.domain.TXinyiCarbonExtra;
|
|
@@ -739,7 +740,8 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
|
|
|
}
|
|
|
tXinyiCarbonMajor.setRecent7Datas(recent7PflDatas);
|
|
|
//关联的多条数据
|
|
|
- tXinyiCarbonMajor.setExtraList(this.xinyiCarbonExtraMapper.selectTXinyiCarbonExtraList(TXinyiCarbonExtra.builder().majorId(tXinyiCarbonMajor.getId()).build()));
|
|
|
+// tXinyiCarbonMajor.setExtraList();
|
|
|
+ tXinyiCarbonMajor.setExtraMap(this.xinyiCarbonExtraMapper.selectTXinyiCarbonExtraList(TXinyiCarbonExtra.builder().majorId(tXinyiCarbonMajor.getId()).build()).stream().collect(Collectors.groupingBy(TXinyiCarbonExtra::getType)));
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
@@ -757,5 +759,8 @@ public class TXinyiCarbonMajorServiceImpl implements ITXinyiCarbonMajorService
|
|
|
System.out.println(reduce);
|
|
|
System.out.println(reduce.isPresent());
|
|
|
System.out.println(reduce.get());
|
|
|
+ list = new ArrayList<>();
|
|
|
+ Map<Integer, List<TXinyiCarbonExtra>> collect = list.stream().collect(Collectors.groupingBy(TXinyiCarbonExtra::getType));
|
|
|
+ System.out.println(collect);
|
|
|
}
|
|
|
}
|