use of com.jeeagile.system.entity.AgileSysRoleDept in project jeeagile by jeeagile.
the class AgileSysRoleServiceImpl method selectRoleDeptIdList.
/**
* 查询角色已分配数据权限
*
* @param roleId
* @return
*/
private List<String> selectRoleDeptIdList(Serializable roleId) {
LambdaQueryWrapper<AgileSysRoleDept> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(AgileSysRoleDept::getRoleId, roleId);
List<AgileSysRoleDept> roleDeptList = agileSysRoleDeptService.list(lambdaQueryWrapper);
List<String> roleDeptIdList = new ArrayList<>();
for (AgileSysRoleDept sysRoleDept : roleDeptList) {
if (agileSysDeptService.countChild(sysRoleDept.getDeptId()) < 1) {
roleDeptIdList.add(sysRoleDept.getDeptId());
}
}
return roleDeptIdList;
}
use of com.jeeagile.system.entity.AgileSysRoleDept in project jeeagile by jeeagile.
the class AgileSysRoleServiceImpl method saveRoleDept.
/**
* 保存角色部门数据
*
* @param agileSysRole
* @return
*/
private boolean saveRoleDept(AgileSysRole agileSysRole) {
if (AgileCollectionUtil.isNotEmpty(agileSysRole.getDeptIdList())) {
List<AgileSysRoleDept> agileSysRoleDeptList = new ArrayList<>();
for (String deptId : agileSysRole.getDeptIdList()) {
AgileSysRoleDept agileSysRoleDept = new AgileSysRoleDept();
agileSysRoleDept.setRoleId(agileSysRole.getId());
agileSysRoleDept.setDeptId(deptId);
agileSysRoleDeptList.add(agileSysRoleDept);
}
return agileSysRoleDeptService.saveBatch(agileSysRoleDeptList);
} else {
return true;
}
}
Aggregations