diff --git a/src/main/java/com/biutag/supervision/service/RiskScoreRuleService.java b/src/main/java/com/biutag/supervision/service/RiskScoreRuleService.java index 402dd59..3eb9a28 100644 --- a/src/main/java/com/biutag/supervision/service/RiskScoreRuleService.java +++ b/src/main/java/com/biutag/supervision/service/RiskScoreRuleService.java @@ -33,17 +33,8 @@ public class RiskScoreRuleService extends ServiceImpl riskClasses = riskScoreRuleMapper.selectListAll(); List treeList = riskClasses.stream().filter(item -> item.getPid() != 0).toList(); List models = modelService.list(); - - // id, root item根目录 Map map = rootsList.stream().collect(Collectors.toMap(RiskClassModel::getId, Function.identity(), (newVal, oldVal) -> newVal)); - - // pid, treeList 子目录 Map> treeMap = treeList.stream().collect(Collectors.groupingBy(RiskClassModel::getPid)); - -// Map> modelMap = models.stream().collect(Collectors.groupingBy(Model::getRiskScoreRuleId)); - - - // pid,子目录 Map> rootChildren = new HashMap<>(); for (Map.Entry> entry : treeMap.entrySet()) { List trees = entry.getValue(); @@ -54,7 +45,6 @@ public class RiskScoreRuleService extends ServiceImpl list = new ArrayList<>(); -// list.addAll(rootsList.stream().map(item -> { -// RiskTree node = new RiskTree(); -// node.setId(item.getId()); -// node.setRiskName(item.getName()); -// node.setSize(item.getSize()); -// node.setType("modelClass"); -// List children = models.stream().filter( -// model -> { -// for (RiskClassModel riskClassModel : treeList) { -// boolean b = item.getId().equals(riskClassModel.getPid()) && riskClassModel.getId().equals(model.getRiskScoreRuleId()); -// System.out.println("测试1当前item:【id:" + item.getId() + ",pid:" + item.getPid() -// + "】,当前model:【id:" + model.getId() + ",risk_id:" + model.getRiskScoreRuleId() -// + "】,当前riskClassModel:【id:" + riskClassModel.getId() + ",pid:" + riskClassModel.getPid() -// + ",name:" + riskClassModel.getName() + ",size:" + riskClassModel.getSize()); -// return b; -// } -// System.out.println("测试2当前item:【id:" + item.getId() + ",pid:" + item.getPid() -// + "】,当前model:【id:" + model.getId() + ",risk_id:" + model.getRiskScoreRuleId() -// + "】"); -// return false; -// } -// ).map(RiskTree::of).toList(); -// node.setChildren(children); -// return node; -// }).toList()); -// return list; } public List oldBuildTree() {