From b6cf98805832a78b2cd2690a846f52453aac8360 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 14:00:34 +0800 Subject: [PATCH 01/12] =?UTF-8?q?=E5=AF=BC=E8=A1=A8=20=E8=A3=81=E5=88=A4?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=8E=9F=E5=9B=A0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/_MapConfig.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 79c827518..d7b29f3e1 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -257,7 +257,7 @@ namespace IRaCIS.Core.Application.Service (arbitrationRule == ArbitrationRule.Reading ? u.Subject.SubjectVisitTaskList.Any(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Judge && t.TrialReadingCriterionId == trialReadingCriterionId && u.VisitTaskNum < t.VisitTaskNum) : false))) - .ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.ReadingCategory == ReadingCategory.Judge ? u.JudgeResultRemark : u.JudgeVisitTask.JudgeResultRemark)) + .ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.ReadingCategory == ReadingCategory.Judge ? u.JudgeResultRemark : "")) .ForMember(o => o.VisitNote, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).FirstOrDefault()!.Answer)) //.ForMember(o => o.IsSubjectHaveReadingPeriod, t => t.MapFrom(u => arbitrationRule == ArbitrationRule.Reading ? //u.Subject.ReadModuleList.Any(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.ReadingSetType == ReadingSetType.ImageReading) : false)) From 2a170cc97ec7445c85992577ab2e2fe40c0f1a8f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 15:52:44 +0800 Subject: [PATCH 02/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E4=B8=8D=E9=98=85=E7=89=87=E5=BD=B1=E5=83=8F=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 47200e84a..d01799838 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -261,6 +261,8 @@ namespace IRaCIS.Core.Application.Services IsReading=k.IsReading, IsDeleted=k.IsDeleted, }).ToList(); + + series.InstanceCount=series.InstanceInfoList.Count; } ); From ae14a8a530540e6b53e90229633116e4c55b10d3 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 15:52:44 +0800 Subject: [PATCH 03/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E4=B8=8D=E9=98=85=E7=89=87=E5=BD=B1=E5=83=8F=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 1f2645602..c5b9898bc 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -261,6 +261,8 @@ namespace IRaCIS.Core.Application.Services IsReading=k.IsReading, IsDeleted=k.IsDeleted, }).ToList(); + + series.InstanceCount=series.InstanceInfoList.Count; } ); From 8bdd9e29abf2de5841bd46bfd939e5384b604d1d Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 16:13:52 +0800 Subject: [PATCH 04/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=98=85=E7=89=87?= =?UTF-8?q?=E7=9C=8B=E5=88=B0=E5=BE=97instance=20=E5=BA=8F=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Visit/SubjectVisitService.cs | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index c5b9898bc..907bb76f8 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -31,7 +31,7 @@ namespace IRaCIS.Core.Application.Services [HttpPost] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] [UnitOfWork] //[Authorize(Policy = IRaCISPolicy.CRC)] public async Task> AddOrUpdateSV(SubjectVisitCommand svCommand) @@ -161,7 +161,7 @@ namespace IRaCIS.Core.Application.Services [HttpPut("{trialId:guid}/{subjectVisitId:guid}/{isUrgent:bool}")] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] //[Authorize(Policy = IRaCISPolicy.PM_IQC)] public async Task SetSubjectVisitUrgent(Guid subjectVisitId, bool isUrgent) { @@ -173,7 +173,7 @@ namespace IRaCIS.Core.Application.Services [HttpDelete, Route("{trialId:guid}/{id:guid}")] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] //[Authorize(Policy = IRaCISPolicy.CRC)] public async Task DeleteSV(Guid id) { @@ -238,7 +238,7 @@ namespace IRaCIS.Core.Application.Services var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)) .WhereIf(isReading == 1, s => s.IsReading) - .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath,t.IsDeleted,t.IsReading }).ToListAsync(); + .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsDeleted, t.IsReading }).ToListAsync(); foreach (var t in studyList) { @@ -258,11 +258,11 @@ namespace IRaCIS.Core.Application.Services HtmlPath = k.HtmlPath, Path = k.Path, InstanceNumber = k.InstanceNumber, - IsReading=k.IsReading, - IsDeleted=k.IsDeleted, + IsReading = k.IsReading, + IsDeleted = k.IsDeleted, }).ToList(); - series.InstanceCount=series.InstanceInfoList.Count; + series.InstanceCount = series.InstanceInfoList.Count; } ); @@ -503,7 +503,7 @@ namespace IRaCIS.Core.Application.Services var studyIds = dicomStudyList.Select(t => t.StudyId).ToList(); var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId) && t.IsReading) - .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath,t.IsReading }).ToListAsync(); + .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.IsReading }).ToListAsync(); List seriesLists = await _dicomSeriesRepository.Where(s => studyIds.Contains(s.StudyId)) .WhereIf(isManualGenerate == false, t => t.IsReading) @@ -527,6 +527,9 @@ namespace IRaCIS.Core.Application.Services }).ToList(); + // 设置阅片 不阅片,数字要要重新统计 + series.InstanceCount = series.InstanceInfoList.Count; + //series.WindowWidth = instanceList.FirstOrDefault()!.WindowWidth; //series.WindowCenter = instanceList.FirstOrDefault()!.WindowCenter; }); @@ -612,7 +615,7 @@ namespace IRaCIS.Core.Application.Services item.InstanceInfoList.ForEach(x => { - var keyFramesList = rowInfoList.Where(y => y.InstanceId == x.Id && y.NumberOfFrames != 0&&y.NumberOfFrames!=null).Select(y => y.NumberOfFrames).Distinct().ToList(); + var keyFramesList = rowInfoList.Where(y => y.InstanceId == x.Id && y.NumberOfFrames != 0 && y.NumberOfFrames != null).Select(y => y.NumberOfFrames).Distinct().ToList(); if (keyFramesList.Count() > 0) { @@ -726,9 +729,18 @@ namespace IRaCIS.Core.Application.Services #endregion + #region 过滤空序列得检查 过滤空instance得序列 + + foreach (var study in studyList) + { + study.SeriesList = study.SeriesList.Where(t => t.InstanceCount > 0).ToList(); + } var result = studyList.Where(x => x.SeriesCount > 0).ToList(); + #endregion + + return result; @@ -743,7 +755,7 @@ namespace IRaCIS.Core.Application.Services /// /// [HttpPut("{trialId:guid}/{subjectVisitId:guid}")] - [TrialGlobalLimit( "AfterStopCannNotOpt" )] + [TrialGlobalLimit("AfterStopCannNotOpt")] [Obsolete] public async Task SetSVExecuted(Guid subjectVisitId) { From 0578263e10d24844838adc0686de47dcd1f99d50 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 16:40:34 +0800 Subject: [PATCH 05/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A8=E6=8E=A7?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=BD=B1=E5=83=8F=20uat=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/InstanceService.cs | 2 +- .../Service/ImageAndDoc/SeriesService.cs | 4 ++-- .../Service/Visit/SubjectVisitService.cs | 8 +++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs index b9ab6ef92..179997232 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs @@ -19,7 +19,7 @@ namespace IRaCIS.Core.Application.Services [HttpGet("{seriesId:guid}")] public async Task>> List(Guid seriesId) { - var list = await _instanceRepository.Where(s => s.SeriesId == seriesId)/*.OrderBy(s => s.SliceLocation)*/.OrderBy(s => s.InstanceNumber). + var list = await _instanceRepository.Where(s => s.SeriesId == seriesId).IgnoreQueryFilters().OrderBy(s => s.InstanceNumber). ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index 7931a1d82..5a2b7343b 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -23,11 +23,11 @@ namespace IRaCIS.Core.Application.Services public async Task>> List(Guid studyId) { //断点 - var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).OrderBy(s => s.SeriesNumber). + var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters().OrderBy(s => s.SeriesNumber). ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) + var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters().OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) .ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath ,t.IsReading,t.IsDeleted}).ToListAsync();//.GroupBy(u => u.SeriesId); diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 521715495..9633222b5 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -236,13 +236,13 @@ namespace IRaCIS.Core.Application.Services }).ToListAsync(); var studyIds = studyList.Select(t => t.StudyId).ToList(); - var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)) + var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)).IgnoreQueryFilters() .WhereIf(isReading == 1, s => s.IsReading) - .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath,t.IsReading,t.IsDeleted }).ToListAsync(); + .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync(); foreach (var t in studyList) { - t.SeriesList = await _dicomSeriesRepository.Where(s => s.StudyId == t.StudyId) + t.SeriesList = await _dicomSeriesRepository.Where(s => s.StudyId == t.StudyId).IgnoreQueryFilters() .WhereIf(isReading == 1, s => s.IsReading).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); @@ -261,6 +261,8 @@ namespace IRaCIS.Core.Application.Services IsReading = k.IsReading, IsDeleted = k.IsDeleted, }).ToList(); + + series.InstanceCount = series.InstanceInfoList.Count(); } ); From 5fe972bd99d6bc5c1f9ba0fd6c53b5152c445c54 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 16:40:34 +0800 Subject: [PATCH 06/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A8=E6=8E=A7?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=BD=B1=E5=83=8F=20uat=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/InstanceService.cs | 2 +- .../Service/ImageAndDoc/SeriesService.cs | 4 ++-- .../Service/Visit/SubjectVisitService.cs | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs index b9ab6ef92..179997232 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs @@ -19,7 +19,7 @@ namespace IRaCIS.Core.Application.Services [HttpGet("{seriesId:guid}")] public async Task>> List(Guid seriesId) { - var list = await _instanceRepository.Where(s => s.SeriesId == seriesId)/*.OrderBy(s => s.SliceLocation)*/.OrderBy(s => s.InstanceNumber). + var list = await _instanceRepository.Where(s => s.SeriesId == seriesId).IgnoreQueryFilters().OrderBy(s => s.InstanceNumber). ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index 7931a1d82..5a2b7343b 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -23,11 +23,11 @@ namespace IRaCIS.Core.Application.Services public async Task>> List(Guid studyId) { //断点 - var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).OrderBy(s => s.SeriesNumber). + var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters().OrderBy(s => s.SeriesNumber). ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) + var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters().OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) .ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath ,t.IsReading,t.IsDeleted}).ToListAsync();//.GroupBy(u => u.SeriesId); diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 907bb76f8..9633222b5 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -236,13 +236,13 @@ namespace IRaCIS.Core.Application.Services }).ToListAsync(); var studyIds = studyList.Select(t => t.StudyId).ToList(); - var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)) + var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)).IgnoreQueryFilters() .WhereIf(isReading == 1, s => s.IsReading) - .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsDeleted, t.IsReading }).ToListAsync(); + .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync(); foreach (var t in studyList) { - t.SeriesList = await _dicomSeriesRepository.Where(s => s.StudyId == t.StudyId) + t.SeriesList = await _dicomSeriesRepository.Where(s => s.StudyId == t.StudyId).IgnoreQueryFilters() .WhereIf(isReading == 1, s => s.IsReading).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); @@ -262,7 +262,7 @@ namespace IRaCIS.Core.Application.Services IsDeleted = k.IsDeleted, }).ToList(); - series.InstanceCount = series.InstanceInfoList.Count; + series.InstanceCount = series.InstanceInfoList.Count(); } ); From 55f146a44a8df6ebe5142e47481fdb5c8a04e16e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 16:52:13 +0800 Subject: [PATCH 07/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E4=B8=8A=E7=9A=84Instance=20=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/SeriesService.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index 5a2b7343b..5323fab52 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -9,7 +9,7 @@ namespace IRaCIS.Core.Application.Services [ApiExplorerSettings(GroupName = "Image")] [AllowAnonymous] public class SeriesService(IRepository _seriesRepository, - IRepository _instanceRepository, + IRepository _instanceRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService { @@ -22,14 +22,14 @@ namespace IRaCIS.Core.Application.Services [HttpGet, Route("{studyId:guid}")] public async Task>> List(Guid studyId) { - //断点 + //断点 var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters().OrderBy(s => s.SeriesNumber). ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters().OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) .ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) - .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath ,t.IsReading,t.IsDeleted}).ToListAsync();//.GroupBy(u => u.SeriesId); + .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync();//.GroupBy(u => u.SeriesId); foreach (var series in seriesList) { @@ -42,10 +42,12 @@ namespace IRaCIS.Core.Application.Services HtmlPath = k.HtmlPath, Path = k.Path, InstanceNumber = k.InstanceNumber, - IsReading=k.IsReading, - IsDeleted=k.IsDeleted + IsReading = k.IsReading, + IsDeleted = k.IsDeleted }).ToList(); + + series.InstanceCount = series.InstanceInfoList.Count; } #region 暂时废弃 From f1c84158999415d2b4a46c874792dd612c08a750 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 17:11:21 +0800 Subject: [PATCH 08/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=98=85=E7=89=87?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E5=BD=B1=E5=83=8F=EF=BC=88=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E6=A0=87=E8=AE=B0=E4=BA=86=E5=88=A0=E9=99=A4=20=E5=92=8C?= =?UTF-8?q?=E9=98=85=E7=89=87=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 9633222b5..932e3639c 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -237,13 +237,13 @@ namespace IRaCIS.Core.Application.Services var studyIds = studyList.Select(t => t.StudyId).ToList(); var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)).IgnoreQueryFilters() - .WhereIf(isReading == 1, s => s.IsReading) + .WhereIf(isReading == 1, s => s.IsReading && s.IsDeleted == false) .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync(); foreach (var t in studyList) { t.SeriesList = await _dicomSeriesRepository.Where(s => s.StudyId == t.StudyId).IgnoreQueryFilters() - .WhereIf(isReading == 1, s => s.IsReading).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime) + .WhereIf(isReading == 1, s => s.IsReading && s.IsDeleted == false).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); From 44f74fd9e6ad36f8d8210ddd2e9f59e93b3f5d62 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 13 Feb 2025 18:01:17 +0800 Subject: [PATCH 09/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E6=A0=B9=E6=8D=AE=E8=B4=A8=E6=8E=A7=E7=8A=B6=E6=80=81=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/SeriesService.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index 5323fab52..9d3e264b3 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -22,13 +22,20 @@ namespace IRaCIS.Core.Application.Services [HttpGet, Route("{studyId:guid}")] public async Task>> List(Guid studyId) { + //质控的时候,要标记序列,和instance 删除 ,所以要返回全部,但是 质控通过后,pm 进去看的时候要看过滤后的 + + var isInQC = await _seriesRepository.Where(s => s.StudyId == studyId).AnyAsync(t => t.DicomStudy.SubjectVisit.AuditState > AuditStateEnum.ToAudit); + //断点 - var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters().OrderBy(s => s.SeriesNumber). - ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime) + var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters() + .WhereIf(isInQC, t => t.IsDeleted == false) + .OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters().OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) - .ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) + var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters() + .WhereIf(isInQC, t => t.IsDeleted == false) + .OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) + .ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync();//.GroupBy(u => u.SeriesId); foreach (var series in seriesList) From 1e9f4d890f1245ccd165defceffb41ddb831f6a5 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 14 Feb 2025 10:54:00 +0800 Subject: [PATCH 10/12] =?UTF-8?q?=E8=B4=A8=E6=8E=A7=E9=A2=84=E8=A7=88?= =?UTF-8?q?=E5=86=8D=E6=AC=A1=E4=BF=AE=E6=94=B90214?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/InstanceService.cs | 10 ++++++++-- .../Service/ImageAndDoc/SeriesService.cs | 10 +++++++--- .../Service/Visit/SubjectVisitService.cs | 12 +++++++++++- IRaCIS.Core.Domain.Share/QC/AuditStateEnum.cs | 2 +- 4 files changed, 27 insertions(+), 7 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs index 179997232..cc67adb4d 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs @@ -19,8 +19,14 @@ namespace IRaCIS.Core.Application.Services [HttpGet("{seriesId:guid}")] public async Task>> List(Guid seriesId) { - var list = await _instanceRepository.Where(s => s.SeriesId == seriesId).IgnoreQueryFilters().OrderBy(s => s.InstanceNumber). - ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) + var qcAuditState = await _instanceRepository.Where(s => s.SeriesId == seriesId).Select(t => t.DicomStudy.SubjectVisit.AuditState).FirstOrDefaultAsync(); + + //质控通过以后,过滤删除的 质控之前的不过滤 + var isQCFinished = qcAuditState == AuditStateEnum.QCPassed; + + var list = await _instanceRepository.Where(s => s.SeriesId == seriesId).IgnoreQueryFilters() + .WhereIf(isQCFinished, t => t.IsDeleted == false) + .OrderBy(s => s.InstanceNumber).ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); var seriesInfo = await _instanceRepository.Where(s => s.SeriesId == seriesId).Select(t => new { t.DicomSerie.ImageResizePath,t.DicomSerie.IsDeleted,t.DicomSerie.IsReading }).FirstOrDefaultAsync(); diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index 9d3e264b3..d27075cd0 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -24,20 +24,24 @@ namespace IRaCIS.Core.Application.Services { //质控的时候,要标记序列,和instance 删除 ,所以要返回全部,但是 质控通过后,pm 进去看的时候要看过滤后的 - var isInQC = await _seriesRepository.Where(s => s.StudyId == studyId).AnyAsync(t => t.DicomStudy.SubjectVisit.AuditState > AuditStateEnum.ToAudit); + var qcAuditState = await _seriesRepository.Where(s => s.StudyId == studyId).Select(t => t.DicomStudy.SubjectVisit.AuditState).FirstOrDefaultAsync(); + + //质控通过以后,预览过滤删除的 质控之前的不过滤 + var isQCFinished = qcAuditState == AuditStateEnum.QCPassed; //断点 var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters() - .WhereIf(isInQC, t => t.IsDeleted == false) + .WhereIf(isQCFinished, t => t.IsDeleted == false) .OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters() - .WhereIf(isInQC, t => t.IsDeleted == false) + .WhereIf(isQCFinished, t => t.IsDeleted == false) .OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) .ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync();//.GroupBy(u => u.SeriesId); + foreach (var series in seriesList) { diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index 932e3639c..0ca732f8f 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -212,6 +212,13 @@ namespace IRaCIS.Core.Application.Services [AllowAnonymous] public async Task> GetVisitStudyList(Guid trialId, Guid sujectVisitId, int isReading, [FromQuery] Guid? visitTaskId) { + + var qcAuditState = await _subjectVisitRepository.Where(s => s.Id == sujectVisitId).Select(t => t.AuditState).FirstOrDefaultAsync(); + + //质控通过以后,过滤删除的 质控之前的不过滤 + var isQCFinished = qcAuditState == AuditStateEnum.QCPassed; + + var isImageFilter = false; var criterionModalitys = ""; if (visitTaskId != null) @@ -238,12 +245,15 @@ namespace IRaCIS.Core.Application.Services var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)).IgnoreQueryFilters() .WhereIf(isReading == 1, s => s.IsReading && s.IsDeleted == false) + .WhereIf(isQCFinished, t => t.IsDeleted == false) .Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync(); foreach (var t in studyList) { t.SeriesList = await _dicomSeriesRepository.Where(s => s.StudyId == t.StudyId).IgnoreQueryFilters() - .WhereIf(isReading == 1, s => s.IsReading && s.IsDeleted == false).OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime) + .WhereIf(isReading == 1, s => s.IsReading && s.IsDeleted == false) + .WhereIf(isQCFinished, t => t.IsDeleted == false) + .OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); diff --git a/IRaCIS.Core.Domain.Share/QC/AuditStateEnum.cs b/IRaCIS.Core.Domain.Share/QC/AuditStateEnum.cs index 35f4dc763..df265f46d 100644 --- a/IRaCIS.Core.Domain.Share/QC/AuditStateEnum.cs +++ b/IRaCIS.Core.Domain.Share/QC/AuditStateEnum.cs @@ -23,7 +23,7 @@ namespace IRaCIS.Core.Domain.Share InSecondaryQC = 6, - //任何QC设置为QC Failed + //任何QC设置为QC Failed--去掉了 QCFailed = 7, //2nd QC设置为QC Passed From 45b469682a4da1982960468eac9246236b9bc060 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 14 Feb 2025 13:09:26 +0800 Subject: [PATCH 11/12] =?UTF-8?q?=E5=BD=B1=E5=83=8F=E8=B4=A8=E6=8E=A7?= =?UTF-8?q?=EF=BC=8C=E8=B4=A8=E6=8E=A7=E4=BA=BA=E7=9C=8B=E5=88=B0=E7=9A=84?= =?UTF-8?q?=E6=98=AF=E8=BF=87=E6=BB=A4=E4=BA=86=E5=88=A0=E9=99=A4=E7=9A=84?= =?UTF-8?q?=EF=BC=8C=E5=85=B6=E4=BB=96=E4=BA=BA=E7=9C=8B=E5=88=B0=E7=9A=84?= =?UTF-8?q?=E6=98=AF=E5=8E=9F=E5=A7=8B=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/_MapConfig.cs | 5 ++++- IRaCIS.Core.Application/Service/QC/QCListService.cs | 11 +++++++++-- IRaCIS.Core.Domain/Image/DicomStudy.cs | 3 +++ .../EntityConfigration/ImageConfigration.cs | 4 ++-- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs index 608dc6dd2..ab7aa15c1 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs @@ -63,12 +63,15 @@ namespace IRaCIS.Core.Application.Service // .ForMember(o => o.InstancePathList, t => t.MapFrom(u => u.DicomInstanceList.OrderBy(t=>t.InstanceNumber).Select(t => t.Path))) ; + var isNeedStat = false; CreateMap() .ForMember(o => o.IsCompleteClinicalData, t => t.MapFrom(u => !u.ReadingClinicalDataList.Any(x => x.ReadingClinicalDataPDFList.Count() == 0))) .ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime)) .ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUserRole.IdentityUser.FullName)) .ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id)) - .ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t => t.FailedFileCount > 0))) + .ForMember(o => o.SeriesCount, t => t.MapFrom(u => isNeedStat == false ? u.SeriesCount : u.SeriesList.Count())) + .ForMember(o => o.InstanceCount, t => t.MapFrom(u => isNeedStat == false ? u.InstanceCount : u.InstanceList.Count())) + .ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t => t.FailedFileCount > 0))) .ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct()))); diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index f5f99cd48..2a79d09b8 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -519,9 +519,16 @@ namespace IRaCIS.Core.Application.Image.QA [HttpGet("{subjectVisitId:guid}")] public async Task>> GetSubjectVisitUploadedStudyList(Guid subjectVisitId) { + var qcAuditState = await _subjectVisitRepository.Where(s => s.Id == subjectVisitId).Select(t => t.AuditState).FirstOrDefaultAsync(); + + //质控过程中,因为会修改统计数字,但是此时其他人看,应该看到完整的影像 + var isQCFinished = qcAuditState == AuditStateEnum.QCPassed; + + var isNeedStat = _userInfo.UserTypeEnumInt != (int)UserTypeEnum.IQC && !isQCFinished; var visit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).FirstNotNullAsync(); - var list = await _dicomStudyRepository.Where(s => s.SubjectVisitId == subjectVisitId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).OrderBy(t => t.StudyCode).ToListAsync(); + + var list = await _dicomStudyRepository.Where(s => s.SubjectVisitId == subjectVisitId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider,new { isNeedStat= isNeedStat }).OrderBy(t => t.StudyCode).ToListAsync(); var config = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => t.Trial).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); @@ -530,7 +537,7 @@ namespace IRaCIS.Core.Application.Image.QA config.IsPacsConnectConfiged = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).AnyAsync(t => t.Trial.IsPACSConnect && t.Subject.TrialSite.TrialSiteDicomAEList.Any()); - return ResponseOutput.Ok (list, config); + return ResponseOutput.Ok(list, config); } diff --git a/IRaCIS.Core.Domain/Image/DicomStudy.cs b/IRaCIS.Core.Domain/Image/DicomStudy.cs index 1ca22dc30..ee9228614 100644 --- a/IRaCIS.Core.Domain/Image/DicomStudy.cs +++ b/IRaCIS.Core.Domain/Image/DicomStudy.cs @@ -10,6 +10,9 @@ public class DicomStudy : BaseFullDeleteAuditEntity, IEntitySeqId [JsonIgnore] public List SeriesList { get; set; } + [JsonIgnore] + public List InstanceList { get; set; } + [JsonIgnore] [ForeignKey("SubjectId")] public Subject Subject { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs b/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs index 2b2d4d63c..f2e4ef204 100644 --- a/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs +++ b/IRaCIS.Core.Infra.EFCore/EntityConfigration/ImageConfigration.cs @@ -13,7 +13,7 @@ public class DicomStudyConfigration : IEntityTypeConfiguration { builder.HasKey(e => e.SeqId); - //builder.HasMany(s => s.InstanceList).WithOne(se => se.DicomStudy).HasForeignKey(se => se.StudyId).HasPrincipalKey(st => st.Id); + builder.HasMany(s => s.InstanceList).WithOne(se => se.DicomStudy).HasForeignKey(se => se.StudyId).HasPrincipalKey(st => st.Id); builder.HasMany(s => s.SeriesList).WithOne(se => se.DicomStudy).HasForeignKey(se => se.StudyId).HasPrincipalKey(st => st.Id); @@ -42,7 +42,7 @@ public class DicomInstanceConfigration : IEntityTypeConfiguration { builder.HasKey(e => e.SeqId); - builder.HasOne(e => e.DicomStudy).WithMany().HasForeignKey(t=>t.StudyId).HasPrincipalKey(st => st.Id); + builder.HasOne(e => e.DicomStudy).WithMany(c=>c.InstanceList).HasForeignKey(t=>t.StudyId).HasPrincipalKey(st => st.Id); builder.HasMany(s => s.ReadingTableAnswerRowInfoList).WithOne(di => di.Instance).HasForeignKey(t => t.InstanceId).HasPrincipalKey(se => se.Id); 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 12/12] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B4=A8=E6=8E=A7?= =?UTF-8?q?=E9=97=AE=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) {