新增员工角色权限非空判断
This commit is contained in:
parent
3c1b2355db
commit
c939fbe59b
@ -1,6 +1,7 @@
|
|||||||
package cn.iocoder.yudao.module.staff.service.impl;
|
package cn.iocoder.yudao.module.staff.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.bean.BeanUtil;
|
import cn.hutool.core.bean.BeanUtil;
|
||||||
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import cn.iocoder.yudao.common.BaseConstants;
|
import cn.iocoder.yudao.common.BaseConstants;
|
||||||
import cn.iocoder.yudao.common.CommonErrorCodeConstants;
|
import cn.iocoder.yudao.common.CommonErrorCodeConstants;
|
||||||
@ -175,7 +176,10 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
|||||||
|
|
||||||
// 新增角色权限
|
// 新增角色权限
|
||||||
Set<Long> roleIds = staffRespVO.getRoleIds().stream().collect(Collectors.toSet());
|
Set<Long> roleIds = staffRespVO.getRoleIds().stream().collect(Collectors.toSet());
|
||||||
|
// 非空判断
|
||||||
|
if (CollectionUtil.isNotEmpty(roleIds)) {
|
||||||
permissionApi.assignUserRoleByRoleIds(userId, roleIds);
|
permissionApi.assignUserRoleByRoleIds(userId, roleIds);
|
||||||
|
}
|
||||||
|
|
||||||
/* 插入标签到业务标签表 */
|
/* 插入标签到业务标签表 */
|
||||||
if (ObjectUtil.isNotEmpty(staffRespVO.getLabelsArray())) {
|
if (ObjectUtil.isNotEmpty(staffRespVO.getLabelsArray())) {
|
||||||
@ -279,9 +283,10 @@ public class CompanyStaffServiceImpl extends ServiceImpl<CompanyStaffMapper, Com
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除员工信息通过用户id
|
* 删除员工信息通过用户id
|
||||||
|
*
|
||||||
|
* @param userId 用户ID
|
||||||
* @author zcy
|
* @author zcy
|
||||||
* @date 16:32 2024/8/6
|
* @date 16:32 2024/8/6
|
||||||
* @param userId 用户ID
|
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
@DSTransactional
|
@DSTransactional
|
||||||
|
Loading…
Reference in New Issue
Block a user