| | |
| | | } |
| | | |
| | | /** |
| | | * 保存用户角色关联关系 |
| | | * 成员管理分配角色调用,保存用户角色关联关系 |
| | | * @param userOids |
| | | * @param roleIds |
| | | * @return |
| | |
| | | public boolean saveRights(String[] userOids, String[] roleIds) throws PLException { |
| | | VciBaseUtil.alertNotNull(userOids,"用户主键"); |
| | | //roleIds允许为空,为空时清空当前用户的权限 |
| | | return platformClientUtil.getFrameworkService().saveRights(roleIds,userOids,new UserEntityInfo()); |
| | | UserEntityInfo userEntityInfo = new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(),null); |
| | | return platformClientUtil.getFrameworkService().saveRights(roleIds,userOids,userEntityInfo); |
| | | } |
| | | |
| | | /** |
| | | * 角色管理分配成员接口调用 |
| | | * @param userOids |
| | | * @param roleId |
| | | * @return |
| | | * @throws PLException |
| | | */ |
| | | @Override |
| | | public boolean saveRight(String[] userOids, String roleId) throws PLException { |
| | | VciBaseUtil.alertNotNull(roleId,"角色主键"); |
| | | //roleIds允许为空,为空时清空当前用户的权限 |
| | | UserEntityInfo userEntityInfo = new UserEntityInfo(WebThreadLocalUtil.getCurrentUserSessionInfoInThread().getUserId(),null); |
| | | return platformClientUtil.getFrameworkService().saveRight(roleId,userOids,userEntityInfo); |
| | | } |
| | | |
| | | /** |
| | |
| | | VciBaseUtil.alertNotNull( |
| | | smRoleDTO,"添加的角色对象", |
| | | smRoleDTO.getName(),"角色名"); |
| | | //查询数据库中的,根据角色名查 |
| | | //根据角色主键查询,确保修改的角色存在 |
| | | Map<String, String> conditionMap = new HashMap<>(); |
| | | conditionMap.put("pluid",smRoleDTO.getOid()); |
| | | SmRoleVO dbSmRoleVO = getRoleByConditionMap(conditionMap); |
| | |
| | | if(Func.isEmpty(dbSmRoleVO) || Func.isBlank(dbSmRoleVO.getOid())){ |
| | | throw new PLException("500", new String[] { "当前修改的角色不存在!"}); |
| | | } |
| | | //角色名相等,但是主键不相等,说明修改为的角色名已存在,不能重复 |
| | | if(dbSmRoleVO.getName().equals(smRoleDTO.getName()) && !dbSmRoleVO.getOid().equals(smRoleDTO.getOid())){ |
| | | //查询数据库中的,根据角色名查重 |
| | | conditionMap.clear(); |
| | | conditionMap.put("plname",smRoleDTO.getName()); |
| | | //排除掉当前修改的用户 |
| | | conditionMap.put("pluid",QueryOptionConstant.NOTEQUAL + smRoleDTO.getName()); |
| | | SmRoleVO reapeatSmRoleVO = getRoleByConditionMap(conditionMap); |
| | | //说明修改为的角色名已存在,不能重复 |
| | | if(Func.isNotEmpty(reapeatSmRoleVO) && smRoleDTO.getName().equals(reapeatSmRoleVO)){ |
| | | throw new PLException("500", new String[] { "该角色名称已经存在,请修改!"}); |
| | | } |
| | | SmRoleDTO smRoleDTO1 = new SmRoleDTO(); |
| | |
| | | * @throws VciBaseException |
| | | */ |
| | | @Override |
| | | public BaseResult importRole(File file) throws VciBaseException { |
| | | public BaseResult importRole(File file) throws Exception { |
| | | VciBaseUtil.alertNotNull(file,"excel文件"); |
| | | if(!file.exists()){ |
| | | throw new VciBaseException("导入的excel文件不存在,{0}",new String[]{file.getPath()}); |