Commit b2ad6b6e17cafc54fc916aa49e910afe4ae389f5
1 parent
90a194492d
Exists in
master
and in
6 other branches
产后访视
Showing 1 changed file with 32 additions and 55 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/MatDeliverFacade.java
View file @
b2ad6b6
| ... | ... | @@ -1724,67 +1724,44 @@ |
| 1724 | 1724 | //根据用户id获取医院ID |
| 1725 | 1725 | String hospitalId = autoMatchFacade.getHospitalId(matdeliverFollowRequest.getOperatorId()); |
| 1726 | 1726 | |
| 1727 | - // 构造医院id集合 | |
| 1728 | - List<String> hospitalList = new ArrayList<>(); | |
| 1729 | 1727 | List<String> fmhospitalId = new ArrayList<>(); |
| 1730 | - //传入了具体的医院id | |
| 1731 | 1728 | if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalId())) { |
| 1732 | - hospitalList.add(matdeliverFollowRequest.getHospitalId()); | |
| 1733 | - if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalProvinceId()) || StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalCityId()) || StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalAreaId())) { | |
| 1734 | - matDeliverQuery.setFmHospitalList(hospitalList); | |
| 1729 | + fmhospitalId.add(matdeliverFollowRequest.getHospitalId()); | |
| 1730 | + matDeliverQuery.setFmHospitalList(fmhospitalId); | |
| 1731 | + } | |
| 1732 | + else if(StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalProvinceId()) || StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalCityId()) || StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalAreaId())) | |
| 1733 | + { | |
| 1734 | + OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 1735 | + if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalProvinceId())) { | |
| 1736 | + organizationQuery.setProvinceId(matdeliverFollowRequest.getHospitalProvinceId()); | |
| 1735 | 1737 | } |
| 1736 | - | |
| 1737 | - } else { | |
| 1738 | - | |
| 1739 | - //默认添加当前医院 | |
| 1740 | - hospitalList.add(hospitalId); | |
| 1741 | - | |
| 1742 | - /* DataPermissionsModelQuery dataPermissionsModelQuery = new DataPermissionsModelQuery(); | |
| 1743 | - dataPermissionsModelQuery.setUserId(matdeliverFollowRequest.getOperatorId()); | |
| 1744 | - List<DataPermissionsModel> dataPermissionsModelList = dataPermissionService.queryPermission(dataPermissionsModelQuery); | |
| 1745 | - if (CollectionUtils.isNotEmpty(dataPermissionsModelList)) { | |
| 1746 | - Map data = dataPermissionsModelList.get(0).getData(); | |
| 1747 | - for (Object hosId : data.keySet()) { | |
| 1748 | - if (StringUtils.isNotEmpty(hosId.toString()) && !hospitalList.contains(hosId.toString())) { | |
| 1749 | - hospitalList.add(hosId.toString()); | |
| 1750 | - } | |
| 1738 | + if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalCityId())) { | |
| 1739 | + organizationQuery.setCityId(matdeliverFollowRequest.getHospitalCityId()); | |
| 1740 | + } | |
| 1741 | + if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalAreaId())) { | |
| 1742 | + organizationQuery.setAreaId(matdeliverFollowRequest.getHospitalAreaId()); | |
| 1743 | + } | |
| 1744 | + organizationQuery.setYn(YnEnums.YES.getId()); | |
| 1745 | + List<Organization> organizationList = organizationService.queryHospitals(organizationQuery); | |
| 1746 | + if (CollectionUtils.isNotEmpty(organizationList)) { | |
| 1747 | + for (Organization organization : organizationList) { | |
| 1748 | + fmhospitalId.add(organization.getId().toString()); | |
| 1751 | 1749 | } |
| 1752 | - }*/ | |
| 1753 | - // 未传入查询条件,进行院内系统进行查询 | |
| 1754 | - if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalProvinceId()) || StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalCityId()) || StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalAreaId())) { | |
| 1755 | - // 传入了查询条件 | |
| 1756 | - OrganizationQuery organizationQuery = new OrganizationQuery(); | |
| 1757 | - if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalProvinceId())) { | |
| 1758 | - organizationQuery.setProvinceId(matdeliverFollowRequest.getHospitalProvinceId()); | |
| 1759 | - } | |
| 1760 | - if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalCityId())) { | |
| 1761 | - organizationQuery.setCityId(matdeliverFollowRequest.getHospitalCityId()); | |
| 1762 | - } | |
| 1763 | - if (StringUtils.isNotEmpty(matdeliverFollowRequest.getHospitalAreaId())) { | |
| 1764 | - organizationQuery.setAreaId(matdeliverFollowRequest.getHospitalAreaId()); | |
| 1765 | - } | |
| 1766 | - organizationQuery.setYn(YnEnums.YES.getId()); | |
| 1767 | - List<Organization> organizationList = organizationService.queryHospitals(organizationQuery); | |
| 1768 | - List<String> orgId = new ArrayList<>(); | |
| 1769 | - if (CollectionUtils.isNotEmpty(organizationList)) { | |
| 1770 | - for (Organization organization : organizationList) { | |
| 1771 | - orgId.add(organization.getId().toString()); | |
| 1772 | - fmhospitalId.add(organization.getId().toString()); | |
| 1773 | - } | |
| 1774 | - } | |
| 1750 | + } | |
| 1775 | 1751 | |
| 1776 | - if (CollectionUtils.isEmpty(fmhospitalId)) { | |
| 1777 | - return listResponse; | |
| 1778 | - } else { | |
| 1779 | - hospitalList.retainAll(fmhospitalId); | |
| 1780 | - if (CollectionUtils.isEmpty(fmhospitalId)) { | |
| 1781 | - return listResponse; | |
| 1782 | - } | |
| 1783 | - matDeliverQuery.setFmHospitalList(hospitalList); | |
| 1784 | - } | |
| 1752 | + if (CollectionUtils.isNotEmpty(fmhospitalId)) | |
| 1753 | + { | |
| 1754 | + if (!fmhospitalId.contains(hospitalId)) | |
| 1755 | + { | |
| 1756 | + fmhospitalId.contains(hospitalId); | |
| 1785 | 1757 | } |
| 1758 | + matDeliverQuery.setFmHospitalList(fmhospitalId); | |
| 1786 | 1759 | } |
| 1787 | - | |
| 1760 | + else | |
| 1761 | + { | |
| 1762 | + return listResponse; | |
| 1763 | + } | |
| 1764 | + } | |
| 1788 | 1765 | |
| 1789 | 1766 | if (matdeliverFollowRequest.getFollowStarDate() != null) { |
| 1790 | 1767 | MatDeliverFollowQuery matDeliverFollowQuery = new MatDeliverFollowQuery(); |