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
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
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_vehicle_device_inspection")
public class VehicleDeviceInspectionResult extends BaseResult {
 
    /**
     * 设备编号,dataType为1时表示卡口内码,dataType为11时表示采集设备内码
     */
    private String externalIndexCode;
 
    /**
     * 设备名称
     */
    private String deviceName;
 
 
    /**
     * 卡口内码或采集设备内码
     */
    private String indexCode;
 
    /**
     * 组织编号
     */
    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 SnapUnique snapUnique;
 
    /**
     * 车辆车牌合规性相关
     */
    private SnapPlate snapPlate;
 
    /**
     * 车辆属性完整性相关数量
     */
    private Integrity integrity;
 
    public String getSnapResultText() {
        if (snapResult == 1) {
            snapResultText = "正常";
        }
        if (snapResult == 2) {
            snapResultText = "无数据";
        }
        if (snapResult == 4) {
            snapResultText = "数据量少";
        }
        return snapResultText;
    }
 
    // 内嵌对象定义
 
    @Data
    public static class SnapClock {
        /**
         * 时钟准确率:1 == 100%
         */
        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 {
        /**
         * 及时率 1 == 100%
         */
        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 SnapUnique {
        /**
         * 不唯一数据量:不唯一数据重复量
         */
        private Integer nouniqueData;
 
        /**
         * 不唯一数据量
         */
        private Integer nouniqueCount;
    }
 
    @Data
    public static class SnapPlate {
        /**
         * 车牌未识别量
         */
        private Integer noNumberCount;
 
        /**
         * 白天未识别量
         */
        private Integer dayNoNumberCount;
 
        /**
         * 车牌识别异常:结果类型 1:正常 2:识别率低 3:昼夜识别率突变
         */
        private Integer recgResult;
 
        /**
         * 车牌识别异常:结果类型 1:正常 2:识别率低 3:昼夜识别率突变
         */
        private String recgResultText;
 
        public String getRecgResultText() {
            if (recgResult == 1) {
                recgResultText = "正常";
            }
            if (recgResult == 2) {
                recgResultText = "识别率低";
            }
            if (recgResult == 3) {
                recgResultText = "昼夜识别率突变";
            }
            return recgResultText;
        }
    }
 
    @Data
    public static class Integrity {
        /**
         * 车牌号不完整量
         */
        private Integer plateNoItgrCount;
 
        /**
         * 车牌颜色不完整量
         */
        private Integer plateColorItgrCount;
 
        /**
         * 车辆类型不完整量
         */
        private Integer vehTypeItgrCount;
 
        /**
         * 车辆品牌不完整量
         */
        private Integer vehBrandItgrCount;
 
        /**
         * 车辆颜色不完整量
         */
        private Integer vehColorItgrCount;
 
        /**
         * 车辆型号不完整量
         */
        private Integer vehModelItgrCount;
 
        /**
         * 主要属性不完整量
         */
        private Integer mainNoIntegrityCount;
 
        /**
         * 全量属性不完整量
         */
        private Integer noIntegrityCount;
    }
 
    public static SnapClockVO getVO(VehicleDeviceInspectionResult 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;
    }
}