From c2c8f65aaac0429e3286e6877bacb0023873d10e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 14 Feb 2025 14:07:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A8=E6=8E=A7=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E7=AD=94=E6=A1=88=E6=8E=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/MailService.cs | 23 ++++++++++++++++--- .../Service/QC/QCListService.cs | 6 ++--- 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index cf68a4a40..c195e4511 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -485,7 +485,13 @@ namespace IRaCIS.Core.Application.Service await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, null); - await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = userId, OptType = UserOptType.UpdateUserRole }, true); + //创建账号 和创建角色 一条,更新的时候才记录更新角色 + if (!sysUserInfo.IsFirstAdd) + { + await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = userId, OptType = UserOptType.UpdateUserRole }, true); + + } + } @@ -547,7 +553,12 @@ namespace IRaCIS.Core.Application.Service await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig); - await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = userId, OptType = UserOptType.UpdateUserRole }, true); + //创建账号 和创建角色 一条,更新的时候才记录更新角色 + if (!sysUserInfo.IsFirstAdd) + { + await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = userId, OptType = UserOptType.UpdateUserRole }, true); + + } } @@ -673,7 +684,13 @@ namespace IRaCIS.Core.Application.Service await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, null); - await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = sysUserInfo.Id, OptType = UserOptType.UpdateUserRole }, true); + //创建账号 和创建角色 一条,更新的时候才记录更新角色 + if (!sysUserInfo.IsFirstAdd) + { + await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = sysUserInfo.Id, OptType = UserOptType.UpdateUserRole }, true); + + } + return (sysUserInfo.Id, sysUserInfo.UserRoleList.First(t => t.UserTypeEnum == UserTypeEnum.IndependentReviewer).Id); diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index 2a79d09b8..680c8947a 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -402,9 +402,9 @@ namespace IRaCIS.Core.Application.Image.QA ParentTriggerValue = data.ParentTriggerValue, Type = data.Type, TypeValue = data.TypeValue - }).ToListAsync(); + }).OrderBy(t => t.ShowOrder).ToListAsync(); - var result = questionAnswerlist.Where(x => x.ParentId == null).ToList(); + var result = questionAnswerlist.Where(x => x.ParentId == null).OrderBy(t=>t.ShowOrder).ToList(); result.ForEach(x => { GetQuestionChild(x, questionAnswerlist); @@ -416,7 +416,7 @@ namespace IRaCIS.Core.Application.Image.QA private void GetQuestionChild(QCQuestionAnswer parent, List dataList) { - parent.Childrens = dataList.Where(x => x.ParentId == parent.Id).ToList(); + parent.Childrens = dataList.Where(x => x.ParentId == parent.Id).OrderBy(t => t.ShowOrder).ToList(); if (parent.Childrens.Count != 0) {