账户稽查修改
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-11-06 15:15:32 +08:00
parent b5e26da1ff
commit c48803ca0c
10 changed files with 18183 additions and 10 deletions
@@ -135,7 +135,7 @@ namespace IRaCIS.Application.Contracts
public string LastName { get; set; } = string.Empty;
public int? Sex { get; set; } // 1-男 2-女
public int Status { get; set; } = 1; // 0-已删除 1-正常
public UserStateEnum Status { get; set; } = UserStateEnum.Enable;
public string Phone { get; set; } = string.Empty;
public string EMail { get; set; } = string.Empty;
@@ -558,6 +558,13 @@ namespace IRaCIS.Core.Application.Service
if (user == null) return Null404NotFound(user);
if (user.Status!=model.Status)
{
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = model.Id, OptType = model.Status == UserStateEnum.Enable ? UserOptType.AccountEnable : UserOptType.AccountLocked }, true);
}
_mapper.Map(model, user);
if (user.IsZhiZhun)
@@ -565,7 +572,9 @@ namespace IRaCIS.Core.Application.Service
user.OrganizationName = _userInfo.IsEn_Us ? _systemEmailConfig.OrganizationName : _systemEmailConfig.OrganizationNameCN;
}
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = model.Id, OptType = UserOptType.UpdateUser }, true);
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, LoginUserId = _userInfo.Id, OptUserId = model.Id, OptType = UserOptType.UpdateUser });
var success = await _userRepository.SaveChangesAsync();
@@ -802,7 +811,7 @@ namespace IRaCIS.Core.Application.Service
DateTime? trialCreateTime = inQuery.TrialId != null ? _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.CreateTime).FirstOrDefault() : null;
var userLogQueryable =
_userLogRepository
_userLogRepository.AsQueryable().IgnoreQueryFilters()
.WhereIf(inQuery.TrialId != null, t => t.LoginUser.UserTrials.Any(c => c.TrialId == inQuery.TrialId && (c.UserId == t.LoginUserId || c.UserId == t.OptUserId)))
.WhereIf(trialCreateTime != null, t => t.CreateTime >= trialCreateTime)
.WhereIf(inQuery.OptType != null, t => t.OptType == inQuery.OptType)