Commit d67eb7f8f47e5d1ec98b4fbf90fe3120b8946c49
1 parent
af3768e84d
Exists in
master
and in
6 other branches
update code
Showing 1 changed file with 42 additions and 34 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
d67eb7f
... | ... | @@ -204,40 +204,44 @@ |
204 | 204 | highScoreResult = ResolveUtils.queryRisk(ids, true, basicConfigService); |
205 | 205 | } |
206 | 206 | } |
207 | - Integer score = 0; | |
208 | - if (highScoreResult != null) { | |
209 | - if (highScoreResult.getScore() != null) { | |
207 | + Integer score = 0; | |
208 | + if (highScoreResult != null && highScoreResult.getScore() != null) { | |
210 | 209 | score = highScoreResult.getScore(); |
211 | 210 | } |
212 | - List<Map<String, Object>> list = ResolveUtils.queryHighRisk(highScoreResult); | |
213 | - | |
214 | - Map<String, Object> otherRisk = null; | |
211 | + List<Map<String, Object>> list = new ArrayList<>(); | |
212 | + List<Map<String, Object>> checkList = ResolveUtils.queryHighRisk(highScoreResult); | |
213 | + if (CollectionUtils.isNotEmpty(checkList)) | |
214 | + { | |
215 | + list.addAll(checkList); | |
216 | + } | |
215 | 217 | if (StringUtils.isNotEmpty(oRisk) && !"{}".equals(oRisk)) { |
216 | - otherRisk = new HashMap<>(); | |
218 | + Map<String, Object> otherRisk = new HashMap<>(); | |
217 | 219 | ResolveUtils.queryOtherRisk(oRisk, otherRisk, basicConfigService); |
218 | - } | |
219 | 220 | |
220 | - Map<String, Object> otherMap = new HashMap<>(); | |
221 | + Map<String, Object> otherMap = new HashMap<>(); | |
221 | 222 | |
222 | - if (otherRisk != null) { | |
223 | - if (otherRisk.get("name") != null) { | |
224 | - otherMap.put("name", otherRisk.get("name")); | |
225 | - } | |
226 | - if (otherRisk.get("color") != null) { | |
227 | - otherMap.put("color", otherRisk.get("color")); | |
228 | - } | |
229 | - if (otherRisk.get("score") != null) { | |
230 | - String s = (String) otherRisk.get("score"); | |
231 | - if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(s) && FunvCommonUtil.isNumeric(s)) { | |
232 | - score = score + Integer.parseInt(s); | |
223 | + if (otherRisk != null) { | |
224 | + if (otherRisk.get("name") != null && StringUtils.isNotEmpty(otherRisk.get("name").toString())) { | |
225 | + otherMap.put("name", otherRisk.get("name")); | |
233 | 226 | } |
227 | + if (otherRisk.get("color") != null && StringUtils.isNotEmpty(otherRisk.get("color").toString()) && !"risk_".equals(otherRisk.get("color").toString())) { | |
228 | + otherMap.put("color", otherRisk.get("color")); | |
229 | + } | |
230 | + if (otherRisk.get("score") != null && StringUtils.isNotEmpty(otherRisk.get("score").toString()) ) { | |
231 | + String s = (String) otherRisk.get("score"); | |
232 | + if (com.lyms.platform.common.utils.StringUtils.isNotEmpty(s) && FunvCommonUtil.isNumeric(s)) { | |
233 | + score += Integer.parseInt(s); | |
234 | + } | |
235 | + } | |
236 | + if (otherMap.size() > 0) | |
237 | + { | |
238 | + list.add(otherMap); | |
239 | + } | |
240 | + | |
234 | 241 | } |
235 | - list.add(otherMap); | |
236 | 242 | } |
237 | - | |
238 | 243 | map.put("score", UnitUtils.unitSplice(score, UnitConstants.FEN)); |
239 | 244 | map.put("highRisk", list); |
240 | - } | |
241 | 245 | } |
242 | 246 | |
243 | 247 | /** |
244 | 248 | |
245 | 249 | |
246 | 250 | |
247 | 251 | |
... | ... | @@ -399,21 +403,25 @@ |
399 | 403 | map.put("gongwaiyun", UnitUtils.unitSplice(data.getGongwaiyun(), UnitConstants.CI)); |
400 | 404 | //流产 |
401 | 405 | StringBuffer abortion = new StringBuffer(); |
402 | - abortion.append(UnitUtils.unitSplice(data.getAbortion(), UnitConstants.CI) == null ? "" : UnitUtils.unitSplice(data.getAbortion(), UnitConstants.CI)); | |
403 | - abortion.append("("); | |
406 | + if (data.getAbortion() != null) | |
407 | + { | |
408 | + abortion.append(UnitUtils.unitSplice(data.getAbortion(), UnitConstants.CI) == null ? "" : UnitUtils.unitSplice(data.getAbortion(), UnitConstants.CI)); | |
409 | + abortion.append("("); | |
404 | 410 | |
405 | - if (data.getAbortionZR() != null) { | |
406 | - abortion.append("自然:" + data.getAbortionZR() + UnitConstants.CI ); | |
407 | - } | |
411 | + if (data.getAbortionZR() != null) { | |
412 | + abortion.append("自然:" + data.getAbortionZR() + UnitConstants.CI ); | |
413 | + } | |
408 | 414 | |
409 | - if(data.getAbortionRG() != null){ | |
410 | - abortion.append(" 人工:" + data.getAbortionRG() + UnitConstants.CI + ""); | |
411 | - } | |
415 | + if(data.getAbortionRG() != null){ | |
416 | + abortion.append(" 人工:" + data.getAbortionRG() + UnitConstants.CI + ""); | |
417 | + } | |
412 | 418 | |
413 | - if(data.getYaowu()!=null){ | |
414 | - abortion.append(" 药物:" + data.getYaowu() + UnitConstants.CI + ""); | |
419 | + if(data.getYaowu()!=null){ | |
420 | + abortion.append(" 药物:" + data.getYaowu() + UnitConstants.CI + ""); | |
421 | + } | |
422 | + abortion.append(")"); | |
415 | 423 | } |
416 | - abortion.append(")"); | |
424 | + | |
417 | 425 | |
418 | 426 | map.put("abortion", abortion); |
419 | 427 |