Commit 8b8db964742b847d4fd6399ac50057fbccd7e455
1 parent
128e77e403
Exists in
master
and in
1 other branch
孕妇基本信息查询
Showing 2 changed files with 35 additions and 9 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/BookbuildingController.java
View file @
8b8db96
| ... | ... | @@ -134,8 +134,10 @@ |
| 134 | 134 | */ |
| 135 | 135 | @RequestMapping(value = "/queryYunBuildInfo", method = RequestMethod.GET) |
| 136 | 136 | @ResponseBody |
| 137 | - public BaseObjectResponse queryYunBuildInfo(@RequestParam(required = false) String cardNo,@RequestParam(required = false) String phone){ | |
| 138 | - BaseObjectResponse objectResponse = bookbuildingFacade.queryYunBuildInfo(cardNo,phone); | |
| 137 | + @TokenRequired | |
| 138 | + public BaseObjectResponse queryYunBuildInfo(HttpServletRequest request,@RequestParam(required = false) String cardNo,@RequestParam(required = false) String vcCardNo){ | |
| 139 | + LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); | |
| 140 | + BaseObjectResponse objectResponse = bookbuildingFacade.queryYunBuildInfo(cardNo,vcCardNo,loginState.getId()); | |
| 139 | 141 | return objectResponse; |
| 140 | 142 | } |
| 141 | 143 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/BookbuildingFacade.java
View file @
8b8db96
| ... | ... | @@ -16,7 +16,9 @@ |
| 16 | 16 | import com.lyms.platform.operate.web.result.PregnantInfoResult; |
| 17 | 17 | import com.lyms.platform.permission.model.Organization; |
| 18 | 18 | import com.lyms.platform.permission.model.OrganizationQuery; |
| 19 | +import com.lyms.platform.permission.model.Users; | |
| 19 | 20 | import com.lyms.platform.permission.service.OrganizationService; |
| 21 | +import com.lyms.platform.permission.service.UsersService; | |
| 20 | 22 | import com.lyms.platform.pojo.*; |
| 21 | 23 | import com.lyms.platform.query.*; |
| 22 | 24 | import org.apache.commons.collections.CollectionUtils; |
| ... | ... | @@ -59,6 +61,9 @@ |
| 59 | 61 | @Autowired |
| 60 | 62 | private SmsConfigService smsConfigService; |
| 61 | 63 | |
| 64 | + @Autowired | |
| 65 | + private UsersService usersService; | |
| 66 | + | |
| 62 | 67 | /** |
| 63 | 68 | * 添加孕妇建档 |
| 64 | 69 | * @param yunRequest |
| 65 | 70 | |
| 66 | 71 | |
| 67 | 72 | |
| 68 | 73 | |
| 69 | 74 | |
| 70 | 75 | |
| ... | ... | @@ -727,20 +732,39 @@ |
| 727 | 732 | } |
| 728 | 733 | |
| 729 | 734 | /** |
| 730 | - * 查询孕妇基本信息 通过手机号码或者身份证 | |
| 735 | + * 查询孕妇基本信息 通过就诊卡号或者身份证 | |
| 731 | 736 | * @param cardNo |
| 732 | - * @param phone | |
| 737 | + * @param vcCardNo | |
| 733 | 738 | * @return |
| 734 | 739 | */ |
| 735 | - public BaseObjectResponse queryYunBuildInfo(String cardNo, String phone) { | |
| 740 | + public BaseObjectResponse queryYunBuildInfo(String cardNo, String vcCardNo,Integer userId) { | |
| 736 | 741 | Patients pat = null; |
| 737 | - if (StringUtils.isNotEmpty(cardNo) || StringUtils.isNotEmpty(phone)) | |
| 742 | + PatientsQuery patientsQuery = new PatientsQuery(); | |
| 743 | + patientsQuery.setYn(YnEnums.YES.getId()); | |
| 744 | + if (StringUtils.isNotEmpty(cardNo)) | |
| 738 | 745 | { |
| 739 | - PatientsQuery patientsQuery = new PatientsQuery(); | |
| 740 | - patientsQuery.setYn(YnEnums.YES.getId()); | |
| 741 | 746 | patientsQuery.setCardNo(cardNo); |
| 742 | - patientsQuery.setPhone(phone); | |
| 747 | + List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); | |
| 748 | + if (CollectionUtils.isNotEmpty(patients)) | |
| 749 | + { | |
| 750 | + pat = patients.get(0); | |
| 751 | + } | |
| 752 | + } | |
| 743 | 753 | |
| 754 | + String hospitalId = ""; | |
| 755 | + //得到当前登录的医院id | |
| 756 | + if (userId != null) | |
| 757 | + { | |
| 758 | + Users dbuser = usersService.getUsers(userId); | |
| 759 | + if (dbuser != null) { | |
| 760 | + hospitalId = String.valueOf(dbuser.getOrgId()); | |
| 761 | + } | |
| 762 | + } | |
| 763 | + | |
| 764 | + if (StringUtils.isNotEmpty(vcCardNo) && StringUtils.isNotEmpty(hospitalId)) | |
| 765 | + { | |
| 766 | + patientsQuery.setVcCardNo(vcCardNo); | |
| 767 | + patientsQuery.setHospitalId(hospitalId); | |
| 744 | 768 | List<Patients> patients = yunBookbuildingService.queryPregnantWithQuery(patientsQuery); |
| 745 | 769 | if (CollectionUtils.isNotEmpty(patients)) |
| 746 | 770 | { |