Commit f2ccd0d6b1d1bed09e12951ce18db12345559bc0
1 parent
d5f4ebcd92
Exists in
master
and in
6 other branches
改字段
Showing 2 changed files with 26 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
f2ccd0d
... | ... | @@ -1796,17 +1796,17 @@ |
1796 | 1796 | map.put("jzxgn", Boolean.valueOf(data.getJzxgn()) ? "已检查" : "未检查"); |
1797 | 1797 | |
1798 | 1798 | map.put("treatmentOpinion2Types", data.getTreatmentOpinion2Types()); |
1799 | - Map<String, List<Map<String, Object>>> restTreatmentOpinion2 = new HashMap<>(); | |
1799 | + StringBuilder restTreatmentOpinion2 = new StringBuilder(); | |
1800 | 1800 | Map<String, List<String>> treatmentOpinion2 = data.getTreatmentOpinion2(); |
1801 | 1801 | if(MapUtils.isNotEmpty(treatmentOpinion2)) { |
1802 | 1802 | Iterator<Map.Entry<String, List<String>>> iterator = treatmentOpinion2.entrySet().iterator(); |
1803 | 1803 | while (iterator.hasNext()) { |
1804 | 1804 | Map.Entry<String, List<String>> iter = iterator.next(); |
1805 | - restTreatmentOpinion2.put(iter.getKey(), mongoUtil.findPlatValueList(iter.getValue())); | |
1805 | + restTreatmentOpinion2.append(mongoUtil.findPlatValue(iter.getKey())).append(": ").append(mongoUtil.findPlatValues(iter.getValue())).append("0"); | |
1806 | 1806 | } |
1807 | 1807 | } |
1808 | - map.put("treatmentOpinion2", restTreatmentOpinion2); | |
1809 | - map.put("treatmentOpinion2Types", data.getTreatmentOpinion2Types()); | |
1808 | + map.put("treatmentOpinion2", restTreatmentOpinion2.toString()); | |
1809 | + map.put("treatmentOpinion2Types", mongoUtil.findPlatValues(data.getTreatmentOpinion2Types())); | |
1810 | 1810 | |
1811 | 1811 | //早孕期病毒检测 |
1812 | 1812 | // private String zyqbdjc; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
View file @
f2ccd0d
... | ... | @@ -314,5 +314,27 @@ |
314 | 314 | } |
315 | 315 | return rest; |
316 | 316 | } |
317 | + | |
318 | + public PlantformConfigModel findPlatFormById(String id) { | |
319 | + return mongoTemplate.findById(id, PlantformConfigModel.class); | |
320 | + } | |
321 | + | |
322 | + public String findPlatValues(List<String> ids) { | |
323 | + if(CollectionUtils.isEmpty(ids)) { | |
324 | + return ""; | |
325 | + } | |
326 | + StringBuilder sb = new StringBuilder(); | |
327 | + for (String id : ids) { | |
328 | + PlantformConfigModel plantformConfig = findPlatFormById(id); | |
329 | + if(plantformConfig != null) { | |
330 | + sb.append(plantformConfig.getValue()); | |
331 | + } | |
332 | + } | |
333 | + return sb.toString(); | |
334 | + } | |
335 | + public String findPlatValue(String id) { | |
336 | + PlantformConfigModel plantformConfig = findPlatFormById(id); | |
337 | + return plantformConfig.getValue(); | |
338 | + } | |
317 | 339 | } |