From a2dd5b42824eff9626d1f48e1561be85f17f6107 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 23 十月 2026 16:36:19 +0800
Subject: [PATCH] 【丽水】指标统计查看详情里面问题重复了,本来应该只有3条,里面18条
---
smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateScriptServiceImpl.java | 40 ++++++++++++++++++++++------------------
1 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateScriptServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateScriptServiceImpl.java
index 0f9761f..d2a72ef 100644
--- a/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateScriptServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/SvyLibTemplateScriptServiceImpl.java
@@ -16,6 +16,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import java.util.Objects;
import static net.sf.jsqlparser.parser.feature.Feature.values;
@@ -157,25 +158,28 @@
}
}
itemCounts.forEach(itemCount ->{
- if(ObjectUtils.isNotEmpty(count.getScriptid()) && ObjectUtils.isNotEmpty(itemCount.getScriptid())){
- if(count.getScriptid().equals(itemCount.getScriptid())){
- //鏀惧叆缁熻淇℃伅
- itemCount.setScriptContent(count.getScriptContent());
- itemCount.setScriptType(count.getScriptType());
- itemCount.setSubtaskType(count.getSubtaskType());
- itemCount.setCompletedQuantity(count.getCompletedQuantity());
- itemCount.setAllQuantity(count.getAllQuantity());
- itemCount.setCompletedPercentage(count.getCompletedPercentage());
- itemCount.setTemplateid(count.getTemplateid());
- //璁$畻閫夋嫨姣斾緥
- int chosenQuantity = ObjectUtils.isNotEmpty(itemCount.getChosenQuantity())?itemCount.getChosenQuantity():0;
- int completedQuantity = itemCount.getCompletedQuantity();
- if(ObjectUtils.isNotEmpty(completedQuantity) && completedQuantity != 0){
- BigDecimal chosenPercentage = (new BigDecimal(chosenQuantity)).divide(new BigDecimal(completedQuantity), 2, RoundingMode.HALF_UP);
- itemCount.setChosenPercentage(chosenPercentage.toString());
- }
- itemCountMap.put(itemCount.getOptionText(), itemCount);
+ //鏄庣粏琛屽凡鎸夆�滈鐩唴瀹�+浠诲姟绫诲瀷鈥濊仛鍚堬紝涓嶈兘鐢� scriptid 鍖归厤锛堝悓涓�閬撻鍦ㄦ瘡涓换鍔℃ā鏉块噷鐨� scriptid 閮戒笉鍚岋級
+ boolean sameQuestion = ObjectUtils.isNotEmpty(count.getScriptContent())
+ && ObjectUtils.isNotEmpty(itemCount.getScriptContent())
+ && count.getScriptContent().equals(itemCount.getScriptContent())
+ && Objects.equals(count.getSubtaskType(), itemCount.getSubtaskType());
+ if(sameQuestion){
+ //鏀惧叆缁熻淇℃伅
+ itemCount.setScriptContent(count.getScriptContent());
+ itemCount.setScriptType(count.getScriptType());
+ itemCount.setSubtaskType(count.getSubtaskType());
+ itemCount.setCompletedQuantity(count.getCompletedQuantity());
+ itemCount.setAllQuantity(count.getAllQuantity());
+ itemCount.setCompletedPercentage(count.getCompletedPercentage());
+ itemCount.setTemplateid(count.getTemplateid());
+ //璁$畻閫夋嫨姣斾緥
+ int chosenQuantity = ObjectUtils.isNotEmpty(itemCount.getChosenQuantity())?itemCount.getChosenQuantity():0;
+ int completedQuantity = itemCount.getCompletedQuantity();
+ if(ObjectUtils.isNotEmpty(completedQuantity) && completedQuantity != 0){
+ BigDecimal chosenPercentage = (new BigDecimal(chosenQuantity)).divide(new BigDecimal(completedQuantity), 2, RoundingMode.HALF_UP);
+ itemCount.setChosenPercentage(chosenPercentage.toString());
}
+ itemCountMap.put(itemCount.getOptionText(), itemCount);
}
});
List<ServiceSubtaskScriptCount> details = new ArrayList<>(itemCountMap.values());
--
Gitblit v1.9.3