修改日志,和稽查查询

This commit is contained in:
2025-02-14 16:00:46 +08:00
parent c2c8f65aaa
commit bb493fe827
2 changed files with 30 additions and 21 deletions
@@ -23,31 +23,40 @@ namespace IRaCIS.Core.Application.Triggers.AfterSaveTrigger
if (userlog.TargetIdentityUserId != null)
{
var obj = await _identityUserRepository.Where(t => t.Id == userlog.TargetIdentityUserId).Select(t => new UserLogJsonObj()
//判断是否需要记录详情
if (userlog.OptType == UserOptType.AddUser || userlog.OptType == UserOptType.UpdateUser || userlog.OptType == UserOptType.UpdateUserRole
|| userlog.OptType == UserOptType.AccountEnable || userlog.OptType == UserOptType.AccountLocked)
{
DepartmentName = t.DepartmentName,
EMail = t.EMail,
FirstName = t.FirstName,
LastName = t.LastName,
OrganizationName = t.OrganizationName,
Phone = t.Phone,
PositionName = t.PositionName,
Sex = t.Sex,
Status = t.Status,
UserCode = t.UserCode,
UserName = t.UserName,
UserRoleList = t.UserRoleList.Select(t => new UserRoleLogObj()
var obj = await _identityUserRepository.Where(t => t.Id == userlog.TargetIdentityUserId).Select(t => new UserLogJsonObj()
{
IsUserRoleDisabled = t.IsUserRoleDisabled,
UserTypeEnum = t.UserTypeEnum,
UserTypeShortName = t.UserTypeRole.UserTypeShortName
}).ToList()
DepartmentName = t.DepartmentName,
EMail = t.EMail,
FirstName = t.FirstName,
LastName = t.LastName,
OrganizationName = t.OrganizationName,
Phone = t.Phone,
PositionName = t.PositionName,
Sex = t.Sex,
Status = t.Status,
UserCode = t.UserCode,
UserName = t.UserName,
UserRoleList = t.UserRoleList.Select(t => new UserRoleLogObj()
{
IsUserRoleDisabled = t.IsUserRoleDisabled,
UserTypeEnum = t.UserTypeEnum,
UserTypeShortName = t.UserTypeRole.UserTypeShortName
}).ToList()
}).FirstOrDefaultAsync();
}).FirstOrDefaultAsync();
userlog.JsonObj = obj.ToJsonStr();
userlog.JsonObj = obj.ToJsonStr();
}
}