diff --git a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java index a0d5d76..64012a8 100644 --- a/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java +++ b/platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java @@ -204,40 +204,44 @@ public class ViewFacade { highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService); } } - Integer score = 0; - if (highScoreResult != null) { - if (highScoreResult.getScore() != null) { + Integer score = 0; + if (highScoreResult != null && highScoreResult.getScore() != null) { score = highScoreResult.getScore(); } - List> list = ResolveUtils.queryHighRisk(highScoreResult); - - Map otherRisk = null; + List> list = new ArrayList<>(); + List> checkList = ResolveUtils.queryHighRisk(highScoreResult); + if (CollectionUtils.isNotEmpty(checkList)) + { + list.addAll(checkList); + } if (StringUtils.isNotEmpty(oRisk) && !"{}".equals(oRisk)) { - otherRisk = new HashMap<>(); + Map otherRisk = new HashMap<>(); ResolveUtils.queryOtherRisk(oRisk, otherRisk, basicConfigService); - } - Map otherMap = new HashMap<>(); + Map otherMap = new HashMap<>(); - if (otherRisk != null) { - if (otherRisk.get("name") != null) { - otherMap.put("name", otherRisk.get("name")); - } - if (otherRisk.get("color") != null) { - otherMap.put("color", otherRisk.get("color")); - } - if (otherRisk.get("score") != null) { - String s = (String) otherRisk.get("score"); - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(s) && FunvCommonUtil.isNumeric(s)) { - score = score + Integer.parseInt(s); + if (otherRisk != null) { + if (otherRisk.get("name") != null && StringUtils.isNotEmpty(otherRisk.get("name").toString())) { + otherMap.put("name", otherRisk.get("name")); + } + if (otherRisk.get("color") != null && StringUtils.isNotEmpty(otherRisk.get("color").toString()) && !"risk_".equals(otherRisk.get("color").toString())) { + otherMap.put("color", otherRisk.get("color")); + } + if (otherRisk.get("score") != null && StringUtils.isNotEmpty(otherRisk.get("score").toString()) ) { + String s = (String) otherRisk.get("score"); + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(s) && FunvCommonUtil.isNumeric(s)) { + score += Integer.parseInt(s); + } + } + if (otherMap.size() > 0) + { + list.add(otherMap); } + } - list.add(otherMap); } - map.put("score", UnitUtils.unitSplice(score, UnitConstants.FEN)); map.put("highRisk", list); - } } /** @@ -399,21 +403,25 @@ public class ViewFacade { map.put("gongwaiyun", UnitUtils.unitSplice(data.getGongwaiyun(), UnitConstants.CI)); //流产 StringBuffer abortion = new StringBuffer(); - abortion.append(UnitUtils.unitSplice(data.getAbortion(), UnitConstants.CI) == null ? "" : UnitUtils.unitSplice(data.getAbortion(), UnitConstants.CI)); - abortion.append("("); + if (data.getAbortion() != null) + { + abortion.append(UnitUtils.unitSplice(data.getAbortion(), UnitConstants.CI) == null ? "" : UnitUtils.unitSplice(data.getAbortion(), UnitConstants.CI)); + abortion.append("("); - if (data.getAbortionZR() != null) { - abortion.append("自然:" + data.getAbortionZR() + UnitConstants.CI ); - } + if (data.getAbortionZR() != null) { + abortion.append("自然:" + data.getAbortionZR() + UnitConstants.CI ); + } - if(data.getAbortionRG() != null){ - abortion.append(" 人工:" + data.getAbortionRG() + UnitConstants.CI + ""); - } + if(data.getAbortionRG() != null){ + abortion.append(" 人工:" + data.getAbortionRG() + UnitConstants.CI + ""); + } - if(data.getYaowu()!=null){ - abortion.append(" 药物:" + data.getYaowu() + UnitConstants.CI + ""); + if(data.getYaowu()!=null){ + abortion.append(" 药物:" + data.getYaowu() + UnitConstants.CI + ""); + } + abortion.append(")"); } - abortion.append(")"); + map.put("abortion", abortion);