Commit e1c62d4cbdf0028cef266a9335102244ae6bf69f
1 parent
fa5ac74d1d
Exists in
master
and in
6 other branches
两癌筛查
Showing 2 changed files with 102 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/CancerScreeningController.java
View file @
e1c62d4
... | ... | @@ -24,6 +24,22 @@ |
24 | 24 | @Autowired |
25 | 25 | private CancerScreeningFacade cancerScreenService; |
26 | 26 | |
27 | + | |
28 | + /** | |
29 | + * 查询两癌筛查妇女基本信息 | |
30 | + * @param cardNo | |
31 | + * @param vaCardNo | |
32 | + * @return | |
33 | + */ | |
34 | + @ResponseBody | |
35 | + @RequestMapping(value="/queryCanSrcInfo",method = RequestMethod.GET) | |
36 | + @TokenRequired | |
37 | + public BaseResponse queryCanSrcInfo(@RequestParam(required = false) String cardNo,@RequestParam(required = false) String vaCardNo, | |
38 | + HttpServletRequest request) { | |
39 | + return cancerScreenService.queryCanSrcInfo(cardNo,vaCardNo,getUserId(request)); | |
40 | + } | |
41 | + | |
42 | + | |
27 | 43 | /** |
28 | 44 | * 添加或修改两癌筛查 |
29 | 45 | * @param cancerScr |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/CancerScreeningFacade.java
View file @
e1c62d4
... | ... | @@ -4,19 +4,25 @@ |
4 | 4 | import com.lyms.platform.biz.service.CancerScreeningService; |
5 | 5 | import com.lyms.platform.biz.service.ResidentsArchiveService; |
6 | 6 | import com.lyms.platform.common.constants.ErrorCodeConstants; |
7 | +import com.lyms.platform.common.enums.SexEnum; | |
7 | 8 | import com.lyms.platform.common.enums.YnEnums; |
9 | +import com.lyms.platform.common.result.BaseObjectResponse; | |
8 | 10 | import com.lyms.platform.common.result.BaseResponse; |
9 | 11 | import com.lyms.platform.common.utils.DateUtil; |
10 | 12 | import com.lyms.platform.operate.web.request.CancerScreeningRequest; |
13 | +import com.lyms.platform.operate.web.result.ResidentsPageResult; | |
11 | 14 | import com.lyms.platform.operate.web.utils.CommonsHelper; |
12 | 15 | import com.lyms.platform.operate.web.utils.FunvCommonUtil; |
16 | +import com.lyms.platform.operate.web.utils.UnitConstants; | |
13 | 17 | import com.lyms.platform.permission.model.Users; |
14 | 18 | import com.lyms.platform.permission.service.UsersService; |
15 | 19 | import com.lyms.platform.pojo.CancerScreeningModel; |
16 | 20 | import com.lyms.platform.pojo.ResidentsArchiveModel; |
17 | 21 | import com.lyms.platform.query.CancerScreeningQuery; |
22 | +import com.lyms.platform.query.ResidentsArchiveQuery; | |
18 | 23 | import org.apache.commons.collections.CollectionUtils; |
19 | 24 | import org.apache.commons.collections.map.HashedMap; |
25 | +import org.apache.commons.lang.StringUtils; | |
20 | 26 | import org.springframework.beans.factory.annotation.Autowired; |
21 | 27 | import org.springframework.stereotype.Component; |
22 | 28 | |
... | ... | @@ -175,6 +181,86 @@ |
175 | 181 | e.printStackTrace(); |
176 | 182 | return new BaseResponse(e.getMessage(), ErrorCodeConstants.SYSTEM_ERROR); |
177 | 183 | } |
184 | + } | |
185 | + | |
186 | + public BaseResponse queryCanSrcInfo(String cardNo, String vaCardNo, Integer userId) { | |
187 | + List<ResidentsArchiveModel> residents = new ArrayList<>(); | |
188 | + | |
189 | + ResidentsArchiveQuery archiveQuery = new ResidentsArchiveQuery(); | |
190 | + archiveQuery.setYn(YnEnums.YES.getId()); | |
191 | + //身份证不为空的情况下通过身份证查询 | |
192 | + if (StringUtils.isNotEmpty(cardNo)){ | |
193 | + archiveQuery.setCertificateNum(cardNo); | |
194 | + residents = residentsArchiveService.queryResident(archiveQuery); | |
195 | + | |
196 | + //使用就诊卡号查询,先用登录ID查询属于哪家医院,然后查询到该居民的身份证号,调出所有的建档记录 | |
197 | + }else if (StringUtils.isNotEmpty(vaCardNo)){ | |
198 | + //通过用户ID查询医院ID | |
199 | + String hospitalId = autoMatchFacade.getHospitalId(userId); | |
200 | + archiveQuery.setVcCardNo(vaCardNo); | |
201 | + archiveQuery.setHospitalId(hospitalId); | |
202 | + List<ResidentsArchiveModel> archiveModelList = residentsArchiveService.queryResident(archiveQuery); | |
203 | + if (CollectionUtils.isNotEmpty(archiveModelList)){ | |
204 | + //判断身份证号是否为null | |
205 | + if (StringUtils.isEmpty(archiveModelList.get(0).getCertificateNum())){ | |
206 | + residents = archiveModelList; | |
207 | + }else { | |
208 | + archiveQuery.setHospitalId(null); | |
209 | + archiveQuery.setVcCardNo(null); | |
210 | + archiveQuery.setCertificateNum(archiveModelList.get(0).getCertificateNum()); | |
211 | + residents = residentsArchiveService.queryResident(archiveQuery); | |
212 | + } | |
213 | + } | |
214 | + } | |
215 | + | |
216 | + if (CollectionUtils.isNotEmpty(residents)) | |
217 | + { | |
218 | + | |
219 | + Map<String,Object> baseInfo = new HashMap<>(); | |
220 | + | |
221 | + ResidentsArchiveModel model = residents.get(0); | |
222 | + Map<String,Object> result = new HashMap<>(); | |
223 | + | |
224 | + result.put("userName",model.getUsername()); | |
225 | + | |
226 | + if (model.getBirthday() != null) { | |
227 | + result.put("age", com.lyms.platform.common.utils.StringUtils.unitHandle(DateUtil.getAge(model.getBirthday(), new Date()).toString(), UnitConstants.SUI)); | |
228 | + } | |
229 | + | |
230 | + result.put("sex",SexEnum.getTextById(Integer.parseInt(model.getSex()))); | |
231 | + result.put("birthday",DateUtil.getyyyy_MM_dd(model.getBirthday())); | |
232 | + result.put("phone",model.getPhone()); | |
233 | + | |
234 | + //户籍地址 | |
235 | + String addressRegister = CommonsHelper.getResidence(model.getProvinceRegisterId(), model.getCityRegisterId(), | |
236 | + model.getAreaRegisterId(), model.getStreetRegisterId(), model.getAddressRegister(), basicConfigService); | |
237 | + result.put("registAddress",addressRegister); | |
238 | + result.put("levelType",FunvCommonUtil.getBaseicConfigByid(model.getLevelTypeId(), basicConfigService)); | |
239 | + result.put("residentId", model.getId()); | |
240 | + | |
241 | + | |
242 | + List<CancerScreeningModel> cancerScreeningModels = cancerScreenService.findResIdCancerScreenList(model.getId()); | |
243 | + List<Map<String, String>> hisCancerScrList = new ArrayList<>(); | |
244 | + for (CancerScreeningModel cs : cancerScreeningModels) { | |
245 | + Map<String, String> map = new HashedMap(); | |
246 | + map.put("id", cs.getId()); | |
247 | + map.put("createTime", DateUtil.getyyyy_MM_dd(cs.getCreated())); | |
248 | + //根据用户id获取医院ID | |
249 | + Users users = usersService.getUsers(cs.getOperator()); | |
250 | + if (users != null) { | |
251 | + map.put("operUser", users.getName()); | |
252 | + } | |
253 | + hisCancerScrList.add(map); | |
254 | + } | |
255 | + | |
256 | + result.put("hisCancerScrList",hisCancerScrList); | |
257 | + | |
258 | + BaseObjectResponse response = new BaseObjectResponse(); | |
259 | + response.setData(baseInfo); | |
260 | + response.setErrorcode(ErrorCodeConstants.SUCCESS); | |
261 | + response.setErrormsg("成功"); | |
262 | + } | |
263 | + return new BaseResponse("妇女未建档,请前往妇女建档", ErrorCodeConstants.USER_NOT_EXISTS); | |
178 | 264 | } |
179 | 265 | } |