【8.1.0】【role】更新角色字段更新策略

pull/60/head
fengshuonan 2024-01-17 11:06:53 +08:00
parent dc3e904a71
commit 0a348fd804
2 changed files with 7 additions and 1 deletions

View File

@ -80,7 +80,7 @@ public class SysRole extends BaseExpandFieldEntity {
/**
* id20
*/
@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;

View File

@ -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);