tuqin
6 天以前 c35bd84886fb0c4e4ee0ffeeb3819a8a8df532b5
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
package cn.iocoder.yudao.module.mes.controller.admin.safety.vo.dashboard;
 
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
 
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
 
/**
 * 安全生产 - 可视化看板 Response VO
 *
 * 聚合风险、隐患、作业票、培训、证书的统计数据,供看板一次性渲染
 *
 * @author 超级管理员
 */
@Schema(description = "管理后台 - 安全生产看板 Response VO")
@Data
public class MesSafetyDashboardRespVO {
 
    // ==================== 风险 ====================
 
    @Schema(description = "风险总数", example = "25")
    private Long riskTotal;
 
    @Schema(description = "风险等级分布")
    private List<NameCount> riskLevelStats;
 
    @Schema(description = "风险按车间分布(Top 10)")
    private List<NameCount> riskByWorkshop;
 
    // ==================== 隐患 ====================
 
    @Schema(description = "隐患统计")
    private HazardStats hazardStats;
 
    @Schema(description = "隐患按车间分布(Top 10)")
    private List<NameCount> hazardByWorkshop;
 
    // ==================== 作业票 ====================
 
    @Schema(description = "作业票统计")
    private TicketStats ticketStats;
 
    // ==================== 培训 ====================
 
    @Schema(description = "培训统计")
    private TrainingStats trainingStats;
 
    // ==================== 证书 ====================
 
    @Schema(description = "证书统计")
    private CertificateStats certificateStats;
 
    // ==================== 最近动态 ====================
 
    @Schema(description = "最近隐患(5 条)")
    private List<RecentHazard> recentHazards;
 
    @Schema(description = "最近作业票(5 条)")
    private List<RecentTicket> recentTickets;
 
    // ==================== 内部类 ====================
 
    @Schema(description = "名称-数量")
    @Data
    public static class NameCount {
        @Schema(description = "名称", example = "重大风险")
        private String name;
        @Schema(description = "数量", example = "3")
        private Long count;
        @Schema(description = "附加项:等级编码,用于前端配色", example = "1")
        private Integer extra;
 
        public NameCount() {}
 
        public NameCount(String name, Long count) {
            this.name = name;
            this.count = count;
        }
 
        public NameCount(String name, Long count, Integer extra) {
            this.name = name;
            this.count = count;
            this.extra = extra;
        }
    }
 
    @Schema(description = "隐患统计")
    @Data
    public static class HazardStats {
        @Schema(description = "隐患总数")
        private Long total;
        @Schema(description = "待整改")
        private Long pending;
        @Schema(description = "整改中")
        private Long rectifying;
        @Schema(description = "待验收")
        private Long toCheck;
        @Schema(description = "已闭环")
        private Long closed;
        @Schema(description = "已超期(未闭环且超过整改期限)")
        private Long overdue;
        @Schema(description = "整改闭环率(%)")
        private BigDecimal closedRate;
    }
 
    @Schema(description = "作业票统计")
    @Data
    public static class TicketStats {
        @Schema(description = "作业票总数")
        private Long total;
        @Schema(description = "待审批")
        private Long pending;
        @Schema(description = "已批准")
        private Long approved;
        @Schema(description = "已完工")
        private Long finished;
        @Schema(description = "已归档")
        private Long archived;
        @Schema(description = "已驳回")
        private Long rejected;
        @Schema(description = "已批准但超计划结束时间")
        private Long overdue;
    }
 
    @Schema(description = "培训统计")
    @Data
    public static class TrainingStats {
        @Schema(description = "培训总数")
        private Long total;
        @Schema(description = "已完成")
        private Long finished;
        @Schema(description = "进行中")
        private Long ongoing;
        @Schema(description = "计划中")
        private Long planned;
        @Schema(description = "累计参训人次")
        private Long attendeeTotal;
        @Schema(description = "平均考试成绩")
        private BigDecimal avgScore;
    }
 
    @Schema(description = "证书统计")
    @Data
    public static class CertificateStats {
        @Schema(description = "证书总数")
        private Long total;
        @Schema(description = "有效")
        private Long valid;
        @Schema(description = "已过期")
        private Long expired;
        @Schema(description = "30 天内到期")
        private Long expiringSoon;
    }
 
    @Schema(description = "最近隐患")
    @Data
    public static class RecentHazard {
        @Schema(description = "编号")
        private Long id;
        @Schema(description = "隐患编码")
        private String code;
        @Schema(description = "隐患名称")
        private String name;
        @Schema(description = "隐患等级")
        private Integer hazardLevel;
        @Schema(description = "状态")
        private Integer status;
        @Schema(description = "发现日期")
        private LocalDate foundDate;
    }
 
    @Schema(description = "最近作业票")
    @Data
    public static class RecentTicket {
        @Schema(description = "编号")
        private Long id;
        @Schema(description = "作业票号")
        private String code;
        @Schema(description = "作业类型")
        private Integer ticketType;
        @Schema(description = "作业地点")
        private String workLocation;
        @Schema(description = "状态")
        private Integer status;
        @Schema(description = "创建时间")
        private LocalDateTime createTime;
    }
 
}