liujie
2026-05-21 34fb8efd9fef8a6ed0d7cbaff74f37f06bf2db60
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
package com.estate.expert.admin.domain.exam.eval;
 
import com.estate.expert.admin.domain.business.client.Client;
import com.estate.expert.admin.domain.common.EntityBase;
import com.estate.expert.admin.domain.exam.task.check.CheckTask;
import com.estate.expert.admin.domain.plan.Plan;
import com.estate.expert.admin.domain.project.Project;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.hibernate.annotations.Type;
 
import javax.persistence.*;
import java.util.UUID;
 
@Getter
@Setter
@NoArgsConstructor
@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name = "type")
public class EvalResult extends EntityBase {
 
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "check_task_id", nullable = false)
    private CheckTask task;
 
    /**
     * 实际评分
     */
    private float score;
 
    /**
     * 用于地图显示的矫正分数
     */
    private float displayScore;
 
    /**
     * 评分结果
     */
    @Type(type = "io.hypersistence.utils.hibernate.type.json.JsonType")
    @Column(columnDefinition = "json")
    private int[]errorCounts;
 
    /////   以下数据都是从task中获取的,为了方便查询,冗余存储
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "plan_id")
    private Plan plan;
 
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "project_id")
    private Project project;
 
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "client_id")
    private Client client;
 
    private boolean containSystemRes;
    /**
     * 是否有设备评分
     */
    private boolean containDeviceRes;
 
    public EvalResult(CheckTask task, float score) {
        this.setName(UUID.randomUUID().toString());
        this.task = task;
        this.score = score;
        this.displayScore = score;
        this.plan = task.getPlan();
        this.project = task.getProject();
        this.client = task.getProject().getClient();
    }
}