Commit 50688ff6aa9749087b4a21a7f32d14fca53c7caf
1 parent
3a009c61f7
Exists in
master
and in
6 other branches
update
Showing 3 changed files with 92 additions and 37 deletions
platform-dal/src/main/java/com/lyms/platform/pojo/CervicalCancerModel.java
View file @
50688ff
| ... | ... | @@ -46,13 +46,9 @@ |
| 46 | 46 | * 省市区街道 |
| 47 | 47 | */ |
| 48 | 48 | private String provinceId; |
| 49 | - private String provinceStr; | |
| 50 | 49 | private String cityId; |
| 51 | - private String cityStr; | |
| 52 | 50 | private String areaId; |
| 53 | - private String areaStr; | |
| 54 | 51 | private String streetId; |
| 55 | - private String streetStr; | |
| 56 | 52 | private String address; |
| 57 | 53 | |
| 58 | 54 | /** |
| 59 | 55 | |
| ... | ... | @@ -180,14 +176,7 @@ |
| 180 | 176 | this.provinceId = provinceId; |
| 181 | 177 | } |
| 182 | 178 | |
| 183 | - public String getProvinceStr() { | |
| 184 | - return provinceStr; | |
| 185 | - } | |
| 186 | 179 | |
| 187 | - public void setProvinceStr(String provinceStr) { | |
| 188 | - this.provinceStr = provinceStr; | |
| 189 | - } | |
| 190 | - | |
| 191 | 180 | public String getCityId() { |
| 192 | 181 | return cityId; |
| 193 | 182 | } |
| 194 | 183 | |
| ... | ... | @@ -196,14 +185,7 @@ |
| 196 | 185 | this.cityId = cityId; |
| 197 | 186 | } |
| 198 | 187 | |
| 199 | - public String getCityStr() { | |
| 200 | - return cityStr; | |
| 201 | - } | |
| 202 | 188 | |
| 203 | - public void setCityStr(String cityStr) { | |
| 204 | - this.cityStr = cityStr; | |
| 205 | - } | |
| 206 | - | |
| 207 | 189 | public String getAreaId() { |
| 208 | 190 | return areaId; |
| 209 | 191 | } |
| ... | ... | @@ -212,14 +194,6 @@ |
| 212 | 194 | this.areaId = areaId; |
| 213 | 195 | } |
| 214 | 196 | |
| 215 | - public String getAreaStr() { | |
| 216 | - return areaStr; | |
| 217 | - } | |
| 218 | - | |
| 219 | - public void setAreaStr(String areaStr) { | |
| 220 | - this.areaStr = areaStr; | |
| 221 | - } | |
| 222 | - | |
| 223 | 197 | public String getStreetId() { |
| 224 | 198 | return streetId; |
| 225 | 199 | } |
| ... | ... | @@ -228,13 +202,6 @@ |
| 228 | 202 | this.streetId = streetId; |
| 229 | 203 | } |
| 230 | 204 | |
| 231 | - public String getStreetStr() { | |
| 232 | - return streetStr; | |
| 233 | - } | |
| 234 | - | |
| 235 | - public void setStreetStr(String streetStr) { | |
| 236 | - this.streetStr = streetStr; | |
| 237 | - } | |
| 238 | 205 | |
| 239 | 206 | public Date getLastMenstrual() { |
| 240 | 207 | return lastMenstrual; |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/result/CervicalCancerModelResult.java
View file @
50688ff
| ... | ... | @@ -3,6 +3,40 @@ |
| 3 | 3 | import com.lyms.platform.pojo.CervicalCancerModel; |
| 4 | 4 | |
| 5 | 5 | public class CervicalCancerModelResult extends CervicalCancerModel { |
| 6 | + private String addressStr; | |
| 6 | 7 | |
| 8 | + /** | |
| 9 | + * 填写单位 | |
| 10 | + */ | |
| 11 | + private String hospitalStr; | |
| 12 | + | |
| 13 | + /** | |
| 14 | + * 填写人 | |
| 15 | + */ | |
| 16 | + private String createUserStr; | |
| 17 | + | |
| 18 | + public String getAddressStr() { | |
| 19 | + return addressStr; | |
| 20 | + } | |
| 21 | + | |
| 22 | + public void setAddressStr(String addressStr) { | |
| 23 | + this.addressStr = addressStr; | |
| 24 | + } | |
| 25 | + | |
| 26 | + public String getHospitalStr() { | |
| 27 | + return hospitalStr; | |
| 28 | + } | |
| 29 | + | |
| 30 | + public void setHospitalStr(String hospitalStr) { | |
| 31 | + this.hospitalStr = hospitalStr; | |
| 32 | + } | |
| 33 | + | |
| 34 | + public String getCreateUserStr() { | |
| 35 | + return createUserStr; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setCreateUserStr(String createUserStr) { | |
| 39 | + this.createUserStr = createUserStr; | |
| 40 | + } | |
| 7 | 41 | } |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/service/impl/CervicalCancerServiceImpl.java
View file @
50688ff
| 1 | 1 | package com.lyms.platform.operate.web.service.impl; |
| 2 | 2 | |
| 3 | 3 | import java.util.Date; |
| 4 | +import java.util.LinkedList; | |
| 4 | 5 | import java.util.List; |
| 5 | 6 | |
| 6 | 7 | import com.lyms.platform.operate.web.facade.AutoMatchFacade; |
| 8 | +import com.lyms.platform.operate.web.result.PregnantDeathModelResult; | |
| 9 | +import com.lyms.platform.permission.model.Organization; | |
| 10 | +import com.lyms.platform.permission.model.Users; | |
| 11 | +import com.lyms.platform.permission.service.OrganizationService; | |
| 12 | +import com.lyms.platform.permission.service.UsersService; | |
| 13 | +import com.lyms.platform.pojo.PregnantDeathModel; | |
| 7 | 14 | import org.springframework.beans.BeanUtils; |
| 8 | 15 | import org.springframework.beans.factory.annotation.Autowired; |
| 9 | 16 | import org.springframework.data.domain.Sort; |
| ... | ... | @@ -42,6 +49,12 @@ |
| 42 | 49 | @Autowired |
| 43 | 50 | private AutoMatchFacade autoMatchFacade; |
| 44 | 51 | |
| 52 | + @Autowired | |
| 53 | + private OrganizationService organizationService; | |
| 54 | + | |
| 55 | + @Autowired | |
| 56 | + private UsersService usersService; | |
| 57 | + | |
| 45 | 58 | /** |
| 46 | 59 | * 保存单个 |
| 47 | 60 | * |
| 48 | 61 | |
| ... | ... | @@ -118,12 +131,48 @@ |
| 118 | 131 | param.mysqlBuild((int) count); |
| 119 | 132 | query.skip(param.getOffset()).limit(param.getLimit()); |
| 120 | 133 | List<CervicalCancerModel> cervicalCancerModels = mongoTemplate.find(query, CervicalCancerModel.class); |
| 134 | + List<CervicalCancerModelResult> results = new LinkedList<>(); | |
| 135 | + for (CervicalCancerModel model : cervicalCancerModels) { | |
| 136 | + CervicalCancerModelResult result = new CervicalCancerModelResult(); | |
| 137 | + getOtherStr(result, model); | |
| 138 | + results.add(result); | |
| 139 | + } | |
| 140 | + | |
| 141 | + | |
| 121 | 142 | BaseListResponse baseListResponse = new BaseListResponse(); |
| 122 | 143 | baseListResponse.setData(cervicalCancerModels); |
| 123 | 144 | baseListResponse.setPageInfo(param.getPageInfo()); |
| 124 | 145 | return baseListResponse; |
| 125 | 146 | } |
| 126 | 147 | |
| 148 | + | |
| 149 | + private void getOtherStr(CervicalCancerModelResult result, CervicalCancerModel model) { | |
| 150 | + BeanUtils.copyProperties(model, result); | |
| 151 | + | |
| 152 | + result.setAddressStr(CommonsHelper.getResidence( | |
| 153 | + result.getProvinceId(), | |
| 154 | + result.getCityId(), | |
| 155 | + result.getAreaId(), | |
| 156 | + result.getStreetId(), | |
| 157 | + null, | |
| 158 | + basicConfigService | |
| 159 | + )); | |
| 160 | + String createUser = result.getCreateUser(); | |
| 161 | + if (StringUtils.isNotEmpty(createUser)) { | |
| 162 | + Users users = usersService.getUsers(Integer.parseInt(createUser)); | |
| 163 | + if (users != null) { | |
| 164 | + result.setCreateUserStr(users.getName()); | |
| 165 | + } | |
| 166 | + } | |
| 167 | + String hospitalId = result.getHospitalId(); | |
| 168 | + if (StringUtils.isNotEmpty(hospitalId)) { | |
| 169 | + Organization organization = organizationService.getOrganization(Integer.parseInt(hospitalId)); | |
| 170 | + if (organization != null) { | |
| 171 | + result.setHospitalStr(organization.getName()); | |
| 172 | + } | |
| 173 | + } | |
| 174 | + } | |
| 175 | + | |
| 127 | 176 | /** |
| 128 | 177 | * 单个查询 |
| 129 | 178 | * |
| 130 | 179 | |
| 131 | 180 | |
| 132 | 181 | |
| ... | ... | @@ -169,16 +218,21 @@ |
| 169 | 218 | String provinceId = model.getProvinceId(); |
| 170 | 219 | // 省市区 |
| 171 | 220 | result.setProvinceId(provinceId); |
| 172 | - result.setProvinceStr(CommonsHelper.getName1(provinceId, basicConfigService)); | |
| 173 | 221 | String cityId = model.getCityId(); |
| 174 | 222 | result.setCityId(cityId); |
| 175 | - result.setCityStr(CommonsHelper.getName1(cityId, basicConfigService)); | |
| 176 | 223 | String areaId = model.getAreaId(); |
| 177 | 224 | result.setAreaId(areaId); |
| 178 | - result.setAreaStr(CommonsHelper.getName1(areaId, basicConfigService)); | |
| 179 | 225 | String streetId = model.getStreetId(); |
| 180 | 226 | result.setStreetId(streetId); |
| 181 | - result.setStreetStr(CommonsHelper.getName1(streetId, basicConfigService)); | |
| 227 | + | |
| 228 | + result.setAddressStr(CommonsHelper.getResidence( | |
| 229 | + result.getProvinceId(), | |
| 230 | + result.getCityId(), | |
| 231 | + result.getAreaId(), | |
| 232 | + result.getStreetId(), | |
| 233 | + null, | |
| 234 | + basicConfigService | |
| 235 | + )); | |
| 182 | 236 | |
| 183 | 237 | result.setLastMenstrual(model.getMcyj()); |
| 184 | 238 | result.setName(model.getUsername()); |