mirror of https://gitee.com/stylefeng/roses
【8.1.0】【role】更新角色字段更新策略
parent
dc3e904a71
commit
0a348fd804
|
@ -80,7 +80,7 @@ public class SysRole extends BaseExpandFieldEntity {
|
|||
/**
|
||||
* 角色所属公司id,当角色类型为20时传此值
|
||||
*/
|
||||
@TableField("role_company_id")
|
||||
@TableField(value = "role_company_id", updateStrategy = FieldStrategy.IGNORED, insertStrategy = FieldStrategy.IGNORED)
|
||||
@ChineseDescription("角色所属公司id,当角色类型为20时传此值")
|
||||
@SimpleFieldFormat(processClass = OrgNameFormatProcess.class)
|
||||
private Long roleCompanyId;
|
||||
|
|
|
@ -148,6 +148,12 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
|||
}
|
||||
|
||||
BeanUtil.copyProperties(sysRoleRequest, sysRole);
|
||||
|
||||
// 如果是编辑角色,改为了基础类型,则需要将公司id清空
|
||||
if (RoleTypeEnum.SYSTEM_ROLE.getCode().equals(sysRoleRequest.getRoleType())) {
|
||||
sysRole.setRoleCompanyId(null);
|
||||
}
|
||||
|
||||
this.updateById(sysRole);
|
||||
|
||||
BusinessLogUtil.addContent("修改后角色信息如下:\n", sysRole);
|
||||
|
|
Loading…
Reference in New Issue