From ccbe40edcd772214ac3df40be1f582b6acea63f4 Mon Sep 17 00:00:00 2001 From: linzhijie <19970921lzj> Date: 星期一, 12 四月 2021 15:50:09 +0800 Subject: [PATCH] 优化代码 --- src/main/java/com/ots/project/tool/report/CAQ/CAQReport.java | 24 +++++++++++++++++++++++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/src/main/java/com/ots/project/tool/report/CAQ/CAQReport.java b/src/main/java/com/ots/project/tool/report/CAQ/CAQReport.java index 37d5129..07adf38 100644 --- a/src/main/java/com/ots/project/tool/report/CAQ/CAQReport.java +++ b/src/main/java/com/ots/project/tool/report/CAQ/CAQReport.java @@ -23,7 +23,14 @@ private String reportDate; private String testToken; - + + /** + * 鑾峰彇鎶ュ憡瀛楀吀鐨刢ode璺焩alue + * @param thaiCalculationMap + * @param type + * @param langType + * @return + */ public ReportResultData getTemplateParameters(Map<String, String> thaiCalculationMap, ReportTypeEnum type, LangTypeEnum langType) { Map<String, Object> infoMap = new HashMap(); infoMap.put("fullName", fullName); @@ -31,13 +38,17 @@ infoMap.put("testToken", testToken); Map textMap = new HashMap(); Map waterDropsMap = new HashMap(); + //閬嶅巻鍒濆鍖朿ode瀛楀吀鍊肩殑value getParamList(type).stream().forEach(p -> { TLibraryCode calculate = p.calculate(thaiCalculationMap, langType); + //淇濆瓨缃崲鍚庢枃鏈瓧鍏� 渚�:LIBCAQ0015 : 璇ュ�欓�変汉鍦ㄦ娊璞℃帹鐞嗚兘鍔涢儴鍒�20棰樹腑鍥炵瓟姝g‘鐨勯鏁帮細<BoldText>14</BoldText> textMap.put(p.getName(), Objects.isNull(calculate) || StringUtils.isBlank(calculate.getLangTypeContext(langType)) ? "N/A NONE" : calculate.getLangTypeContext(langType)); + //淇濆瓨鍥剧墖瀛楀吀 渚嬪瓙锛歅_Abstract_context_waterDrops : 26.0 if (Objects.nonNull(p.getMAQwaterDropsImages())) { waterDropsMap.putAll(p.getMAQwaterDropsImages()); } }); + //淇濆瓨涔嬪墠浼犺繘鏉ョ殑棰樼洰ID璺熶竴浜涗釜浜轰俊鎭� textMap.putAll(thaiCalculationMap); ReportResultData reportResultData = new ReportResultData(); reportResultData.setTextMap(textMap); @@ -47,6 +58,12 @@ public List<BaseCondition> getParamList(ReportTypeEnum reportTypeEnum) { return init(reportTypeEnum); } + + /** + * 鍒濆鍖栧瓧鍏� + * @param reportTypeEnum + * @return + */ private List<BaseCondition> init(ReportTypeEnum reportTypeEnum) { List<BaseCondition> paramList = new ArrayList<>(); @@ -59,6 +76,11 @@ paramList.add(new WaterDropletContentPNumeric()); return paramList; } + + /** + * 鍒濆鍖栫畝鍗曠殑瀛楀吀code + * @return + */ private List<String> getSimpleMessageCoreIds() { return Arrays.asList("LIBCAQ0005", "LIBCAQ0006", "LIBCAQ0007", "LIBCAQ0008", "LIBCAQ0010", "LIBCAQ0020" ,"LIBCAQ0030","LIBCAQ0040","LIBCAQ0050","LIBCAQ0060","LIBCAQ0070","LIBCAQ0080" -- Gitblit v1.9.1