From 93af1c6ffb9ae0e894689ad3a37b548e57d54cff Mon Sep 17 00:00:00 2001 From: linzhijie <19970921lzj> Date: 星期四, 11 三月 2021 19:10:07 +0800 Subject: [PATCH] 有注释的测评系统业务代码 --- src/main/java/com/ots/project/tool/report/JAQ/JAQReport.java | 39 +++++++++++++++++++++++++++++++++------ 1 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/ots/project/tool/report/JAQ/JAQReport.java b/src/main/java/com/ots/project/tool/report/JAQ/JAQReport.java index 2bb8a36..78d6d35 100644 --- a/src/main/java/com/ots/project/tool/report/JAQ/JAQReport.java +++ b/src/main/java/com/ots/project/tool/report/JAQ/JAQReport.java @@ -1,4 +1,5 @@ package com.ots.project.tool.report.JAQ; + import com.alibaba.fastjson.JSONObject; import com.ots.common.enums.LangTypeEnum; import com.ots.common.utils.StringUtils; @@ -16,18 +17,33 @@ import com.ots.project.tool.report.reportCalculation.response.ReportAPIResult; import lombok.Getter; import lombok.Setter; + import java.util.*; + @Getter @Setter public class JAQReport { + TQuestionServiceImpl tQuestionService = AppUtil.getObject("examQuestion", TQuestionServiceImpl.class); - + + /** + * 宀椾綅鍚嶇О + */ private String postName; - + + /** + * 鎶ュ憡鐢熸垚鏃ユ湡 + */ private String reportGenerationDate; - + + /** + * 鎶ュ憡搴忓彿 + */ private String reportNumber; - + + /** + * @return + */ public List<Map<String, Object>> getTemplateParameters(ReportAPIResult result, LangTypeEnum langType) { Map<String, Object> infoMap = new HashMap(); infoMap.put("postName", postName); @@ -40,6 +56,7 @@ tableList.put("table4", getTable4(result, langType)); return Arrays.asList(infoMap, tableList); } + List<Table4> getTable4(ReportAPIResult result, LangTypeEnum langType) { List<Table4> table4 = result.getTable4(); table4.stream().forEach(item -> { @@ -49,7 +66,7 @@ } StringBuilder stringBuilder = new StringBuilder(); List<String> listOfTopicNumbers = item.getListOfTopicNumbers(); - + //鏌ユ壘瀵逛簬鐨勪富棰樼洰(鏍规嵁JAQ棰樼洰缂栫爜锛屽拰璇█绫诲瀷鎵鹃鐩�) listOfTopicNumbers.stream().forEach(p -> { String topic = queryTopic(langType, p); if (StringUtils.isBlank(topic)) { @@ -61,6 +78,7 @@ }); return table4; } + List<Table3> getTable3(ReportAPIResult result, LangTypeEnum langType) { List<Table3> table3 = result.getTable3(); table3.stream().forEach(item -> { @@ -71,6 +89,7 @@ }); return table3; } + List<Table2> getTable2(ReportAPIResult result, LangTypeEnum langType) { List<Table2> table2 = result.getTable2(); table2.stream().forEach(item -> { @@ -81,6 +100,7 @@ }); return table2; } + List<Table1> getTable1(ReportAPIResult result, LangTypeEnum langType) { List<Table1> table1 = result.getTable1(); table1.stream().forEach(item -> { @@ -91,7 +111,14 @@ }); return table1; } - + + /** + * 鏍规嵁姘镐箙缂栧彿鏌ヨ瑷�棰樼洰 + * + * @param langType + * @param permanentId + * @return + */ private String queryTopic(LangTypeEnum langType, String permanentId) { List<TQuestion> tQuestionList = tQuestionService.selectTQuestionByPermanentId(permanentId); if (Objects.isNull(tQuestionList) || tQuestionList.size() == 0) { -- Gitblit v1.9.1