|
@@ -1,19 +1,12 @@
|
|
|
package com.ims.eval.service.impl;
|
|
|
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ims.common.utils.DateUtils;
|
|
|
-import com.ims.eval.config.CustomException;
|
|
|
-import com.ims.eval.dao.BinSectionMapper;
|
|
|
import com.ims.eval.dao.EvaluationScoreCountMapper;
|
|
|
-import com.ims.eval.entity.BinSection;
|
|
|
import com.ims.eval.entity.EvaluationScoreCount;
|
|
|
-import com.ims.eval.service.IBinSectionService;
|
|
|
import com.ims.eval.service.IEvaluationScoreCountService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
-import javax.annotation.Resource;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -59,7 +52,7 @@ public class EvaluatioinScoreCountServiceImpl extends ServiceImpl<EvaluationScor
|
|
|
Map<Object, List<Map<String, Object>>> collect = list.stream().collect(Collectors.groupingBy(c -> c.get("organization_name"), Collectors.toList()));
|
|
|
boolean flag = true;
|
|
|
List<Object> value = new ArrayList<>();
|
|
|
- List<Object> title = new ArrayList<>();
|
|
|
+ Map<String, Object> title = new HashMap<>();
|
|
|
for (Map.Entry<Object, List<Map<String, Object>>> entry : collect.entrySet()) {
|
|
|
List<Map<String, Object>> v = entry.getValue();
|
|
|
Map<String, Object> mp = new HashMap<>();
|
|
@@ -69,16 +62,24 @@ public class EvaluatioinScoreCountServiceImpl extends ServiceImpl<EvaluationScor
|
|
|
mp.put("organization_name", item.get("organization_name"));
|
|
|
mp.put(item.get("indicator_code").toString() + "_flag", item.get("score") == item.get("standard_score") ? "0"
|
|
|
: Double.valueOf(item.get("score").toString()) > Double.valueOf(item.get("standard_score").toString()) ? "1" : "-1");
|
|
|
+ }
|
|
|
+ value.add(mp);
|
|
|
|
|
|
- if (flag) {
|
|
|
- Map<String, Object> tl = new HashMap<>();
|
|
|
- tl.put("key", item.get("indicator_name"));
|
|
|
- tl.put("code", item.get("indicator_code").toString() + "_score");
|
|
|
- title.add(tl);
|
|
|
+
|
|
|
+ if (flag) {
|
|
|
+ Map<Object, List<Map<String, Object>>> types = v.stream().collect(Collectors.groupingBy(c -> c.get("type_name")));
|
|
|
+ for (Map.Entry<Object, List<Map<String, Object>>> e : types.entrySet()) {
|
|
|
+ List<Object> ls = new ArrayList<>();
|
|
|
+ e.getValue().forEach(el -> {
|
|
|
+ Map<String, Object> mt = new HashMap<>();
|
|
|
+ mt.put("key", el.get("indicator_name"));
|
|
|
+ mt.put("code", el.get("indicator_code").toString() + "_score");
|
|
|
+ ls.add(mt);
|
|
|
+ });
|
|
|
+ title.put((String) e.getKey(), ls);
|
|
|
}
|
|
|
+ flag = false;
|
|
|
}
|
|
|
- flag = false;
|
|
|
- value.add(mp);
|
|
|
}
|
|
|
|
|
|
result.put("title", title);
|