fuliqi
2025-01-02 73caf5a7072976021f43a764ed2ad73404f4d040
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
package com.ycl.platform.domain.result.HK;
 
import com.ycl.platform.domain.result.BaseResult;
import com.ycl.platform.domain.vo.DataCenter.SnapClockVO;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.data.mongodb.core.index.TextIndexed;
import org.springframework.data.mongodb.core.mapping.Document;
 
/**
 * 人脸设备全检指标监测结果:人脸(设备抓拍图片时钟准确性)
 *
 * @author gonghl
 */
@Data
@Document(collection = "hk_face_device_inspection")
public class FaceDeviceInspectionResult extends BaseResult {
 
    /**
     * 设备名称
     */
    private String deviceName;
 
    /**
     * 设备编号
     */
    private String externalIndexCode;
 
    /**
     * 卡口内码或采集设备内码,dataType为1时表示卡口内码,dataType为2或11时表示采集设备内码
     */
    private String indexCode;
 
    /**
     * IP地址
     */
    private String networkAddr;
 
    /**
     * 组织编号
     */
    private String orgCode;
 
    /**
     * 组织名称
     */
    private String orgName;
 
    /**
     * 当日接收到的当日抓拍数据量
     */
    private Integer dataCount;
 
    /**
     * 当日接收到的白天抓拍数据量
     */
    private Integer daySnapCount;
 
    /**
     * 当日接收到的非当日抓拍数据量
     */
    private Integer noTodayCount;
 
    /**
     * 持续无数据天数
     */
    private Integer continueNoDataCount;
 
    /**
     * 抓拍数据量监测结果,1:正常 2:无数据 4:数据量少
     */
    private Integer snapResult;
 
    /**
     * 抓拍数据量监测结果,1:正常 2:无数据 4:数据量少
     */
    private String snapResultText;
 
    // 以下为嵌套对象的字段
 
    /**
     * 时钟准确性相关数据
     */
    private SnapClock snapClock;
 
    /**
     * 及时性相关数据
     */
    private SnapTimely snapTimely;
 
    /**
     * 建模有效性相关数据
     */
    private SnapValidity snapValidity;
 
    /**
     * 唯一性相关数据
     */
    private SnapUnique snapUnique;
 
    public String getSnapResultText() {
        if (snapResult == 1) {
            snapResultText = "正常";
        }
        if (snapResult == 2) {
            snapResultText = "无数据";
        }
        if (snapResult == 4) {
            snapResultText = "数据量少";
        }
        return snapResultText;
    }
 
    // 内嵌对象定义
 
    @Data
    public static class SnapClock {
        /**
         * 时钟准确率
         */
        private Float clockPercent;
 
        /**
         * 当日接收的当日抓拍数据时钟准确量
         */
        private Integer todayClockCount;
 
        /**
         * 当日接收的当日抓拍数据时钟准确性判定结果:1是合格,0是不合格
         */
        private Integer todayClockResult;
 
        /**
         * 当日接收的当日抓拍数据时钟准确性判定结果:1是合格,0是不合格
         */
        private String todayClockResultText;
 
        /**
         * 当日接收的全部抓拍数据中时钟准确数据量
         */
        private Integer allClockCount;
 
        /**
         * 当日接收的全部抓拍数据中时钟准确性判定结果:1是合格,0是不合格
         */
        private Integer allClockResult;
 
        /**
         * 当日接收的全部抓拍数据中时钟准确性判定结果:1是合格,0是不合格
         */
        private String allClockResultText;
 
        public String getTodayClockResultText() {
            if (todayClockResult == 1) {
                todayClockResultText = "合格";
            }
            if (todayClockResult == 0) {
                todayClockResultText = "不合格";
            }
            return todayClockResultText;
        }
 
        public String getAllClockResultText() {
            if (allClockResult == 1) {
                allClockResultText = "合格";
            }
            if (allClockResult == 0) {
                allClockResultText = "不合格";
            }
            return allClockResultText;
        }
    }
 
