Commit 81d76e8fa24eb5b869194b9a0b3d17a3f0038064
1 parent
223060e1c6
Exists in
master
and in
6 other branches
肌萎缩
Showing 2 changed files with 42 additions and 2 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/SmnFacade.java
View file @
81d76e8
| 1 | 1 | package com.lyms.platform.operate.web.facade; |
| 2 | 2 | |
| 3 | +import com.lyms.platform.biz.service.BasicConfigService; | |
| 3 | 4 | import com.lyms.platform.biz.service.PatientsService; |
| 4 | 5 | import com.lyms.platform.common.enums.YnEnums; |
| 5 | 6 | import com.lyms.platform.common.result.BaseListResponse; |
| 6 | 7 | |
| ... | ... | @@ -10,9 +11,12 @@ |
| 10 | 11 | import com.lyms.platform.common.utils.StringUtils; |
| 11 | 12 | import com.lyms.platform.operate.web.request.SmnQueryRequest; |
| 12 | 13 | import com.lyms.platform.operate.web.request.SmnRequest; |
| 14 | +import com.lyms.platform.operate.web.result.SmnResult; | |
| 15 | +import com.lyms.platform.operate.web.utils.CommonsHelper; | |
| 13 | 16 | import com.lyms.platform.pojo.Patients; |
| 14 | 17 | import com.lyms.platform.pojo.SmnModel; |
| 15 | 18 | import com.lyms.platform.query.PatientsQuery; |
| 19 | +import org.apache.commons.collections.CollectionUtils; | |
| 16 | 20 | import org.springframework.beans.BeanUtils; |
| 17 | 21 | import org.springframework.beans.factory.annotation.Autowired; |
| 18 | 22 | import org.springframework.data.domain.Sort; |
| ... | ... | @@ -22,6 +26,7 @@ |
| 22 | 26 | import org.springframework.data.mongodb.core.query.Update; |
| 23 | 27 | import org.springframework.stereotype.Component; |
| 24 | 28 | |
| 29 | +import java.util.ArrayList; | |
| 25 | 30 | import java.util.Date; |
| 26 | 31 | import java.util.List; |
| 27 | 32 | |
| 28 | 33 | |
| ... | ... | @@ -33,8 +38,9 @@ |
| 33 | 38 | |
| 34 | 39 | @Autowired |
| 35 | 40 | private MongoTemplate mongoTemplate; |
| 36 | - | |
| 37 | 41 | @Autowired |
| 42 | + private BasicConfigService basicConfigService; | |
| 43 | + @Autowired | |
| 38 | 44 | private PatientsService patientsService; |
| 39 | 45 | |
| 40 | 46 | public BaseResponse addSmn(SmnRequest param, Integer userId) { |
| 41 | 47 | |
| ... | ... | @@ -190,8 +196,23 @@ |
| 190 | 196 | param.mysqlBuild((int) count); |
| 191 | 197 | query.skip(param.getOffset()).limit(param.getLimit()); |
| 192 | 198 | List<SmnModel> smnModels = mongoTemplate.find(query, SmnModel.class); |
| 199 | + List<SmnResult> results = new ArrayList<>(); | |
| 200 | + if (CollectionUtils.isNotEmpty(smnModels)) | |
| 201 | + { | |
| 202 | + for (SmnModel model : smnModels) | |
| 203 | + { | |
| 204 | + SmnResult re = new SmnResult(); | |
| 205 | + BeanUtils.copyProperties(model, re); | |
| 206 | + re.setAddressRegisterStr(CommonsHelper.getResidence(model.getProvinceRegisterId(), | |
| 207 | + model.getCityRegisterId(), | |
| 208 | + model.getAreaRegisterId(), | |
| 209 | + model.getStreetRegisterId(), | |
| 210 | + model.getAddressRegister(), basicConfigService)); | |
| 211 | + results.add(re); | |
| 212 | + } | |
| 213 | + } | |
| 193 | 214 | BaseListResponse baseListResponse = new BaseListResponse(); |
| 194 | - baseListResponse.setData(smnModels); | |
| 215 | + baseListResponse.setData(results); | |
| 195 | 216 | baseListResponse.setPageInfo(param.getPageInfo()); |
| 196 | 217 | return baseListResponse; |
| 197 | 218 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/SmnResult.java
View file @
81d76e8
| 1 | +package com.lyms.platform.operate.web.result; | |
| 2 | + | |
| 3 | +import com.lyms.platform.pojo.SmnModel; | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | +public class SmnResult extends SmnModel { | |
| 8 | + | |
| 9 | + | |
| 10 | + private String addressRegisterStr; | |
| 11 | + | |
| 12 | + public String getAddressRegisterStr() { | |
| 13 | + return addressRegisterStr; | |
| 14 | + } | |
| 15 | + | |
| 16 | + public void setAddressRegisterStr(String addressRegisterStr) { | |
| 17 | + this.addressRegisterStr = addressRegisterStr; | |
| 18 | + } | |
| 19 | +} |