|
@@ -91,7 +91,8 @@ public class RolePrivilegeController extends ControllerSupport {
|
|
List<Long> roleIdList = Lists.newArrayList();
|
|
List<Long> roleIdList = Lists.newArrayList();
|
|
for (Role cur : roleList) {
|
|
for (Role cur : roleList) {
|
|
String roleCode = cur.getRoleCode();
|
|
String roleCode = cur.getRoleCode();
|
|
- cn.com.qmth.examcloud.core.basic.dao.entity.RoleEntity role = roleRepo.findByCode(roleCode);
|
|
|
|
|
|
+ cn.com.qmth.examcloud.core.basic.dao.entity.RoleEntity role = roleRepo
|
|
|
|
+ .findByCode(roleCode);
|
|
if (null == role) {
|
|
if (null == role) {
|
|
throw new StatusException("B-002002", "role code is wrong. roleCode=" + roleCode);
|
|
throw new StatusException("B-002002", "role code is wrong. roleCode=" + roleCode);
|
|
}
|
|
}
|
|
@@ -106,7 +107,8 @@ public class RolePrivilegeController extends ControllerSupport {
|
|
pIdSet.add(String.valueOf(cur.getPrivilegeId()));
|
|
pIdSet.add(String.valueOf(cur.getPrivilegeId()));
|
|
}
|
|
}
|
|
|
|
|
|
- List<PrivilegeEntity> privilegeList = privilegeRepo.findAllByGroupId(privilegeGroup.getId());
|
|
|
|
|
|
+ List<PrivilegeEntity> privilegeList = privilegeRepo
|
|
|
|
+ .findAllByGroupIdOrderByWeightDesc(privilegeGroup.getId());
|
|
|
|
|
|
List<PrivilegeInfo> privilegeInfoList = Lists.newArrayList();
|
|
List<PrivilegeInfo> privilegeInfoList = Lists.newArrayList();
|
|
|
|
|
|
@@ -126,6 +128,7 @@ public class RolePrivilegeController extends ControllerSupport {
|
|
privilegeInfo.setParentId(cur.getParentId());
|
|
privilegeInfo.setParentId(cur.getParentId());
|
|
privilegeInfo.setUpdateTime(cur.getUpdateTime());
|
|
privilegeInfo.setUpdateTime(cur.getUpdateTime());
|
|
privilegeInfo.setDescription(cur.getDescription());
|
|
privilegeInfo.setDescription(cur.getDescription());
|
|
|
|
+ privilegeInfo.setWeight(cur.getWeight());
|
|
privilegeInfo.setExt1(cur.getExt1());
|
|
privilegeInfo.setExt1(cur.getExt1());
|
|
privilegeInfo.setExt2(cur.getExt2());
|
|
privilegeInfo.setExt2(cur.getExt2());
|
|
privilegeInfo.setExt3(cur.getExt3());
|
|
privilegeInfo.setExt3(cur.getExt3());
|
|
@@ -168,7 +171,8 @@ public class RolePrivilegeController extends ControllerSupport {
|
|
@GetMapping("getPrivilegeTree/{groupId}")
|
|
@GetMapping("getPrivilegeTree/{groupId}")
|
|
public EleTreeNode getPrivilegeTree(@PathVariable Long groupId) {
|
|
public EleTreeNode getPrivilegeTree(@PathVariable Long groupId) {
|
|
PrivilegeGroupEntity group = privilegeGroupRepo.findOne(groupId);
|
|
PrivilegeGroupEntity group = privilegeGroupRepo.findOne(groupId);
|
|
- List<PrivilegeEntity> privilegeList = privilegeRepo.findAllByGroupId(groupId);
|
|
|
|
|
|
+ List<PrivilegeEntity> privilegeList = privilegeRepo
|
|
|
|
+ .findAllByGroupIdOrderByWeightDesc(groupId);
|
|
EleTreeNode rootNode = new EleTreeNode(-1L, group.getName());
|
|
EleTreeNode rootNode = new EleTreeNode(-1L, group.getName());
|
|
TreeUtil.convert2OneEleTreeNode(rootNode, privilegeList);
|
|
TreeUtil.convert2OneEleTreeNode(rootNode, privilegeList);
|
|
|
|
|