From f315f2f94d7dab7e1b90f8c70b2dc324c594680c Mon Sep 17 00:00:00 2001 From: 林致杰 <1003392067@qq.com> Date: 星期五, 29 七月 2022 17:01:59 +0800 Subject: [PATCH] 测试用例 --- src/main/java/com/ots/project/tool/report/SAQ/SAQReport.java | 39 ++++++++++++++++++++++++++++++++++----- 1 files changed, 34 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/ots/project/tool/report/SAQ/SAQReport.java b/src/main/java/com/ots/project/tool/report/SAQ/SAQReport.java index 6e09da8..4433ca2 100644 --- a/src/main/java/com/ots/project/tool/report/SAQ/SAQReport.java +++ b/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()); } -- Gitblit v1.9.1