| | |
| | | package com.ots.project.tool.report.JAQ; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ots.common.enums.LangTypeEnum; |
| | | import com.ots.common.utils.StringUtils; |
| | |
| | | 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); |
| | |
| | | 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 -> { |
| | |
| | | } |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | List<String> listOfTopicNumbers = item.getListOfTopicNumbers(); |
| | | |
| | | //查找对于的主题目(根据JAQ题目编码,和语言类型找题目) |
| | | listOfTopicNumbers.stream().forEach(p -> { |
| | | String topic = queryTopic(langType, p); |
| | | if (StringUtils.isBlank(topic)) { |
| | |
| | | }); |
| | | return table4; |
| | | } |
| | | |
| | | List<Table3> getTable3(ReportAPIResult result, LangTypeEnum langType) { |
| | | List<Table3> table3 = result.getTable3(); |
| | | table3.stream().forEach(item -> { |
| | |
| | | }); |
| | | return table3; |
| | | } |
| | | |
| | | List<Table2> getTable2(ReportAPIResult result, LangTypeEnum langType) { |
| | | List<Table2> table2 = result.getTable2(); |
| | | table2.stream().forEach(item -> { |
| | |
| | | }); |
| | | return table2; |
| | | } |
| | | |
| | | List<Table1> getTable1(ReportAPIResult result, LangTypeEnum langType) { |
| | | List<Table1> table1 = result.getTable1(); |
| | | table1.stream().forEach(item -> { |
| | |
| | | }); |
| | | 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) { |