From 0d243e7f5dc593cdc6e0608bb52cd635f8fc6982 Mon Sep 17 00:00:00 2001
From: zxl <763096477@qq.com>
Date: 星期五, 19 九月 2025 11:59:44 +0800
Subject: [PATCH] 新需求
---
ycl-server/src/main/java/com/ycl/platform/service/impl/CheckScoreServiceImpl.java | 52 +++++++++++++++++++++++++++++++---------------------
1 files changed, 31 insertions(+), 21 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 196e733..bf361f3 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
@@ -179,35 +179,45 @@
}
}
//鍒嗘暟淇濈暀涓�浣嶅皬鏁�
- checkScores.stream().forEach(item -> item.setScore(item.getScore().setScale(1, RoundingMode.HALF_UP)));
-
+ checkScores.stream().forEach(item -> item.setScore(item.getScore().setScale(3, RoundingMode.HALF_UP)));
Map<Long, List<CheckScore>> map = checkScores.stream().collect(Collectors.groupingBy(CheckScore::getDeptId));
- log.error("map :{}",map);
-
for (Map.Entry<Long, List<CheckScore>> entry : map.entrySet()) {
- List<CheckScore> tempList = new ArrayList<>(); // 涓存椂瀛樺偍闇�瑕佹坊鍔犵殑鍏冪礌
- Iterator<CheckScore> iterator = entry.getValue().iterator();
- while (iterator.hasNext()) {
- CheckScore listCheckScore = iterator.next();
- if (listCheckScore.getExamineCategory() == 1 && entry.getValue().size() == 1) {
- CheckScore face = new CheckScore();
- face.setExamineCategory((short) 2);
- face.setScore(new BigDecimal("0.0"));
- CheckScore car = new CheckScore();
- car.setExamineCategory((short) 3);
- car.setScore(new BigDecimal("0.0"));
- tempList.add(face);
- tempList.add(car);
- }
- }
+ 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.00"));
+ tempList.add(car);
+ }
+ if (!hasFace){
+ CheckScore face = new CheckScore();
+ face.setExamineCategory((short) 3);
+ face.setScore(new BigDecimal("0.00"));
+ tempList.add(face);
+ }
+
+ return tempList;
+ }
+
private void getCheckScore(CheckScore checkScore) {
checkScore.setStartDate(DateUtils.getDayStart(checkScore.getStartDate()));
checkScore.setEndDate(DateUtils.getDayEnd(checkScore.getEndDate()));
--
Gitblit v1.8.0