feat(syslog): 操作日志和登录日志记录操作人密级

sys_log 新增 user_security_level 列,取值与 sys_user.user_security_level 一致
(字典:3非密/4一般/5重要),LogDTO/SysLog 实体同步补充字段。
This commit is contained in:
wsm
2026-08-05 09:59:38 +08:00
parent e228152fad
commit 20b76afa02
7 changed files with 23 additions and 3 deletions
@@ -60,7 +60,12 @@ public class LogDTO implements Serializable {
* 客户终端类型 pc:电脑端 app:手机端 h5:移动网页端
*/
private String clientType;
/**
* 操作人密级(3非密,4一般,5重要)
*/
private Integer userSecurityLevel;
public LogDTO(){
}
@@ -107,6 +107,7 @@ public class AutoLogAspect {
if(sysUser!=null){
dto.setUserid(sysUser.getUsername());
dto.setUsername(sysUser.getRealname());
dto.setUserSecurityLevel(sysUser.getUserSecurityLevel());
}
//耗时
dto.setCostTime(time);
@@ -4,7 +4,7 @@
<!-- 保存日志11 -->
<insert id="saveLog" parameterType="Object">
insert into sys_log (id, log_type, log_content, method, operate_type, request_url, request_type, request_param, ip, userid, username, cost_time, create_time,create_by, tenant_id, client_type)
insert into sys_log (id, log_type, log_content, method, operate_type, request_url, request_type, request_param, ip, userid, username, cost_time, create_time,create_by, tenant_id, client_type, user_security_level)
values(
#{dto.id,jdbcType=VARCHAR},
#{dto.logType,jdbcType=INTEGER},
@@ -21,7 +21,8 @@
#{dto.createTime,jdbcType=TIMESTAMP},
#{dto.createBy,jdbcType=VARCHAR},
#{dto.tenantId,jdbcType=INTEGER},
#{dto.clientType,jdbcType=VARCHAR}
#{dto.clientType,jdbcType=VARCHAR},
#{dto.userSecurityLevel,jdbcType=INTEGER}
)
</insert>
@@ -82,6 +82,7 @@ public class BaseCommonServiceImpl implements BaseCommonService {
if(user!=null){
sysLog.setUserid(user.getUsername());
sysLog.setUsername(user.getRealname());
sysLog.setUserSecurityLevel(user.getUserSecurityLevel());
}
sysLog.setCreateTime(new Date());
//保存日志(异常捕获处理,防止数据太大存储失败,导致业务失败)JT-238