From f69ad1b4e33fa9675865b685065f6d1a7ca62944 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Mon, 1 Sep 2025 16:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A8=BD=E6=9F=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ReadingImageTaskService.cs | 12 ++++ .../Common/AuditingData.cs | 60 ++++++++++++++++--- 2 files changed, 63 insertions(+), 9 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 0f4927f11..b538e50cd 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1613,6 +1613,17 @@ namespace IRaCIS.Core.Application.Service x.Answer = needSetNa.Contains(x.QuestionMark) ? "NA" : x.Answer; }); break; + + case CriterionType.mRECISTHCC: + needSaveMark = new List() + { + QuestionMark.Organ, + QuestionMark.Location, + QuestionMark.Part, + QuestionMark.IsLymph, + QuestionMark.TypicalIntrahepaticLesion, + }; + break; } await _readingTableAnswerRowInfoRepository.AddAsync(rowAnswer); await _readingTableQuestionAnswerRepository.AddRangeAsync(_mapper.Map>(tableAnswers)); @@ -2999,6 +3010,7 @@ namespace IRaCIS.Core.Application.Service await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == task.VisitTaskId && x.TaskState == TaskState.Effect && x.ReadingTaskState != ReadingTaskState.HaveSigned, x => new VisitTask() { + FirstReadingTime = DateTime.Now, }); await _visitTaskRepository.SaveChangesAsync(); diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 87fd79d6e..9f0252cb4 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -6,6 +6,7 @@ using MassTransit; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; using Newtonsoft.Json; +using static MassTransit.ValidationResultExtensions; namespace IRaCIS.Core.Infra.EFCore.Common @@ -61,6 +62,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common { return new List() { + typeof(TrialIdentityUser), typeof(TrialUserRole), typeof(TrialSiteSurvey), typeof(TrialSiteUser), @@ -1623,12 +1625,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common var type = GetEntityAuditOpt(item); var entity = item.Entity as TrialUserRole; + string extraIndentification = string.Empty; + if (type == AuditOpt.Update) + { + extraIndentification = "/" + entity.IsDeleted.ToString(); + } + //var user = await _dbContext.Users.Include(x => x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId); await InsertInspection(entity, type, x => new InspectionConvertDTO { IsDistinctionInterface = type == AuditOpt.Update ? true : false, TrialId = x.TrialId, ObjectRelationParentId = x.TrialId, + ExtraIndentification = extraIndentification, ObjectRelationParentId2 = x.UserId, }); } @@ -1715,6 +1724,32 @@ namespace IRaCIS.Core.Infra.EFCore.Common //}); #endregion + } + + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SCPStudySubjectVisit))) + { + + var type = GetEntityAuditOpt(item); + + var entity = item.Entity as SCPStudySubjectVisit; + + var sCPStudy=await _dbContext.SCPStudy.Where(x => x.Id == entity.SCPStudyId).FirstOrDefaultAsync(); + + await InsertInspection(item.Entity as SCPStudySubjectVisit, type, x => new InspectionConvertDTO() + { + ObjectRelationParentId = x.SubjectId, + ObjectRelationParentId2=x.SubjectVisitId, + ObjectRelationParentId3 = x.StudyId, + + + }, new + { + StudyTime = sCPStudy!=null? sCPStudy.StudyTime:null, + + }); + + + } // 访视 @@ -2953,7 +2988,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common u.ShowOrder } ).OrderBy(t => t.ShowOrder).ToList() - }); + }, _userInfo.AuditIdentification); ////添加/修改病灶接口 只会对单个病灶进行操作 @@ -3394,7 +3429,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// 表达式 /// 其他对象 /// - public async Task InsertInspection(T entityObj, string type, Expression> expression = null, object otherItem = null) where T : Entity + public async Task InsertInspection(T entityObj, string type, Expression> expression = null, object otherItem = null, string auditIdentification = "") where T : Entity { InspectionConvertDTO inspection = new InspectionConvertDTO(); @@ -3411,7 +3446,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id; inspection.GeneralId = generalId; - inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine) + inspection.ExtraIndentification; + inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine, auditIdentification) + inspection.ExtraIndentification; //将实体对象属性 映射到稽查实体 MapEntityPropertyToAuditEntity(entityObj, inspection); @@ -3617,11 +3652,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// 获取稽查记录的标识符 部分业务会进行特殊处理 /// /// - public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false) + public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false, string auditIdentification = "") { var entityTypeName = entityObj.GetType().Name; - + var result = string.Empty; //默认规则 if (IsDistinctionInterface) @@ -3629,11 +3664,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common //自定义 标识后面 补充由代码上层的 extraIdentification 附加 if (isSelfDefine) { - return $"{_userInfo.RequestUrl}/{entityTypeName}"; + result= $"{_userInfo.RequestUrl}/{entityTypeName}"; } else { - return $"{_userInfo.RequestUrl}/{entityTypeName}/{type}"; + result = $"{_userInfo.RequestUrl}/{entityTypeName}/{type}"; } @@ -3643,15 +3678,22 @@ namespace IRaCIS.Core.Infra.EFCore.Common //自定义 标识后面 补充由代码上层的 extraIdentification 附加 if (isSelfDefine) { - return $"{entityTypeName}"; + result = $"{entityTypeName}"; } else { - return $"{entityTypeName}/{type}"; + result = $"{entityTypeName}/{type}"; } } + if (auditIdentification.IsNotNullOrEmpty()) + { + result = result + "/" + auditIdentification; + } + + return result; + }