    @Data
    public static class SnapTimely {
        /**
         * 及时率
         */
        private Float timelyPercent;
 
        /**
         * 当日接收的当日数据延迟数据量
         */
        private Integer todayDelayCount;
 
        /**
         * 当日接收的当日数据延迟30s以上数据量
         */
        private Integer todayDelayCount2;
 
        /**
         * 当日接收的当日数据延迟1m以上数据量
         */
        private Integer todayDelayCount3;
 
        /**
         * 当日接收的当日数据延迟5m以上数据量
         */
        private Integer todayDelayCount4;
 
        /**
         * 当日接收的当日抓拍数据及时性判定结果:1是合格,0是不合格
         */
        private Integer todayTimelyResult;
 
        /**
         * 当日接收的当日抓拍数据及时性判定结果:1是合格,0是不合格
         */
        private String todayTimelyResultText;
 
        /**
         * 当日接收的全部抓拍数据中延迟数据量
         */
        private Integer allDelayCount;
 
        /**
         * 当日接收的全部抓拍数据中延迟30s以上数据量
         */
        private Integer allDelayCount2;
 
        /**
         * 当日接收的全部抓拍数据中延迟1m以上数据量
         */
        private Integer allDelayCount3;
 
        /**
         * 当日接收的全部抓拍数据中延迟5m以上数据量
         */
        private Integer allDelayCount4;
 
        /**
         * 当日接收的全部抓拍数据中及时性判定结果:1是合格,0是不合格
         */
        private Integer allTimelyResult;
 
        /**
         * 当日接收的全部抓拍数据中及时性判定结果:1是合格,0是不合格
         */
        private String allTimelyResultText;
 
        public String getTodayTimelyResultText() {
            if (todayTimelyResult == 1) {
                todayTimelyResultText = "合格";
            }
            if (todayTimelyResult == 0) {
                todayTimelyResultText = "不合格";
            }
            return todayTimelyResultText;
        }
 
        public String getAllTimelyResultText() {
            if (allTimelyResult == 1) {
                allTimelyResultText = "合格";
            }
            if (allTimelyResult == 0) {
                allTimelyResultText = "不合格";
            }
            return allTimelyResultText;
        }
    }
 
    @Data
    public static class SnapValidity {
        /**
         * 建模失败率
         */
        private Float failPercent;
 
        /**
         * 建模失败数据量
         */
        private Integer failCount;
 
        /**
         * 白天建模失败数据量
         */
        private Integer dayFailCount;
 
        /**
         * 低评分数据量
         */
        private Integer lowScoreCount;
 
        /**
         * 平均人脸低平分率
         */
        private Float lowScorePercent;
 
        /**
         * 白天人脸低平分数据量
         */
        private Integer dayLowCount;
    }
 
    @Data
    public static class SnapUnique {
        /**
         * 不唯一数据:设备编号、抓拍时间、人脸总评分相同认为数据相同,则该数据不唯一
         */
        private Integer nouniqueData;
 
        /**
         * 不唯一数据量:不唯一数据重复量
         */
        private Integer nouniqueCount;
    }
 
    public static SnapClockVO getVO(FaceDeviceInspectionResult result){
        SnapClockVO snapClockVO = new SnapClockVO();
        BeanUtils.copyProperties(result,snapClockVO);
        snapClockVO.setClockPercent(result.getSnapClock().getClockPercent());
        snapClockVO.setTodayClockCount(result.getSnapClock().getTodayClockCount());
        snapClockVO.setTodayClockResult(result.getSnapClock().getTodayClockResult());
        snapClockVO.setAllClockCount(result.getSnapClock().getAllClockCount());
        snapClockVO.setAllClockResult(result.getSnapClock().getAllClockResult());
        snapClockVO.setAllClockResultText(result.getSnapClock().getAllClockResultText());
        snapClockVO.setTodayClockResultText(result.getSnapClock().getTodayClockResultText());
        return snapClockVO;
    }
}