Commit 93c6f060e5b262d2431b9701ade632108dd773d1
1 parent
f2ccd0d6b1
Exists in
master
and in
6 other branches
改字段
Showing 2 changed files with 28 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/ViewFacade.java
View file @
93c6f06
... | ... | @@ -1117,6 +1117,10 @@ |
1117 | 1117 | } |
1118 | 1118 | |
1119 | 1119 | Map<String, Object> map = new HashMap<>(); |
1120 | + | |
1121 | + map.put("treatmentOpinion2Types", mongoUtil.findPlatValues(data.getTreatmentOpinion2Types())); | |
1122 | + map.put("treatmentOpinion2", mongoUtil.findPlatList(data.getTreatmentOpinion2())); | |
1123 | + | |
1120 | 1124 | /* 基本信息 */ |
1121 | 1125 | //孕妇基本信息 |
1122 | 1126 | map.put("id", data.getId()); |
... | ... | @@ -1680,6 +1684,7 @@ |
1680 | 1684 | map.put("ydqjd", FunvCommonUtil.getBaseicConfigByid(ydqjd, basicConfigService)); |
1681 | 1685 | map.put("bChao", data.getbChao()); |
1682 | 1686 | |
1687 | + | |
1683 | 1688 | /** 优惠券编号 */ |
1684 | 1689 | map.put("couponCode", couponService.findByUsedId(id)); |
1685 | 1690 | |
... | ... | @@ -1764,6 +1769,10 @@ |
1764 | 1769 | } |
1765 | 1770 | |
1766 | 1771 | Map<String, Object> map = new HashMap<>(); |
1772 | + | |
1773 | + map.put("treatmentOpinion2Types", mongoUtil.findPlatValues(data.getTreatmentOpinion2Types())); | |
1774 | + map.put("treatmentOpinion2", mongoUtil.findPlatList(data.getTreatmentOpinion2())); | |
1775 | + | |
1767 | 1776 | /* 基本信息 */ |
1768 | 1777 | //孕妇基本信息 |
1769 | 1778 | map.put("id", data.getId()); |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/utils/MongoUtil.java
View file @
93c6f06
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | import com.lyms.platform.pojo.PlantformConfigModel; |
11 | 11 | import com.mongodb.BasicDBObject; |
12 | 12 | import com.mongodb.DBObject; |
13 | +import org.apache.commons.collections.MapUtils; | |
13 | 14 | import org.apache.commons.collections.map.HashedMap; |
14 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
15 | 16 | import org.springframework.data.domain.Sort; |
... | ... | @@ -308,7 +309,7 @@ |
308 | 309 | if(platformConfig != null) { |
309 | 310 | Map<String, Object> tempMap = new HashedMap(); |
310 | 311 | tempMap.put("id", platformConfig.getId().toString()); |
311 | - tempMap.put("name", platformConfig.getValue()); | |
312 | + tempMap.put("typeName", platformConfig.getValue()); | |
312 | 313 | rest.add(tempMap); |
313 | 314 | } |
314 | 315 | } |
315 | 316 | |
316 | 317 | |
317 | 318 | |
... | ... | @@ -327,14 +328,29 @@ |
327 | 328 | for (String id : ids) { |
328 | 329 | PlantformConfigModel plantformConfig = findPlatFormById(id); |
329 | 330 | if(plantformConfig != null) { |
330 | - sb.append(plantformConfig.getValue()); | |
331 | + sb.append(plantformConfig.getValue()).append("、"); | |
331 | 332 | } |
332 | 333 | } |
333 | - return sb.toString(); | |
334 | + return sb.length() == 0 ? "" : sb.toString().substring(0, sb.toString().length() - 1); | |
334 | 335 | } |
336 | + | |
335 | 337 | public String findPlatValue(String id) { |
336 | 338 | PlantformConfigModel plantformConfig = findPlatFormById(id); |
337 | 339 | return plantformConfig.getValue(); |
340 | + } | |
341 | + | |
342 | + public List<String> findPlatList(Map<String, List<String>> ids) { | |
343 | + List<String> list = new ArrayList<>(); | |
344 | + if(MapUtils.isEmpty(ids)) { | |
345 | + return list; | |
346 | + } | |
347 | + Iterator<Map.Entry<String, List<String>>> iterator = ids.entrySet().iterator(); | |
348 | + while (iterator.hasNext()) { | |
349 | + Map.Entry<String, List<String>> next = iterator.next(); | |
350 | + StringBuilder sb = new StringBuilder(); | |
351 | + sb.append(findPlatValue(next.getKey())).append(": ").append(findPlatValues(next.getValue())); | |
352 | + } | |
353 | + return list; | |
338 | 354 | } |
339 | 355 | } |