| | |
| | | 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; |
| | | |
| | |
| | | } |
| | | } |
| | | itemCounts.forEach(itemCount ->{ |
| | | if(ObjectUtils.isNotEmpty(count.getScriptid()) && ObjectUtils.isNotEmpty(itemCount.getScriptid())){ |
| | | if(count.getScriptid().equals(itemCount.getScriptid())){ |
| | | //明细行已按“题目内容+任务类型”聚合,不能用 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.setChosenPercentage(chosenPercentage.toString()); |
| | | } |
| | | itemCountMap.put(itemCount.getOptionText(), itemCount); |
| | | } |
| | | } |
| | | }); |
| | | List<ServiceSubtaskScriptCount> details = new ArrayList<>(itemCountMap.values()); |