[测评系统]--测评系统核心代码库
zhijie
2021-06-08 56c8bc18def3992259da50948119259f571d04ee
src/main/java/com/ots/project/tool/report/MAQNEW/MAQReport_V2.java
@@ -34,9 +34,21 @@
    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<>();
        
@@ -85,6 +97,7 @@
    private List<String> getSimpleMessageCoreIds() {
        return Arrays.asList(
                "LIBMAQV20001", "LIBMAQV20002", "LIBMAQV20003", "LIBMAQV20004", "LIBMAQV20005",
                "LIBMAQV200101","LIBMAQV200201","LIBMAQV200301","LIBMAQV20041","LIBMAQV20042",//MAQV2简易版报告需要用到
                "LIBMAQV200071", "LIBMAQV20006", "LIBMAQV20009", "LIBMAQV20210", "LIBMAQV200077",
                "LIBMAQV20008", "LIBMAQV20009", "LIBMAQV20010", "LIBMAQV20011", "LIBMAQV20030",
                "LIBMAQV20040", "LIBMAQV20060", "LIBMAQV233000", "LIBMAQV20008", "LIBMAQV20065",
@@ -186,13 +199,21 @@
        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());
@@ -200,18 +221,25 @@
        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){
                //表格多位 计算分数值赋值 例如
                // 表格的:%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());
            }