[测评系统]--测评系统核心代码库
林致杰
2022-08-01 34acfe6bbc98162cd8c9bb726aae0fd94c465544
src/main/java/com/ots/project/tool/report/SAQ/SAQReport.java
@@ -16,6 +16,8 @@
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;
@@ -47,9 +49,21 @@
    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<>();
        
@@ -57,9 +71,12 @@
            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);
@@ -119,7 +136,7 @@
    private List<String> getSimpleMessageCoreIds() {
        //支持SAQ GS简易版
        return Arrays.asList("LIBSAQGS0001","LIBSAQGS0002","LIBSAQGS0005","LIBSAQGS0008","LIBSAQGS0009",
                "LIBSAQGS0011","LIBSAQGS0017","LIBSAQGS0015","LIBSAQGS8800",
                "LIBSAQGS0011","LIBSAQGS0017","LIBSAQGS0015","LIBSAQGS8800","LIBSAQGS0018",
                "LIBSAQ0001", "LIBSAQ0003", "LIBSAQ0005", "LIBSAQ0007", "LIBSAQ0009", "LIBSAQ00011",
                "LIBSAQ0015", "LIBSAQ0017", "LIBSAQ0162", "LIBSAQ0164", "LIBSAQ0020", "LIBSAQ0022",
                "LIBSAQ0024", "LIBSAQ0026", "LIBSAQ0030", "LIBSAQ0035", "LIBSAQ0040", "LIBSAQ0041",
@@ -184,7 +201,7 @@
    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());
@@ -192,10 +209,22 @@
        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());
            }