Commit 56a3097eea9eb77b3e63b7f2e5b5e0b3ec008f18
1 parent
12ebbc5ebf
Exists in
master
and in
1 other branch
bug fix
系统管理排序 按编辑时间倒序
Showing 3 changed files with 14 additions and 5 deletions
- platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/DepartmentsController.java
- 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/controller/RolesController.java
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/DepartmentsController.java
View file @
56a3097
... | ... | @@ -195,7 +195,7 @@ |
195 | 195 | |
196 | 196 | DepartmentsQuery departmentsQuery = new DepartmentsQuery(); |
197 | 197 | departmentsQuery.setNeed("true"); |
198 | - departmentsQuery.setSort("id desc"); | |
198 | + departmentsQuery.setSort("modified desc"); | |
199 | 199 | departmentsQuery.setYn(YnEnums.YES.getId()); |
200 | 200 | List<Integer> orgId1 = autoMatchFacade.matchOrgId(loginState.getId()); |
201 | 201 | if(null!=orgId){ |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/OrganizationController.java
View file @
56a3097
... | ... | @@ -245,7 +245,11 @@ |
245 | 245 | organizationQuery.setNeed("true"); |
246 | 246 | organizationQuery.setPage(page); |
247 | 247 | organizationQuery.setLimit(limit); |
248 | - organizationQuery.setSort("province_id desc,city_id desc,area_id desc"); | |
248 | + if(80 < limit) { //一次请求大于80 则按树排序 | |
249 | + organizationQuery.setSort("province_id desc,city_id desc,area_id desc"); | |
250 | + } else { | |
251 | + organizationQuery.setSort("modified desc"); | |
252 | + } | |
249 | 253 | } |
250 | 254 | |
251 | 255 | BasicConfig basicConfig = basicConfigService.getOneBasicConfigById(aId); |
... | ... | @@ -296,7 +300,11 @@ |
296 | 300 | organizationQuery.setNeed("true"); |
297 | 301 | organizationQuery.setPage(page); |
298 | 302 | organizationQuery.setLimit(limit); |
299 | - organizationQuery.setSort("province_id desc,city_id desc,area_id desc"); | |
303 | + if(80 < limit) { //一次请求大于80 则按树排序 | |
304 | + organizationQuery.setSort("province_id desc,city_id desc,area_id desc"); | |
305 | + } else { | |
306 | + organizationQuery.setSort("modified desc"); | |
307 | + } | |
300 | 308 | } |
301 | 309 | |
302 | 310 |
platform-operate-api/src/main/java/com/lyms/platform/operate/web/controller/RolesController.java
View file @
56a3097
... | ... | @@ -255,6 +255,7 @@ |
255 | 255 | roles.setEnable(enable); |
256 | 256 | roles.setRemarks(remarks); |
257 | 257 | roles.setShortcode(shortCode); |
258 | + roles.setModified(new Date()); | |
258 | 259 | rolesService.updateRoles(roles); |
259 | 260 | |
260 | 261 | ResultUtils.buildSuccessResultAndWrite(response); |
... | ... | @@ -349,7 +350,7 @@ |
349 | 350 | |
350 | 351 | RolesQuery rolesQuery = new RolesQuery(); |
351 | 352 | rolesQuery.setNeed("true"); |
352 | - rolesQuery.setSort("id desc"); | |
353 | + rolesQuery.setSort("modified desc"); | |
353 | 354 | rolesQuery.setYn(YnEnums.YES.getId()); |
354 | 355 | rolesQuery.setType(1); |
355 | 356 | rolesQuery.setKeyword(keyword); |
... | ... | @@ -409,7 +410,7 @@ |
409 | 410 | |
410 | 411 | RolesQuery rolesQuery = new RolesQuery(); |
411 | 412 | rolesQuery.setNeed("true"); |
412 | - rolesQuery.setSort("id desc"); | |
413 | + rolesQuery.setSort("modified desc"); | |
413 | 414 | rolesQuery.setYn(YnEnums.YES.getId()); |
414 | 415 | rolesQuery.setType(0); |
415 | 416 | rolesQuery.setKeyword(keyword); |