| | |
| | | import com.ots.project.tool.report.SAQ.condition.SAQConditionVO; |
| | | import com.ots.project.tool.report.SAQ.condition.SAQSummary; |
| | | import com.ots.project.tool.report.SAQ.condition.SAQSummaryCondition; |
| | | import com.ots.project.tool.report.SAQ.gs.condition.ResponseFidelityDiagnosisSAQGs; |
| | | import com.ots.project.tool.report.SAQ.gs.condition.ResponseFidelityDiagnosisSAQGsTitle; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | import lombok.extern.slf4j.Slf4j; |
| | |
| | | private String reportGenerationDate; |
| | | private String userName; |
| | | private ReportTypeEnum reportTypeEnum; |
| | | //邮箱 |
| | | private String questionnaireEmail; |
| | | |
| | | private Map otherParams; |
| | | |
| | | private LangTypeEnum langType; |
| | | |
| | | /** |
| | | * 初始化条件 |
| | | * @param reportTypeEnum |
| | | * @return |
| | | */ |
| | | public List<BaseCondition> getParamList(ReportTypeEnum reportTypeEnum) { |
| | | return init(reportTypeEnum); |
| | | } |
| | | |
| | | /** |
| | | * 初始化所有报告参数 |
| | | * @param reportTypeEnum |
| | | * @return |
| | | */ |
| | | private List<BaseCondition> init(ReportTypeEnum reportTypeEnum) { |
| | | List<BaseCondition> paramList = new ArrayList<>(); |
| | | |
| | |
| | | SimpleMessage simpleMessage = new SimpleMessage(p); |
| | | return simpleMessage; |
| | | }).collect(Collectors.toList())); |
| | | |
| | | //指标命中对应字典 完整版 |
| | | paramList.add(new ResponseFidelityDiagnosisSAQTitle()); |
| | | paramList.add(new ResponseFidelityDiagnosisSAQ()); |
| | | //支持GS简易版 |
| | | paramList.add(new ResponseFidelityDiagnosisSAQGs()); |
| | | paramList.add(new ResponseFidelityDiagnosisSAQGsTitle()); |
| | | |
| | | paramList.addAll(getScoreCharacteristicsList().stream().map(p -> { |
| | | ScoreCharacteristics scoreCharacteristics = new ScoreCharacteristics(p); |
| | |
| | | return paramList; |
| | | } |
| | | private List<String> getSimpleMessageCoreIds() { |
| | | return Arrays.asList("LIBSAQ0001", "LIBSAQ0003", "LIBSAQ0005", "LIBSAQ0007", "LIBSAQ0009", "LIBSAQ00011", |
| | | //支持SAQ GS简易版 |
| | | return Arrays.asList("LIBSAQGS0001","LIBSAQGS0002","LIBSAQGS0005","LIBSAQGS0008","LIBSAQGS0009", |
| | | "LIBSAQGS0011","LIBSAQGS0017","LIBSAQGS0015","LIBSAQGS8800","LIBSAQGS0018", |
| | | "LIBSAQ0001", "LIBSAQ0003", "LIBSAQ0005", "LIBSAQ0007", "LIBSAQ0009", "LIBSAQ00011", |
| | | "LIBSAQ0015", "LIBSAQ0017", "LIBSAQ0162", "LIBSAQ0164", "LIBSAQ0020", "LIBSAQ0022", |
| | | "LIBSAQ0024", "LIBSAQ0026", "LIBSAQ0030", "LIBSAQ0035", "LIBSAQ0040", "LIBSAQ0041", |
| | | "LIBSAQ0042", "LIBSAQ0043", "LIBSAQ0050", "LIBSAQ0051", "LIBSAQ0052", "LIBSAQ0053", |
| | |
| | | public ReportResultData getTemplateParameters(Map<String, String> thaiCalculationMap, ReportTypeEnum type, LangTypeEnum langType) { |
| | | this.reportTypeEnum = type; |
| | | this.langType = langType; |
| | | |
| | | //基本信息字段 |
| | | Map textMap = new HashMap(); |
| | | Map waterDropsMap = new HashMap(); |
| | | textMap.put("questionnaireTaker", getQuestionnaireTaker()); |
| | | textMap.put("questionnaireID", getQuestionnaireID()); |
| | | textMap.put("reportGenerationDate", getReportGenerationDate()); |
| | | textMap.put("userName", getUserName()); |
| | | |
| | | textMap.put("questionnaireEmail", getQuestionnaireEmail()); |
| | | //根据报告类型获取报告字典 |
| | | getParamList(type).stream().forEach(p -> { |
| | | TLibraryCode calculate = p.calculate(thaiCalculationMap, langType); |
| | | textMap.put(p.getName(), Objects.isNull(calculate) || StringUtils.isBlank(calculate.getLangTypeContext(langType)) ? "N/A NONE" : calculate.getLangTypeContext(langType)); |
| | | List<TLibraryCode> tLibraryCodes = p.calculateList(thaiCalculationMap, langType); |
| | | if(tLibraryCodes != null && tLibraryCodes.size() > 0){//表格多位 计算分数值赋值 例如 |
| | | // 表格的:%ResponseFidelityDiagnosis_V2_0% |
| | | // 表格的:%ResponseFidelityDiagnosis_V2_1% |
| | | // 表格的:%ResponseFidelityDiagnosis_V2_2% |
| | | for (int i = 0; i < tLibraryCodes.size(); i++) { |
| | | TLibraryCode tLibraryCode = tLibraryCodes.get(i); |
| | | textMap.put(p.getName() + "_" + i, Objects.isNull(tLibraryCode) || StringUtils.isBlank(tLibraryCode.getLangTypeContext(langType)) ? "N/A NONE" : tLibraryCode.getLangTypeContext(langType)); |
| | | } |
| | | }else{ |
| | | textMap.put(p.getName(), Objects.isNull(calculate) || StringUtils.isBlank(calculate.getLangTypeContext(langType)) ? "N/A NONE" : calculate.getLangTypeContext(langType)); |
| | | } |
| | | //水滴集合 |
| | | if (Objects.nonNull(p.getMAQwaterDropsImages())) { |
| | | waterDropsMap.putAll(p.getMAQwaterDropsImages()); |
| | | } |