Commit 63012e652e8fe8421dd2edf5460e17e7774b37b9
1 parent
e5d3311496
Exists in
master
and in
1 other branch
增加
Showing 1 changed file with 17 additions and 5 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/facade/AutoMatchFacade.java
View file @
63012e6
... | ... | @@ -4,10 +4,9 @@ |
4 | 4 | import com.lyms.platform.biz.service.CommunityConfigService; |
5 | 5 | import com.lyms.platform.biz.service.PatientsService; |
6 | 6 | import com.lyms.platform.common.enums.YnEnums; |
7 | -import com.lyms.platform.permission.model.Organization; | |
8 | -import com.lyms.platform.permission.model.Users; | |
9 | -import com.lyms.platform.permission.model.UsersQuery; | |
7 | +import com.lyms.platform.permission.model.*; | |
10 | 8 | import com.lyms.platform.permission.service.OrganizationService; |
9 | +import com.lyms.platform.permission.service.UserOrganizationMapsService; | |
11 | 10 | import com.lyms.platform.permission.service.UsersService; |
12 | 11 | import com.lyms.platform.pojo.CommunityConfig; |
13 | 12 | import com.lyms.platform.pojo.Patients; |
... | ... | @@ -32,6 +31,8 @@ |
32 | 31 | private CommunityConfigService communityConfigService; |
33 | 32 | @Autowired |
34 | 33 | private PatientsService patientsService; |
34 | + @Autowired | |
35 | + private UserOrganizationMapsService userOrganizationMapsService; | |
35 | 36 | |
36 | 37 | public String match(int userId) { |
37 | 38 | UsersQuery usersQuery = new UsersQuery(); |
... | ... | @@ -44,6 +45,8 @@ |
44 | 45 | if (list.get(0).getType() == 1) { |
45 | 46 | Organization organization = organizationService.getOrganization(list.get(0).getOrgId()); |
46 | 47 | return organization.getAreaId(); |
48 | + }else { | |
49 | + | |
47 | 50 | } |
48 | 51 | } |
49 | 52 | return null; |
50 | 53 | |
... | ... | @@ -64,10 +67,19 @@ |
64 | 67 | data.add(users.getOrgId()); |
65 | 68 | } |
66 | 69 | } |
67 | - return data; | |
70 | + } else{ | |
71 | + UserOrganizationMapsQuery userOrganizationMapsQuery = new UserOrganizationMapsQuery(); | |
72 | + userOrganizationMapsQuery.setUserId(list.get(0).getId()); | |
73 | + userOrganizationMapsQuery.setYn(YnEnums.YES.getId()); | |
74 | + List<UserOrganizationMaps> list1 = userOrganizationMapsService.queryUserOrganizationMaps(userOrganizationMapsQuery); | |
75 | + if(CollectionUtils.isNotEmpty(list1)){ | |
76 | + for(UserOrganizationMaps userOrganizationMaps:list1){ | |
77 | + data.add(userOrganizationMaps.getOrgId()); | |
78 | + } | |
79 | + } | |
68 | 80 | } |
69 | 81 | } |
70 | - return null; | |
82 | + return data; | |
71 | 83 | } |
72 | 84 | |
73 | 85 |