From bb493fe8278be3717930ee85320888253a68f955 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 14 Feb 2025 16:00:46 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97?= =?UTF-8?q?=EF=BC=8C=E5=92=8C=E7=A8=BD=E6=9F=A5=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Inspection/InspectionService.cs | 4 +- .../AfterSaveTrigger/UserLogAfterTrigger.cs | 47 +++++++++++-------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index 96b4c95f1..dc70cec5a 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -106,7 +106,7 @@ namespace IRaCIS.Core.Application.Service.Inspection //OptType = data.OptType, IP = data.IP, Reason = data.Reason, - IsSign = leftfrontAuditConfig.IsHaveSign && lefttrialSign.SignText!=null&& lefttrialSign.SignText!=string.Empty, + IsSign = leftfrontAuditConfig.IsHaveSign && lefttrialSign.SignText != null && lefttrialSign.SignText != string.Empty, SignId = data.SignId, ParentId = data.ParentId, ChildrenTypeId = data.ChildrenTypeId, @@ -190,7 +190,7 @@ namespace IRaCIS.Core.Application.Service.Inspection .WhereIf(!inQuery.TaskName.IsNullOrEmpty(), x => x.TaskName.Contains(inQuery.TaskName) || x.BlindName.Contains(inQuery.TaskName)) .WhereIf(!inQuery.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(inQuery.SubjectInfo)) - .WhereIf(!inQuery.RoleName.IsNullOrEmpty(), x => x.RoleName.Contains(inQuery.RoleName)) + .WhereIf(!inQuery.RoleName.IsNullOrEmpty(), x => x.RoleName == inQuery.RoleName) //.WhereIf(dto.VisitPlanInfo != null&& dto.VisitPlanInfo!=(decimal) 1.11, x => x.VisitNum == dto.VisitPlanInfo) //.WhereIf(dto.VisitPlanInfo != (decimal)1.11,x=>x.InPlan!=null&& x.InPlan==false) .WhereIf(inQuery.StartTime != null, x => x.CreateTime >= inQuery.StartTime) diff --git a/IRaCIS.Core.Application/Triggers/AfterSaveTrigger/UserLogAfterTrigger.cs b/IRaCIS.Core.Application/Triggers/AfterSaveTrigger/UserLogAfterTrigger.cs index 48c0017e0..fd7a64379 100644 --- a/IRaCIS.Core.Application/Triggers/AfterSaveTrigger/UserLogAfterTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/AfterSaveTrigger/UserLogAfterTrigger.cs @@ -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(); + } + + } From da27b65e56f0f145a976b72dddda1f1df6a8cef3 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 14 Feb 2025 16:11:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=20=E9=A1=B9=E7=9B=AE=E5=8F=82=E4=B8=8E?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/TrialSiteUser/DTO/UserTrialViewModel.cs | 9 +++++++++ .../Service/TrialSiteUser/TrialMaintenanceService.cs | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs index fcad91614..23fee79b0 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs @@ -94,6 +94,15 @@ namespace IRaCIS.Application.Contracts public Guid UserId { get; set; } } + public class TrialIdentityUserBasicInfo + { + public Guid IdentityUserId { get; set; } + + public string UserName { get; set; } + + public string FullName { get; set; } + } + public class TrialMaintenanceDTO : UserTrialCommand { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index 24db29490..f5b2befd9 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -21,10 +21,10 @@ namespace IRaCIS.Core.Application.Service { [HttpGet] - public async Task> GetTrialUserList(Guid trialId) + public async Task> GetTrialUserList(Guid trialId) { - return await _trialUseRoleRepository.Where(t => t.TrialId == trialId, ignoreQueryFilters: true) - .Select(t => new TrialUserBasicInfo() { FullName = t.UserRole.FullName, UserId = t.UserId, UserTypeId = t.UserRole.UserTypeId, UserName = t.UserRole.IdentityUser.UserName }) + return await _trialIdentityUserRepository.Where(t => t.TrialId == trialId, ignoreQueryFilters: true) + .Select(t => new TrialIdentityUserBasicInfo() { FullName = t.IdentityUser.FullName, IdentityUserId = t.IdentityUserId, UserName = t.IdentityUser.UserName }) .ToListAsync(); } From 580eea7a61871070011e4506a2bc1efeda2dc031 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 14 Feb 2025 16:15:21 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A8=BD=E6=9F=A5?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Inspection/DTO/InspectionModel.cs | 2 +- IRaCIS.Core.Application/Service/Inspection/InspectionService.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index 59ceefc6c..16c2630fa 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -472,7 +472,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO /// public string OpByUserName { get; set; } = string.Empty; - public string? CreateUserName { get; set; } + public string? CreateUserRealName { get; set; } /// /// 阅读片人 diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index dc70cec5a..2b9c79c7a 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -198,7 +198,7 @@ namespace IRaCIS.Core.Application.Service.Inspection .WhereIf(inQuery.ModuleType != null, x => x.ModuleTypeId == inQuery.ModuleType) .WhereIf(!inQuery.Description.IsNullOrEmpty(), x => x.Description.Contains(inQuery.Description) || x.DescriptionCN.Contains(inQuery.Description)) .WhereIf(!inQuery.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(inQuery.OpByUserName)) - .WhereIf(!inQuery.CreateUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(inQuery.CreateUserName) || x.CreateUserRealName.Contains(inQuery.CreateUserName)) + .WhereIf(!inQuery.CreateUserRealName.IsNullOrEmpty(), x => x.CreateUserName.Contains(inQuery.CreateUserRealName) || x.CreateUserRealName.Contains(inQuery.CreateUserRealName)) //.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo)) .WhereIf(inQuery.IsSign != null, x => x.IsSign == inQuery.IsSign);