Commit b9c15408 authored by zjy's avatar zjy

user/role/tright 7.13

parent 74531e65
......@@ -432,7 +432,13 @@ public class RegisterServiceImpl implements RegisterService {
AuthorityVo authorityVo = authorityDaoImpl.load(authorityGetReqVo,AuthorityVo.class);
if (null == authorityVo.getPid() || authorityVo.getPid().isEmpty()){
levelOneList.add(authorityVo);
authorityIdList.remove(i);
authorityIdList.set(i,"");
}
}
List<String> authorityIds = new ArrayList<>();
for (int i = 0; i < authorityIdList.size(); i++) {
if (!"".equals(authorityIdList.get(i))){
authorityIds.add(authorityIdList.get(i));
}
}
Collections.sort(levelOneList);
......@@ -443,7 +449,7 @@ public class RegisterServiceImpl implements RegisterService {
for (AuthorityVo authorityVo:levelOneList) {
AuthorityListByLevelResVo resVo1 = new AuthorityListByLevelResVo();
ObjectHelper.writeWithFrom(resVo1,authorityVo);
List<AuthorityListByLevelResVo> childList = getChildList(authorityVo,authorityIdList);
List<AuthorityListByLevelResVo> childList = getChildList(authorityVo,authorityIds);
resVo1.setChildList(childList);
authorityListByLevel.add(resVo1);
}
......@@ -456,17 +462,19 @@ public class RegisterServiceImpl implements RegisterService {
return resVo;
}
private List<AuthorityListByLevelResVo> getChildList(AuthorityVo authorityVo,List<String> authorityIdList){
private List<AuthorityListByLevelResVo> getChildList(AuthorityVo authorityVo,List<String> authorityIds){
List<AuthorityListByLevelResVo> resVoList = new ArrayList<>();
for (int i = 0;i<authorityIdList.size();i++) {
for (int i = 0;i<authorityIds.size();i++) {
AuthorityGetReqVo authorityGetReqVo = new AuthorityGetReqVo();
authorityGetReqVo.setId(authorityIdList.get(i));
authorityGetReqVo.setId(authorityIds.get(i));
AuthorityVo authorityVo1 = authorityDaoImpl.load(authorityGetReqVo,AuthorityVo.class);
if (authorityVo1.getPid().equals(authorityVo.getId())){
List<String> authorityIdList = new ArrayList<>();
authorityIdList.addAll(authorityIds);
authorityIdList.remove(i);
AuthorityListByLevelResVo resVo = new AuthorityListByLevelResVo();
ObjectHelper.writeWithFrom(resVo,authorityVo1);
if (authorityIdList.size()>0){
if (authorityIds.size()>0){
resVo.setChildList(getChildList(authorityVo1,authorityIdList));
}
resVoList.add(resVo);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment