|
@@ -39,4 +39,22 @@ public class IndicatorService {
|
|
|
m.forEach((k, v) -> allTree.getChildren().add(new TreeNode(k, k, v)));
|
|
|
return R.ok(res);
|
|
|
}
|
|
|
+
|
|
|
+ public R<List<TreeNode>> allIndicator() {
|
|
|
+ List<PerCfgIndicator> indicators = perCfgIndicatorMapper.all();
|
|
|
+ Map<String, List<TreeNode>> m = new HashMap<>();
|
|
|
+ TreeNode allTree = new TreeNode("所有指标", "所有指标", new ArrayList<>());
|
|
|
+ List<TreeNode> res = new ArrayList<>();
|
|
|
+ res.add(allTree);
|
|
|
+ indicators.forEach(i -> {
|
|
|
+ String indicatorType = i.getIndicatorType();
|
|
|
+ String indicatorCn = i.getIndicatorCn();
|
|
|
+ String indicatorId = i.getIndicatorEn();
|
|
|
+ TreeNode t = new TreeNode(indicatorCn, indicatorId, null);
|
|
|
+ m.putIfAbsent(indicatorType, new ArrayList<>());
|
|
|
+ m.get(indicatorType).add(t);
|
|
|
+ });
|
|
|
+ m.forEach((k, v) -> allTree.getChildren().add(new TreeNode(k, k, v)));
|
|
|
+ return R.ok(res);
|
|
|
+ }
|
|
|
}
|