| | |
| | | private Map otherParams; |
| | | |
| | | private LangTypeEnum langType; |
| | | |
| | | /** |
| | | * 根据报告类型初始化数据 |
| | | * @param reportTypeEnum |
| | | * @return |
| | | */ |
| | | public List<BaseCondition_V2> getParamList(ReportTypeEnum reportTypeEnum) { |
| | | return init(reportTypeEnum); |
| | | } |
| | | |
| | | /** |
| | | * 根据报告类型初始化所有 |
| | | * @param reportTypeEnum |
| | | * @return |
| | | */ |
| | | private List<BaseCondition_V2> init(ReportTypeEnum reportTypeEnum) { |
| | | List<BaseCondition_V2> paramList = new ArrayList<>(); |
| | | |
| | |
| | | conditionVOList.add(new MAQConditionVO_V2("People_Orientation_32", "P_People32", "LIBMAQV2320")); |
| | | return conditionVOList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取报告字典替换值 |
| | | * @param thaiCalculationMap |
| | | * @param type |
| | | * @param langType |
| | | * @return |
| | | */ |
| | | 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("questionnaireEmail", getQuestionnaireEmail()); |
| | | textMap.put("questionnaireStartTime", getQuestionnaireStartTime()); |
| | | textMap.put("questionnaireEndTime", getQuestionnaireEndTime()); |
| | | |
| | | //根据报告类型获取报告字典 |
| | | getParamList(type).stream().forEach(p -> { |
| | | //获取对应语言报告字典 |
| | | TLibraryCode calculate = p.calculate(thaiCalculationMap, langType); |
| | | List<TLibraryCode> tLibraryCodes = p.calculateList(thaiCalculationMap, langType); |
| | | if(tLibraryCodes != null && tLibraryCodes.size() > 0){ |
| | | //表格多位 计算分数值赋值 例如 |
| | | // 表格的:%P_Regula19_XX1% |
| | | // 表格的:%P_Regula19_XX2% |
| | | // 表格的:%P_Regula19_XX3% |
| | | // 表格的:%P_Regula19_XX4% |
| | | // 表格的:%P_Regula19_XX5% |
| | | // 表格的:%P_Regula19_XX6% |
| | | 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()); |
| | | } |