From 3b0516a2959e25576e4f3fda697a3b025d06c8c9 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期二, 24 六月 2025 14:09:07 +0800
Subject: [PATCH] 每日录像可用指标添加日志,修改大屏为查看当前月平均
---
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java | 39 +++++++++++++++++++++++++++++++++++++--
1 files changed, 37 insertions(+), 2 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 57a706f..7e514d4 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
@@ -167,7 +167,7 @@
// }
List<CheckScore> checkScores = scoreMapper.selectCheckScoreMap(checkScore);
-
+ log.error("鎵撳嵃锛歿}",checkScores);
// 濡傛灉鏁版嵁涓虹┖锛屽垯鏌ヨ涔嬪墠鐨勬暟鎹�
if (CollectionUtils.isEmpty(checkScores) && (query.getStartDate() ==null || query.getStartDate() ==null)) {
CheckScore one = scoreMapper.getLast(checkScore);
@@ -180,7 +180,42 @@
}
//鍒嗘暟淇濈暀涓�浣嶅皬鏁�
checkScores.stream().forEach(item -> item.setScore(item.getScore().setScale(1, RoundingMode.HALF_UP)));
- return checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
+ Map<Long, List<CheckScore>> map = checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
+ for (Map.Entry<Long, List<CheckScore>> entry : map.entrySet()) {
+ List<CheckScore> tempList = getCheckScores(entry);
+ // 杩唬缁撴潫鍚庯紝灏嗘柊鍏冪礌娣诲姞鍒板師濮嬪垪琛ㄤ腑
+ entry.getValue().addAll(tempList);
+ }
+ return map;
+ }
+
+ private List<CheckScore> getCheckScores(Map.Entry<Long, List<CheckScore>> entry) {
+ List<CheckScore> tempList = new ArrayList<>(); // 涓存椂瀛樺偍闇�瑕佹坊鍔犵殑鍏冪礌
+
+ boolean hasFace = false;
+ boolean hasCar = false;
+ for (int i =0;i <entry.getValue().size();i++) {
+ CheckScore checkScore = entry.getValue().get(i);
+ if (checkScore.getExamineCategory() == 2){
+ hasCar = true;
+ }else if (checkScore.getExamineCategory() == 3){
+ hasFace = true;
+ }
+ }
+ if (!hasCar){
+ CheckScore car = new CheckScore();
+ car.setExamineCategory((short) 2);
+ car.setScore(new BigDecimal("0.0"));
+ tempList.add(car);
+ }
+ if (!hasFace){
+ CheckScore face = new CheckScore();
+ face.setExamineCategory((short) 3);
+ face.setScore(new BigDecimal("0.0"));
+ tempList.add(face);
+ }
+
+ return tempList;
}
private void getCheckScore(CheckScore checkScore) {
--
Gitblit v1.8.0