Merge branch 'Test_HIR_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_HIR_Net8
continuous-integration/drone/push Build is passing Details

Test_HIR_Net8
he 2025-04-25 14:47:49 +08:00
commit 8a241754ca
2 changed files with 44 additions and 1 deletions

View File

@ -80,8 +80,13 @@ namespace IRaCIS.Core.API
triggerOptions.AddTrigger<UserLogTrigger>();
triggerOptions.AddTrigger<UserAddTrigger>();
triggerOptions.AddTrigger<UserModifyTrigger>();
});
});

View File

@ -58,6 +58,13 @@ namespace IRaCIS.Core.Application.Triggers
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { IsFirstAdd = true });
}
//只用初始化其中一个
if (beforeUser.IsFirstAdd == true && user.IsFirstAdd == false)
{
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { IsFirstAdd = false });
}
if (beforeUser.Password != user.Password)
{
@ -67,13 +74,44 @@ namespace IRaCIS.Core.Application.Triggers
if (beforeUser.EMail != user.EMail)
{
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { EMail = user.EMail });
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == beforeUser.EMail, u => new User() { EMail = user.EMail });
}
if (beforeUser.CheckCode != user.CheckCode)
{
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { CheckCode = user.CheckCode });
}
if (beforeUser.FirstName != user.FirstName || beforeUser.LastName != user.LastName)
{
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { FirstName = user.FirstName, LastName = user.LastName });
}
if (beforeUser.Phone != user.Phone)
{
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { Phone = user.Phone });
}
if (beforeUser.Sex != user.Sex)
{
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { Sex = user.Sex });
}
if (beforeUser.IsZhiZhun != user.IsZhiZhun)
{
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { IsZhiZhun = user.IsZhiZhun, OrganizationName = user.OrganizationName });
}
if (beforeUser.OrganizationName != user.OrganizationName)
{
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { OrganizationName = user.OrganizationName });
}
if (beforeUser.DepartmentName != user.DepartmentName || beforeUser.PositionName != user.PositionName)
{
await _userReposiotry.BatchUpdateNoTrackingAsync(t => t.EMail == user.EMail, u => new User() { DepartmentName = user.DepartmentName, PositionName = user.PositionName });
}
}
}