From b44db60114b159cd438a0fe0259b9ddc94a16ba3 Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期二, 06 一月 2026 16:45:07 +0800
Subject: [PATCH] 【市一】随访满意度明细调整
---
smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java | 51 ++++++++++++++++++++++++++++++++-------------------
1 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
index 34be16f..28e168c 100644
--- a/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
+++ b/smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -3049,35 +3049,48 @@
allItemCounts = serviceSubtaskMapper.getSfStatisticsScriptItemDetails(serviceSubtaskCountReq);
}
-
for(ServiceSubtaskScriptCount count : allCounts){
Map<String, ServiceSubtaskScriptCount> itemCountMap = new HashMap<>();
- if(ObjectUtils.isNotEmpty(count.getOptions())){
- String[] optionsArray = count.getOptions().split(",");
- List<String> optionsList = Arrays.stream(optionsArray).map(String::valueOf).collect(Collectors.toList());
- if(ObjectUtils.isNotEmpty(optionsList)){
- //濉叆绌虹櫧淇℃伅
- optionsList.forEach(option ->{
- ServiceSubtaskScriptCount emptyCount = new ServiceSubtaskScriptCount();
- emptyCount.setScriptContent(count.getScriptContent());
- emptyCount.setScriptType(count.getScriptType());
- emptyCount.setCompletedQuantity(count.getCompletedQuantity());
- emptyCount.setAllQuantity(count.getAllQuantity());
- emptyCount.setChosenQuantity(0);
- emptyCount.setChosenPercentage("0.0");
- itemCountMap.put(option,emptyCount);
- });
+ //闂嵎鍔犱笂绌虹櫧閫夐」
+ if(ObjectUtils.isNotEmpty(count.getTemplateid())
+ && ObjectUtils.isNotEmpty(count.getSubtaskType())
+ && count.getSubtaskType().equals("2")){
+ SvyTaskTemplateScriptVO svyTaskTemplateScriptVO = new SvyTaskTemplateScriptVO();
+ svyTaskTemplateScriptVO.setId(count.getScriptid());
+ SvyTaskTemplateScriptVO svyTaskTemplateScriptResultVo = svyTaskTemplateScriptService.selectInfoByCondition(svyTaskTemplateScriptVO);
+ if(ObjectUtils.isNotEmpty(svyTaskTemplateScriptResultVo)){
+ List<SvyTaskTemplateTargetoption> svyTaskTemplateTargetoptions = svyTaskTemplateScriptResultVo.getSvyTaskTemplateTargetoptions();
+ if(ObjectUtils.isNotEmpty(svyTaskTemplateTargetoptions)){
+ //濉叆绌虹櫧淇℃伅
+ svyTaskTemplateTargetoptions.forEach(targetoption ->{
+ ServiceSubtaskScriptCount emptyCount = new ServiceSubtaskScriptCount();
+ emptyCount.setScriptid(count.getScriptid());
+ emptyCount.setScriptContent(count.getScriptContent());
+ emptyCount.setScriptType(count.getScriptType());
+ emptyCount.setSubtaskType(count.getSubtaskType());
+ emptyCount.setCompletedQuantity(count.getCompletedQuantity());
+ emptyCount.setAllQuantity(count.getAllQuantity());
+ emptyCount.setCompletedPercentage(count.getCompletedPercentage());
+ emptyCount.setTemplateid(count.getTemplateid());
+ emptyCount.setChosenQuantity(0);
+ emptyCount.setChosenPercentage("0.0");
+ emptyCount.setOptionText(targetoption.getOptioncontent());
+ itemCountMap.put(targetoption.getOptioncontent(),emptyCount);
+ });
+ }
}
}
- List<ServiceSubtaskScriptCount> itemCounts = new ArrayList<>();
allItemCounts.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();
@@ -3085,11 +3098,11 @@
BigDecimal chosenPercentage = (new BigDecimal(chosenQuantity)).divide(new BigDecimal(completedQuantity), 2, RoundingMode.HALF_UP);
itemCount.setChosenPercentage(chosenPercentage.toString());
}
- itemCountMap.put(count.getOptionText(), itemCount);
+ itemCountMap.put(itemCount.getOptionText(), itemCount);
}
}
});
- itemCounts = new ArrayList<>(itemCountMap.values());
+ List<ServiceSubtaskScriptCount> itemCounts = new ArrayList<>(itemCountMap.values());
count.setDetails(itemCounts);
result.put(count.getScriptid().toString(),count);
}
--
Gitblit v1.9.3