“mitao”
2026-03-25 309b5eb17c510c781daec96bbfef3b693f3a4d7e
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package com.estate.expert.admin.stat.report.data.impl;
 
import com.alibaba.fastjson.JSONObject;
import com.estate.expert.admin.domain.exam.eval.score.ScoreValue;
import com.estate.expert.admin.stat.report.data.SystemReportData;
import com.estate.expert.admin.utils.tree.TreeNode;
import lombok.experimental.SuperBuilder;
 
/**
 * 综合体系报告数据
 * 用于生成第三方评估报告
 */
@SuperBuilder
public class SystemFuzzyReportData extends SystemReportData {
 
    /**
     * 构建摘要信息
     * @return 摘要信息
     */
    @Override
    protected JSONObject buildAbstractInfo(){
        var root = getFuzzyRoot();
        if(root==null)
            return new JSONObject();
        var abstractInfo = new JSONObject();
        abstractInfo.put("项目综合评分", formatFloat(root.getData().getScore()));
        abstractInfo.put("项目综合评价", root.getData().getRiskLevel().getDesc());
 
        var scoreArr = new JSONObject();
        sysResult.root().getChildren().values().forEach(node -> {
            var name = node.getName();
            var score = formatFloat(node.getData().getScore());
            scoreArr.put(name, score);
        });
        abstractInfo.put("分项得分", scoreArr);
        return abstractInfo;
    }
 
    /**
     * 构建节点
     * @param info 信息
     */
    @Override
    protected void buildNode(JSONObject info, TreeNode<ScoreValue> c){
        var parentWeight = c.getParent() == null ? 1f : c.getParent().getData().getWeight();
        info.put("权重", formatFloatF4(c.getData().getWeight() * parentWeight ));
        info.put("得分", formatFloat(c.getData().getScore()));
    }
 
}