Commit 2debc90fea4c55ceb492499a5bea646d9cb2f4f1
1 parent
d9833f344f
Exists in
master
and in
1 other branch
增加
Showing 5 changed files with 31 additions and 8 deletions
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/OrganizationQuery.java
- platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java
- platform-biz-service/src/main/resources/mainOrm/Organization.xml
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AutoMatchFacade.java
platform-biz-service/src/main/java/com/lyms/platform/permission/model/OrganizationQuery.java
View file @
2debc90
| ... | ... | @@ -29,6 +29,15 @@ |
| 29 | 29 | private String foreignId; |
| 30 | 30 | |
| 31 | 31 | private List<Integer> typeList; |
| 32 | + private List<Integer> idList; | |
| 33 | + | |
| 34 | + public List<Integer> getIdList() { | |
| 35 | + return idList; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public void setIdList(List<Integer> idList) { | |
| 39 | + this.idList = idList; | |
| 40 | + } | |
| 32 | 41 | |
| 33 | 42 | public List<Integer> getTypeList() { |
| 34 | 43 | return typeList; |
platform-biz-service/src/main/java/com/lyms/platform/permission/model/UsersQuery.java
View file @
2debc90
| ... | ... | @@ -29,7 +29,7 @@ |
| 29 | 29 | private String keyword; |
| 30 | 30 | private Integer roleId; |
| 31 | 31 | private String foreignId; |
| 32 | - private Integer otherAccount; //µÚÈý·½ÕʺÅ, 1Ò½ÔºÕʺŠ| |
| 32 | + private Integer otherAccount; //第三方å¸å·, 1医院å¸å· | |
| 33 | 33 | public Integer getOtherAccount() { |
| 34 | 34 | return otherAccount; |
| 35 | 35 | } |
platform-biz-service/src/main/resources/mainOrm/Organization.xml
View file @
2debc90
| ... | ... | @@ -117,6 +117,12 @@ |
| 117 | 117 | <if test="id != null and id >= 0"> |
| 118 | 118 | and id = #{id,jdbcType=INTEGER} |
| 119 | 119 | </if> |
| 120 | + <if test="idList !=null and idList.size() >0"> | |
| 121 | + and id in | |
| 122 | + <foreach collection="idList" index="index" item="item" open="(" separator="," close=")"> | |
| 123 | + #{item} | |
| 124 | + </foreach> | |
| 125 | + </if> | |
| 120 | 126 | <if test="foreignId != null and foreignId != ''"> |
| 121 | 127 | and foreign_id = #{foreignId,jdbcType=VARCHAR} |
| 122 | 128 | </if> |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
2debc90
| ... | ... | @@ -212,24 +212,24 @@ |
| 212 | 212 | public FrontEndResult getOrganization(HttpServletRequest request) { |
| 213 | 213 | LoginContext loginState = (LoginContext) request.getAttribute("loginContext"); |
| 214 | 214 | |
| 215 | - String areaId = autoMatchFacade.match(loginState.getId()); | |
| 215 | + List<Integer> areaId = autoMatchFacade.matchOrgId(loginState.getId()); | |
| 216 | 216 | List<Map> data = new ArrayList<>(); |
| 217 | 217 | List<Organization> organizations; |
| 218 | - if (StringUtils.isNotEmpty(areaId)) { | |
| 218 | + if (CollectionUtils.isNotEmpty(areaId)) { | |
| 219 | 219 | OrganizationQuery organizationQuery = new OrganizationQuery(); |
| 220 | - organizationQuery.setAreaId(areaId); | |
| 220 | + organizationQuery.setIdList(areaId); | |
| 221 | 221 | List<Integer> list = new ArrayList<>(); |
| 222 | 222 | list.add(3); |
| 223 | 223 | list.add(4); |
| 224 | 224 | organizationQuery.setYn(YnEnums.YES.getId()); |
| 225 | - organizationQuery.setTypeList(list); | |
| 225 | +// organizationQuery.setTypeList(list); | |
| 226 | 226 | organizations = organizationService.queryOrganization(organizationQuery); |
| 227 | 227 | |
| 228 | 228 | } else { |
| 229 | 229 | UserOrganizationMapsQuery userOrganizationMapsQuery = new UserOrganizationMapsQuery(); |
| 230 | 230 | userOrganizationMapsQuery.setYn(YnEnums.YES.getId()); |
| 231 | 231 | userOrganizationMapsQuery.setUserId(loginState.getId()); |
| 232 | - organizations = accessPermissionFacade.findAccessPerminssionByUserId(loginState.getId()); | |
| 232 | + organizations = accessPermissionFacade.findAccessPerminssionByUserId(loginState.getId()); | |
| 233 | 233 | |
| 234 | 234 | } |
| 235 | 235 | if (CollectionUtils.isNotEmpty(organizations)) { |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AutoMatchFacade.java
View file @
2debc90
| ... | ... | @@ -33,6 +33,8 @@ |
| 33 | 33 | private PatientsService patientsService; |
| 34 | 34 | @Autowired |
| 35 | 35 | private UserOrganizationMapsService userOrganizationMapsService; |
| 36 | + @Autowired | |
| 37 | + private AccessPermissionFacade accessPermissionFacade; | |
| 36 | 38 | |
| 37 | 39 | public String match(int userId) { |
| 38 | 40 | UsersQuery usersQuery = new UsersQuery(); |
| ... | ... | @@ -68,7 +70,13 @@ |
| 68 | 70 | } |
| 69 | 71 | } |
| 70 | 72 | } else{ |
| 71 | - UserOrganizationMapsQuery userOrganizationMapsQuery = new UserOrganizationMapsQuery(); | |
| 73 | + List<Organization> list2 =accessPermissionFacade.findAccessPerminssionByUserId(list.get(0).getId()); | |
| 74 | + if(CollectionUtils.isNotEmpty(list2)){ | |
| 75 | + for(Organization organization:list2){ | |
| 76 | + data.add(organization.getId()); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + /*UserOrganizationMapsQuery userOrganizationMapsQuery = new UserOrganizationMapsQuery(); | |
| 72 | 80 | userOrganizationMapsQuery.setUserId(list.get(0).getId()); |
| 73 | 81 | userOrganizationMapsQuery.setYn(YnEnums.YES.getId()); |
| 74 | 82 | List<UserOrganizationMaps> list1 = userOrganizationMapsService.queryUserOrganizationMaps(userOrganizationMapsQuery); |
| ... | ... | @@ -76,7 +84,7 @@ |
| 76 | 84 | for(UserOrganizationMaps userOrganizationMaps:list1){ |
| 77 | 85 | data.add(userOrganizationMaps.getOrgId()); |
| 78 | 86 | } |
| 79 | - } | |
| 87 | + }*/ | |
| 80 | 88 | } |
| 81 | 89 | } |
| 82 | 90 | return data; |