| @@ -183,14 +183,13 @@ public class GroupService extends AbstractBaseEntityService<Group, Long, GroupRe | |||||
| + " a.authority," | + " a.authority," | ||||
| + " a.name," | + " a.name," | ||||
| + " a.description, "); | + " a.description, "); | ||||
| // if (args.containsKey("userId")) | |||||
| // sql.append(" EXISTS(SELECT 1 FROM group_authority WHERE authority = a.authority AND groupId = :groupId) AS v"); | |||||
| // else | |||||
| if (args.containsKey("groupId")) | |||||
| sql.append(" EXISTS(SELECT 1 FROM group_authority ga WHERE a.id = ga.authId AND groupId = :groupId) AS v"); | |||||
| else | |||||
| sql.append(" 0 AS v"); | sql.append(" 0 AS v"); | ||||
| sql.append(" FROM authority a" | sql.append(" FROM authority a" | ||||
| + " ORDER BY a.module, a.name"); | + " ORDER BY a.module, a.name"); | ||||
| return jdbcDao.queryForList(sql.toString(), args); | return jdbcDao.queryForList(sql.toString(), args); | ||||
| } | } | ||||
| } | } | ||||
| @@ -25,6 +25,8 @@ public class UserRecord { | |||||
| private String phone2; | private String phone2; | ||||
| private String remarks; | private String remarks; | ||||
| private Long groupId; | |||||
| public Integer getId() { | public Integer getId() { | ||||
| return id; | return id; | ||||
| } | } | ||||
| @@ -152,4 +154,10 @@ public class UserRecord { | |||||
| this.remarks = remarks; | this.remarks = remarks; | ||||
| } | } | ||||
| public Long getGroupId() { | |||||
| return groupId; | |||||
| } | |||||
| public void setGroupId(Long groupId) { this.groupId = groupId; } | |||||
| } | } | ||||
| @@ -1,5 +1,6 @@ | |||||
| package com.ffii.tsms.modules.user.web; | package com.ffii.tsms.modules.user.web; | ||||
| import java.util.HashMap; | |||||
| import java.util.Map; | import java.util.Map; | ||||
| import org.apache.commons.logging.Log; | import org.apache.commons.logging.Log; | ||||
| @@ -77,12 +78,14 @@ public class GroupController{ | |||||
| .build())); | .build())); | ||||
| } | } | ||||
| @GetMapping("/auth/combo") | |||||
| public RecordsRes<Map<String, Object>> authComboJson(HttpServletRequest request) throws ServletRequestBindingException { | |||||
| @GetMapping("/auth/combo/{id}") | |||||
| public RecordsRes<Map<String, Object>> authComboJson(HttpServletRequest request, @PathVariable("id") int id) throws ServletRequestBindingException { | |||||
| System.out.println(request); | System.out.println(request); | ||||
| return new RecordsRes<>(groupService.listGroupAuth( | |||||
| CriteriaArgsBuilder.withRequest(request) | |||||
| .build())); | |||||
| Map<String, Object> args = new HashMap<>(); | |||||
| if (id != 0) | |||||
| args.put("groupId", id); | |||||
| return new RecordsRes<>(groupService.listGroupAuth(args)); | |||||
| } | } | ||||
| } | } | ||||