Commit 4eb3337e39e5292b0706082b36a1119870d2a48c
1 parent
5d1ed06068
Exists in
master
and in
8 other branches
增加社区id
Showing 2 changed files with 27 additions and 3 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/PatientFacade.java
View file @
4eb3337
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.service.CommunityConfigService; | |
| 3 | 4 | import com.lyms.platform.biz.service.PatientsService; |
| 4 | 5 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
| 5 | 6 | import com.lyms.platform.common.enums.YnEnums; |
| 6 | 7 | |
| ... | ... | @@ -10,11 +11,13 @@ |
| 10 | 11 | import com.lyms.platform.operate.web.request.PuerperaManagerUpdateRequest; |
| 11 | 12 | import com.lyms.platform.operate.web.request.PuerperaMatcherCommunityRequest; |
| 12 | 13 | import com.lyms.platform.operate.web.result.PuerperaResult; |
| 14 | +import com.lyms.platform.pojo.CommunityConfig; | |
| 13 | 15 | import com.lyms.platform.pojo.Patients; |
| 14 | 16 | import com.lyms.platform.pojo.PuerperaModel; |
| 15 | 17 | import com.lyms.platform.query.PatientsQuery; |
| 16 | 18 | import com.lyms.platform.query.PuerperaModelQuery; |
| 17 | 19 | import org.apache.commons.collections.CollectionUtils; |
| 20 | +import org.apache.commons.lang.StringUtils; | |
| 18 | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| 19 | 22 | import org.springframework.stereotype.Component; |
| 20 | 23 | |
| ... | ... | @@ -29,6 +32,8 @@ |
| 29 | 32 | |
| 30 | 33 | @Autowired |
| 31 | 34 | private PatientsService patientsService; |
| 35 | + @Autowired | |
| 36 | + private CommunityConfigService communityConfigService; | |
| 32 | 37 | |
| 33 | 38 | |
| 34 | 39 | /** |
| ... | ... | @@ -85,7 +90,15 @@ |
| 85 | 90 | |
| 86 | 91 | for (Patients model : puerperaList) { |
| 87 | 92 | PuerperaResult result = new PuerperaResult(); |
| 88 | - data.add(result.convertToResult(model)); | |
| 93 | + String comm="未分配"; | |
| 94 | + if(StringUtils.isNotEmpty(model.getCommunityId())){ | |
| 95 | + CommunityConfig communityConfig = communityConfigService.queryAreaById(model.getCommunityId()); | |
| 96 | + if(null!=communityConfig){ | |
| 97 | + comm= communityConfig.getName(); | |
| 98 | + } | |
| 99 | + } | |
| 100 | + | |
| 101 | + data.add(result.convertToResult(model,comm)); | |
| 89 | 102 | } |
| 90 | 103 | } |
| 91 | 104 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/PuerperaResult.java
View file @
4eb3337
| ... | ... | @@ -26,6 +26,16 @@ |
| 26 | 26 | |
| 27 | 27 | private String community; |
| 28 | 28 | |
| 29 | + private String communityId; | |
| 30 | + | |
| 31 | + public String getCommunityId() { | |
| 32 | + return communityId; | |
| 33 | + } | |
| 34 | + | |
| 35 | + public void setCommunityId(String communityId) { | |
| 36 | + this.communityId = communityId; | |
| 37 | + } | |
| 38 | + | |
| 29 | 39 | private String visit; |
| 30 | 40 | |
| 31 | 41 | private String phone; |
| ... | ... | @@ -117,7 +127,7 @@ |
| 117 | 127 | return this; |
| 118 | 128 | } |
| 119 | 129 | |
| 120 | - public PuerperaResult convertToResult(Patients model) { | |
| 130 | + public PuerperaResult convertToResult(Patients model,String comm) { | |
| 121 | 131 | String addr = ""; |
| 122 | 132 | if (StringUtils.isNotEmpty(model.getAddress())) { |
| 123 | 133 | try { |
| ... | ... | @@ -131,7 +141,8 @@ |
| 131 | 141 | setId(model.getId()); |
| 132 | 142 | setDueDate(DateUtil.getyyyy_MM_dd(model.getDueDate())); |
| 133 | 143 | setVisit(model.getIsVisit() == 0 ? "未访视" : "已访视"); |
| 134 | - setCommunity(StringUtils.isEmpty(model.getCommunityId()) ? "未分配" : model.getCommunityId()); | |
| 144 | + setCommunityId(StringUtils.isEmpty(model.getCommunityId()) ? "" : model.getCommunityId()); | |
| 145 | + setCommunity(comm); | |
| 135 | 146 | setPhone(model.getPhone()); |
| 136 | 147 | setAge(model.getAge()); |
| 137 | 148 | setName(model.getUsername()); |