From 6da8bd9bf08a75e3d026505f23c008f3b8188c22 Mon Sep 17 00:00:00 2001
From: fuliqi <fuliqi@qq.com>
Date: 星期三, 13 十一月 2024 18:52:39 +0800
Subject: [PATCH] OSD通过国标码判断通道、数据中心车辆人脸在线率离线时间点
---
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java | 88 +++++++++++++++++++++----------------------
1 files changed, 43 insertions(+), 45 deletions(-)
diff --git a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
index 8fd7965..496430d 100644
--- a/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
+++ b/ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java
@@ -304,35 +304,25 @@
*/
@Override
public void exportIndex(HttpServletResponse response, CheckResultExportDTO exportDTO) throws IOException {
-// String date = exportDTO.getDate();
- //濡傛灉璇锋眰鍙傛暟鏃堕棿涓虹┖锛屾煡杩欐潯璁板綍鐨勬椂闂�
-// if (StringUtils.isEmpty(exportDTO.getDate()) && CollectionUtils.isEmpty(exportDTO.getQuarter())) {
-// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM");
-// if (exportDTO.getId() != null) {
-// CheckScore checkScore = getById(exportDTO.getId());
-// Date createTime = checkScore.getCreateTime();
-// date = formatter.format(createTime);
-// } else {
-// //闃叉鍗$墖椤甸潰瀵煎嚭涓嶄紶scoreId锛屽鑷存姤閿�
-// date = formatter.format(new Date());
-// }
-// }
-
+ //娌℃湁鏍囩榛樿鍏ㄥ
+ if(CollectionUtils.isEmpty(exportDTO.getExamineTags())){
+ exportDTO.setExamineTags(Arrays.asList(0,1,2));
+ }
/** 瀵间笁寮爏heet */
//杞﹁締
- CheckIndexCar checkIndexCar = new CheckIndexCar();
-// checkIndexCar.setDate(date);
- checkIndexCar.setQuarter(exportDTO.getQuarter());
- checkIndexCar.setDeptId(exportDTO.getDeptId());
- checkIndexCar.setDeptIds(exportDTO.getDeptIds());
- //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯�
- roleControl(checkIndexCar);
List<CheckIndexCar> checkIndexCars = new ArrayList<>();
+ //杞﹁締鍜屼汉鑴告病鏈夊叕瀹夐儴
for (Integer examineTag : exportDTO.getExamineTags()) {
+ if(examineTag ==2) continue;
+ CheckIndexCar checkIndexCar = new CheckIndexCar();
+// checkIndexCar.setDate(date);
+ checkIndexCar.setQuarter(exportDTO.getQuarter());
+ checkIndexCar.setDeptId(exportDTO.getDeptId());
+ checkIndexCar.setDeptIds(exportDTO.getDeptIds());
+ //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯�
+ roleControl(checkIndexCar);
checkIndexCar.setExamineTag(Short.valueOf(examineTag + ""));
- if (examineTag == 0) {
- checkIndexCar.setExamineTagQuery(1);
- }
+
checkIndexCars.addAll(indexCarService.selectCheckIndexCarList(checkIndexCar));
}
//璁$畻骞冲潎鍊兼斁鍦╡xcel鏈�鍚�
@@ -367,20 +357,19 @@
checkIndexCarVOS.add(excelVo);
}
ExcelExp e1 = new ExcelExp("杞﹁締鑰冩牳鎸囨爣鏁版嵁", checkIndexCarVOS, CheckIndexCarVO.class);
+
//浜鸿劯
- CheckIndexFace checkIndexFace = new CheckIndexFace();
-// checkIndexFace.setDate(date);
- checkIndexFace.setQuarter(exportDTO.getQuarter());
- checkIndexFace.setDeptId(exportDTO.getDeptId());
- checkIndexFace.setDeptIds(exportDTO.getDeptIds());
- //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯�
- roleControl(checkIndexFace);
List<CheckIndexFace> checkIndexFaces = new ArrayList<>();
for (Integer examineTag : exportDTO.getExamineTags()) {
+ if(examineTag ==2) continue;
+ CheckIndexFace checkIndexFace = new CheckIndexFace();
+// checkIndexFace.setDate(date);
+ checkIndexFace.setQuarter(exportDTO.getQuarter());
+ checkIndexFace.setDeptId(exportDTO.getDeptId());
+ checkIndexFace.setDeptIds(exportDTO.getDeptIds());
+ //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯�
+ roleControl(checkIndexFace);
checkIndexFace.setExamineTag(Short.valueOf(examineTag + ""));
- if (examineTag == 0) {
- checkIndexFace.setExamineTagQuery(1);
- }
checkIndexFaces.addAll(indexFaceService.selectCheckIndexFaceList(checkIndexFace));
}
//璁$畻骞冲潎鍊兼斁鍦╡xcel鏈�鍚�
@@ -415,20 +404,18 @@
checkIndexFaceVOS.add(excelVo);
}
ExcelExp e2 = new ExcelExp("浜鸿劯鑰冩牳鎸囨爣鏁版嵁", checkIndexFaceVOS, CheckIndexFaceVO.class);
+
//瑙嗛
- CheckIndexVideo checkIndexVideo = new CheckIndexVideo();
-// checkIndexVideo.setDate(date);
- checkIndexVideo.setQuarter(exportDTO.getQuarter());
- checkIndexVideo.setDeptId(exportDTO.getDeptId());
- checkIndexVideo.setDeptIds(exportDTO.getDeptIds());
- //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯�
- roleControl(checkIndexVideo);
List<CheckIndexVideo> checkIndexVideos = new ArrayList<>();
for (Integer examineTag : exportDTO.getExamineTags()) {
+ CheckIndexVideo checkIndexVideo = new CheckIndexVideo();
+// checkIndexVideo.setDate(date);
+ checkIndexVideo.setQuarter(exportDTO.getQuarter());
+ checkIndexVideo.setDeptId(exportDTO.getDeptId());
+ checkIndexVideo.setDeptIds(exportDTO.getDeptIds());
+ //鏉冮檺鎺у埗 鍙兘鏌ョ湅宸插彂甯�
+ roleControl(checkIndexVideo);
checkIndexVideo.setExamineTag(Short.valueOf(examineTag + ""));
- if (examineTag == 0) {
- checkIndexVideo.setExamineTagQuery(1);
- }
checkIndexVideos.addAll(indexVideoService.selectCheckIndexVideoList(checkIndexVideo));
}
//璁$畻骞冲潎鍊兼斁鍦╡xcel鏈�鍚�
@@ -448,6 +435,17 @@
List<CheckIndexVideo> provinceList = checkIndexVideos.stream().filter(video -> CheckConstants.Examine_Tag_Province.equals(video.getExamineTag())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(provinceList)) {
Map<Long, List<CheckIndexVideo>> videoMap = provinceList.stream().collect(Collectors.groupingBy(CheckIndexVideo::getDeptId));
+ List<CheckIndexVideo> videos = new ArrayList<>();
+ videoMap.forEach((deptId, list) -> {
+ CheckIndexVideo video = CheckIndexVideo.calculateAverage(list);
+ videos.add(video);
+ });
+ //鏍规嵁绉垎闄嶅簭
+ checkIndexVideos.addAll(videos.stream().sorted(Comparator.comparing(CheckIndexVideo::getScore).reversed()).collect(Collectors.toList()));
+ }
+ List<CheckIndexVideo> deptList = checkIndexVideos.stream().filter(video -> CheckConstants.Examine_Tag_Dept.equals(video.getExamineTag())).collect(Collectors.toList());
+ if (!CollectionUtils.isEmpty(deptList)) {
+ Map<Long, List<CheckIndexVideo>> videoMap = deptList.stream().collect(Collectors.groupingBy(CheckIndexVideo::getDeptId));
List<CheckIndexVideo> videos = new ArrayList<>();
videoMap.forEach((deptId, list) -> {
CheckIndexVideo video = CheckIndexVideo.calculateAverage(list);
@@ -548,7 +546,7 @@
//濉厖鍚勪釜鍖哄幙鏁版嵁
for (CheckScore checkScore : dashboard) {
Map<String, Object> map = new HashMap<>();
- map.put("score", checkScore.getScore().setScale(2,RoundingMode.HALF_UP));
+ map.put("score", checkScore.getScore().setScale(1,RoundingMode.HALF_UP));
resultMap.put(checkScore.getDeptName(), map);
}
return resultMap;
--
Gitblit v1.8.0