Commit 133f87811f5bfac3a77f05bd0ac44ea058412703
1 parent
a096bd0462
Exists in
master
and in
8 other branches
platform permission
add return pageinfo
Showing 1 changed file with 23 additions and 0 deletions
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
133f878
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | import com.lyms.platform.operate.web.result.FrontEndResult; |
11 | 11 | import com.lyms.platform.permission.model.Organization; |
12 | 12 | import com.lyms.platform.permission.model.OrganizationQuery; |
13 | +import com.lyms.platform.permission.model.Regions; | |
13 | 14 | import com.lyms.platform.permission.model.Users; |
14 | 15 | import com.lyms.platform.permission.service.*; |
15 | 16 | import org.apache.commons.lang.StringUtils; |
... | ... | @@ -33,6 +34,8 @@ |
33 | 34 | private TokenService tokenService; |
34 | 35 | @Autowired |
35 | 36 | private OrganizationService organizationService; |
37 | + @Autowired | |
38 | + private RegionsService regionsService; | |
36 | 39 | |
37 | 40 | |
38 | 41 | /** |
39 | 42 | |
40 | 43 | |
41 | 44 | |
42 | 45 | |
... | ... | @@ -188,16 +191,36 @@ |
188 | 191 | limit = limit == null ? 10 : limit; |
189 | 192 | page = page == null ? 1 : page; |
190 | 193 | |
194 | + Regions regions = null; | |
195 | + if(null != areaId) { | |
196 | + regions = regionsService.getRegions(areaId); | |
197 | + } | |
191 | 198 | |
199 | + | |
192 | 200 | OrganizationQuery organizationQuery = new OrganizationQuery(); |
193 | 201 | organizationQuery.setId(id); |
194 | 202 | organizationQuery.setNeed("true"); |
195 | 203 | organizationQuery.setSort("id desc"); |
196 | 204 | organizationQuery.setYn(YnEnums.YES.getId()); |
197 | 205 | organizationQuery.setPage(page); |
206 | + organizationQuery.setProvinceId(areaId); | |
198 | 207 | organizationQuery.setLimit(limit); |
199 | 208 | organizationQuery.setKeyword(keyword); |
209 | + | |
210 | + if(regions.getLevel().equals(1)) { | |
211 | + organizationQuery.setProvinceId(areaId); | |
212 | + } | |
213 | + if(regions.getLevel().equals(2)) { | |
214 | + organizationQuery.setCityId(areaId); | |
215 | + } | |
216 | + if(regions.getLevel().equals(3)) { | |
217 | + organizationQuery.setAreaId(areaId); | |
218 | + } | |
219 | + | |
200 | 220 | List<Organization> organizations = organizationService.queryOrganization(organizationQuery); |
221 | + | |
222 | + | |
223 | + | |
201 | 224 | |
202 | 225 | FrontEndResult frontEndResult = new FrontEndResult(); |
203 | 226 | frontEndResult.setData(organizations); |