Commit 6063efe513e467876583f0d73abef90ef58d1d9d
1 parent
02947896b5
Exists in
master
and in
8 other branches
座机号 替换的问题
Showing 2 changed files with 68 additions and 4 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java
View file @
6063efe
| ... | ... | @@ -132,6 +132,19 @@ |
| 132 | 132 | return antenatalExaminationFacade.queryAntenatalExamination(antenatalExaminationQueryRequest,loginState.getId()); |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | + /** | |
| 136 | + * 获取本院最近 | |
| 137 | + * @return | |
| 138 | + */ | |
| 139 | + @RequestMapping(value = "/queryPregnant", method = RequestMethod.GET) | |
| 140 | + @ResponseBody | |
| 141 | + @TokenRequired | |
| 142 | + public BaseResponse queryLatePregnant(HttpServletRequest request,@RequestParam("parentId")String parentId){ | |
| 143 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 144 | + return bookbuildingFacade.findPatientById(parentId,loginState.getId()); | |
| 145 | + } | |
| 146 | + | |
| 147 | + | |
| 135 | 148 | |
| 136 | 149 | /** |
| 137 | 150 | * 建档页面基础数据 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
6063efe
| ... | ... | @@ -12,10 +12,7 @@ |
| 12 | 12 | import com.lyms.platform.operate.web.request.BookbuildingQueryRequest; |
| 13 | 13 | import com.lyms.platform.operate.web.request.MessageListRequest; |
| 14 | 14 | import com.lyms.platform.operate.web.request.MessageRequest; |
| 15 | -import com.lyms.platform.operate.web.result.BasicConfigResult; | |
| 16 | -import com.lyms.platform.operate.web.result.BookbuildingRecordResult; | |
| 17 | -import com.lyms.platform.operate.web.result.HighScoreResult; | |
| 18 | -import com.lyms.platform.operate.web.result.PregnantInfoResult; | |
| 15 | +import com.lyms.platform.operate.web.result.*; | |
| 19 | 16 | import com.lyms.platform.operate.web.utils.JdbcUtil; |
| 20 | 17 | import com.lyms.platform.operate.web.utils.MessageCenterService; |
| 21 | 18 | import com.lyms.platform.permission.model.Organization; |
| 22 | 19 | |
| 23 | 20 | |
| ... | ... | @@ -1374,8 +1371,62 @@ |
| 1374 | 1371 | { |
| 1375 | 1372 | logger.error(e +"",e); |
| 1376 | 1373 | } |
| 1374 | + } | |
| 1377 | 1375 | |
| 1376 | + public BaseResponse findPatientById(String parentId,Integer userId){ | |
| 1377 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 1378 | + patientsQuery.setId(parentId); | |
| 1379 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 1380 | + patientsQuery.setHospitalId(autoMatchFacade.getHospitalId(userId)); | |
| 1381 | + PregnantInfoResult result = new PregnantInfoResult(); | |
| 1382 | + SimplePregnantResult patientResult =new SimplePregnantResult(); | |
| 1383 | + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
| 1384 | + if (patients != null && patients.size() > 0) | |
| 1385 | + { | |
| 1386 | + Patients p = patients.get(0); | |
| 1387 | + result = getResult(p); | |
| 1378 | 1388 | |
| 1389 | + patientResult.setId(result.getId()); | |
| 1390 | + patientResult.setPid(result.getPid()); | |
| 1391 | + | |
| 1392 | + patientResult.setPregnantName(result.getPregnantName()); | |
| 1393 | + patientResult.setPregnantPhone(result.getPregnantPhone()); | |
| 1394 | + patientResult.setPregnantAge(DateUtil.getAge(p.getBirth()) + ""); | |
| 1395 | + patientResult.setPregnantLiveAddr(result.getPregnantLiveAddr()); | |
| 1396 | + patientResult.setPregnantLiveProvinceId(result.getPregnantLiveProvinceId()); | |
| 1397 | + patientResult.setPregnantLiveCityId(result.getPregnantLiveCityId()); | |
| 1398 | + patientResult.setPregnantLiveAreaId(result.getPregnantLiveAreaId()); | |
| 1399 | + patientResult.setPregnantLiveStreetId(result.getPregnantLiveStreetId()); | |
| 1400 | + | |
| 1401 | + patientResult.setHusbandName(result.getHusbandName()); | |
| 1402 | + //丈夫证件号 | |
| 1403 | + if(StringUtils.isNotEmpty(result.getHusbandCertificateNum()) &&result.getHusbandCertificateNum().length()==18){ | |
| 1404 | + | |
| 1405 | + int years,months,days; | |
| 1406 | + try{ | |
| 1407 | + String year = result.getHusbandCertificateNum().substring(6,10); | |
| 1408 | + String month = result.getHusbandCertificateNum().substring(10, 12); | |
| 1409 | + String day = result.getHusbandCertificateNum().substring(12,14); | |
| 1410 | + years=Integer.valueOf(year); | |
| 1411 | + months=Integer.valueOf(month); | |
| 1412 | + days=Integer.valueOf(day); | |
| 1413 | + Calendar calendar=Calendar.getInstance(); | |
| 1414 | + calendar.set(years,months-1,days); | |
| 1415 | + patientResult.setHusbandAge(DateUtil.getAge(calendar.getTime())+""); | |
| 1416 | + }catch (Exception e){ | |
| 1417 | + } | |
| 1418 | + } | |
| 1419 | + | |
| 1420 | + patientResult.setHusbandCertificateNum(result.getHusbandCertificateNum()); | |
| 1421 | + patientResult.setHusbandCertificateTypeId(result.getHusbandCertificateTypeId()); | |
| 1422 | + patientResult.setHusbandPhone(result.getHusbandPhone()); | |
| 1423 | + } | |
| 1424 | + | |
| 1425 | + BaseObjectResponse objectResponse = new BaseObjectResponse(); | |
| 1426 | + objectResponse.setData(patientResult); | |
| 1427 | + objectResponse.setErrorcode(ErrorCodeConstants.SUCCESS); | |
| 1428 | + objectResponse.setErrormsg("成功"); | |
| 1429 | + return objectResponse; | |
| 1379 | 1430 | } |
| 1380 | 1431 | } |