|
@ -754,7 +754,7 @@ public class ProRoleService implements IProRoleService { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public RoleVo.JueSeByProIdLists queryRoleShows(QueryDto<RoleDto.QueryRoleShows> param) { |
|
|
public RoleVo.JueSeByProIdLists queryRoleShows(QueryDto<RoleDto.QueryRoleShows> param) throws Exception { |
|
|
RoleVo.JueSeByProIdLists jueSeByProIdLists=new RoleVo.JueSeByProIdLists(); |
|
|
RoleVo.JueSeByProIdLists jueSeByProIdLists=new RoleVo.JueSeByProIdLists(); |
|
|
//获取成员id
|
|
|
//获取成员id
|
|
|
Long memberId = queryMemberId(param.getParam().getProjectId(), param.getUserId()); |
|
|
Long memberId = queryMemberId(param.getParam().getProjectId(), param.getUserId()); |
|
@ -769,18 +769,46 @@ public class ProRoleService implements IProRoleService { |
|
|
List<ProRole> proRoles = proRoleMapper.selectByExample(proRoleExample1); |
|
|
List<ProRole> proRoles = proRoleMapper.selectByExample(proRoleExample1); |
|
|
List<Long> jili1=proRoles.stream().map(action->action.getId()).collect(Collectors.toList()); |
|
|
List<Long> jili1=proRoles.stream().map(action->action.getId()).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
|
|
//获取用户在项目中的角色
|
|
|
|
|
|
List<ProRole> roleList = proMemberService.selectRolesByUserIdAndProjectId(param.getUserId(), param.getParam().getProjectId(), 0); |
|
|
|
|
|
|
|
|
//查询已经添加的角色
|
|
|
//查询已经添加的角色
|
|
|
List<RoleVo.JueSeByProId> listBefor=proRoleDao.queryRoleShowslistAfter(memberId); |
|
|
List<RoleVo.JueSeByProId> listBefor=proRoleDao.queryRoleShowslistAfter(memberId); |
|
|
List<Long> listBeforeId= listBefor.stream().map(action ->{return action.getId();}).collect(Collectors.toList()); |
|
|
List<Long> listBeforeId= listBefor.stream().map(action ->{return action.getId();}).collect(Collectors.toList()); |
|
|
for (int i = 0; i < listBefor.size(); i++) { |
|
|
for (int i = 0; i < listBefor.size(); i++) { |
|
|
|
|
|
//是否项目经理
|
|
|
if(jili1.contains(listBefor.get(i).getId())){ |
|
|
if(jili1.contains(listBefor.get(i).getId())){ |
|
|
listBefor.get(i).setIsPM(true); |
|
|
listBefor.get(i).setIsPM(true); |
|
|
}else { |
|
|
}else { |
|
|
listBefor.get(i).setIsPM(false); |
|
|
listBefor.get(i).setIsPM(false); |
|
|
} |
|
|
} |
|
|
|
|
|
//当前用户是否属于该角色
|
|
|
|
|
|
for (ProRole proRole : roleList) { |
|
|
|
|
|
if (listBefor.get(i).getId().equals(proRole.getId())){ |
|
|
|
|
|
listBefor.get(i).setMine(true); |
|
|
|
|
|
}else{ |
|
|
|
|
|
listBefor.get(i).setMine(false); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
//查询未添加的角色
|
|
|
//查询未添加的角色
|
|
|
List<RoleVo.JueSeByProId> listAfter=proRoleDao.queryRoleShowslistBefore(param.getParam().getProjectId(),listBeforeId); |
|
|
List<RoleVo.JueSeByProId> listAfter=proRoleDao.queryRoleShowslistBefore(param.getParam().getProjectId(),listBeforeId); |
|
|
|
|
|
for (int i = 0; i < listAfter.size(); i++) { |
|
|
|
|
|
//是否项目经理
|
|
|
|
|
|
if(jili1.contains(listBefor.get(i).getId())){ |
|
|
|
|
|
listBefor.get(i).setIsPM(true); |
|
|
|
|
|
}else { |
|
|
|
|
|
listBefor.get(i).setIsPM(false); |
|
|
|
|
|
} |
|
|
|
|
|
//当前用户是否属于该角色
|
|
|
|
|
|
for (ProRole proRole : roleList) { |
|
|
|
|
|
if (listBefor.get(i).getId().equals(proRole.getId())){ |
|
|
|
|
|
listBefor.get(i).setMine(true); |
|
|
|
|
|
}else{ |
|
|
|
|
|
listBefor.get(i).setMine(false); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
jueSeByProIdLists.setListAfter(listAfter); |
|
|
jueSeByProIdLists.setListAfter(listAfter); |
|
|
jueSeByProIdLists.setListBefore(listBefor); |
|
|
jueSeByProIdLists.setListBefore(listBefor); |
|
|
return jueSeByProIdLists; |
|
|
return jueSeByProIdLists; |
|
|