From b94bc8eff1f3028082c5db187eaca9ae4232c9fb Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 9 Oct 2024 15:01:37 +0800 Subject: [PATCH 01/13] =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=AF=86=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Management/UserService.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index bc420be2c..a45af0b2d 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -98,13 +98,18 @@ namespace IRaCIS.Core.Application.Service } - if (oldPwd != null) + if (oldPwd == null) + { + oldPwd = await _userRepository.Where(x => x.Id == userId).Select(x => x.Password).FirstOrDefaultAsync(); + } + + if (!oldPwd.IsNotNullOrEmpty()) { await _userPassWordLogRepository.AddAsync(new UserPassWordLog() { CreateTime = DateTime.Now, - PassWord = oldPwd, + PassWord = oldPwd!, UserId = userId, }); } From 007f8eddc9a9e1764b0dc83b6b7dd850f7cbc840 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Wed, 9 Oct 2024 15:11:50 +0800 Subject: [PATCH 02/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81?= =?UTF-8?q?=E9=AA=8C=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/Management/UserService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index a45af0b2d..6ccedcdfb 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -103,7 +103,7 @@ namespace IRaCIS.Core.Application.Service oldPwd = await _userRepository.Where(x => x.Id == userId).Select(x => x.Password).FirstOrDefaultAsync(); } - if (!oldPwd.IsNotNullOrEmpty()) + if (oldPwd.IsNotNullOrEmpty()) { await _userPassWordLogRepository.AddAsync(new UserPassWordLog() { From e2e03e30efcfb3abf1f471afc73ad7d06907b7fc Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 10 Dec 2024 20:07:42 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E4=B8=B4=E6=97=B6=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 4e48f05b5..f3ee53788 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -2434,6 +2434,27 @@ namespace IRaCIS.Core.Application.Service.Common .Any(g => g.Any(t => t.JudgeVisitTaskId != null))) .Count(); + + + //exportInfo.judgeSubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId) + // .Where(t => t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) + // .GroupBy(task => new { task.SubjectId, task.VisitTaskNum }) + // .Where(g => g.Count() == 2) + // .FirstOrDefault().Any(t => t.JudgeVisitTaskId != null) + // ) + // .Count(); + + + //exportInfo.judgeSubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId) + // .Where(t => t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) + // .GroupBy(t => new { t.SubjectId, t.VisitTaskNum }) + // .Where(g => g.Count() == 2) + // .Any(g => g.OrderByDescending(c => c.VisitTaskNum).FirstOrDefault().JudgeVisitTaskId != null) + // ) + // .Count(); + exportInfo.DoctorSubjectStatList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) //筛选全局 已完成的任务 .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) From 91cde3f9448e2e8868cd331fed6b3fd255849426 Mon Sep 17 00:00:00 2001 From: hang <87227557@qq.com> Date: Tue, 10 Dec 2024 21:30:36 +0800 Subject: [PATCH 04/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 40 +++++++++++-------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index f3ee53788..79b99ba7e 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -2425,27 +2425,16 @@ namespace IRaCIS.Core.Application.Service.Common .Where(g => g.Count() == 2).Any()) .Count(); - //最后一个已完成的全局 没产生裁判 (之前有裁判),不算入裁判量 - exportInfo.judgeSubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId) - .Where(t => t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) - .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) - .GroupBy(t => new { t.SubjectId, t.VisitTaskNum }) - .Where(g => g.Count() == 2 && g.Key.VisitTaskNum == g.Max(t => t.VisitTaskNum)) - .Any(g => g.Any(t => t.JudgeVisitTaskId != null))) - .Count(); - - - + #region 废弃 + ////最后一个已完成的全局 没产生裁判 (之前有裁判),不算入裁判量 //exportInfo.judgeSubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId) // .Where(t => t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) - // .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) - // .GroupBy(task => new { task.SubjectId, task.VisitTaskNum }) - // .Where(g => g.Count() == 2) - // .FirstOrDefault().Any(t => t.JudgeVisitTaskId != null) - // ) + // .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) + // .GroupBy(t => new { t.SubjectId, t.VisitTaskNum }) + // .Where(g => g.Count() == 2 ) + // .Any(g => g.Any(t => t.JudgeVisitTaskId != null))) // .Count(); - //exportInfo.judgeSubjectCount = _subjectRepository.Where(t => t.TrialId == inQuery.TrialId) // .Where(t => t.SubjectVisitTaskList.AsQueryable().Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) // .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) @@ -2454,6 +2443,21 @@ namespace IRaCIS.Core.Application.Service.Common // .Any(g => g.OrderByDescending(c => c.VisitTaskNum).FirstOrDefault().JudgeVisitTaskId != null) // ) // .Count(); + #endregion + + + var subjectReadingPeriodList= _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) + .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) + .GroupBy(t => new { t.SubjectId, t.VisitTaskNum ,t.JudgeVisitTaskId }) + .Where(g => g.Count() == 2) + .Select(g => new { g.Key.SubjectId, g.Key.VisitTaskNum, g.Key.JudgeVisitTaskId }) + .ToList(); + + exportInfo.judgeSubjectCount = subjectReadingPeriodList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 + .Select(g => g.OrderByDescending(x => x.VisitTaskNum).First()) // 每组取 VisitTaskNum 最大的记录 + .Where(t => t.JudgeVisitTaskId != null) + .Count(); + exportInfo.DoctorSubjectStatList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) //筛选全局 已完成的任务 @@ -2479,6 +2483,8 @@ namespace IRaCIS.Core.Application.Service.Common .Select(t => t.SubjectId).Distinct().Count(), }).ToList(); + + #endregion #region 阅片期部分 From b14f3fb251b20637978fac59c4b01b3a8245ad41 Mon Sep 17 00:00:00 2001 From: hang <87227557@qq.com> Date: Wed, 11 Dec 2024 00:01:58 +0800 Subject: [PATCH 05/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E8=AE=A1=20?= =?UTF-8?q?=E5=88=86=E6=AD=A5=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FileDocProcess/ExcelExportHelper.cs | 4 +- .../Service/Common/ExcelExportService.cs | 102 ++++++++++++++---- 2 files changed, 81 insertions(+), 25 deletions(-) diff --git a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs index b97c0e8b4..dc48dd66e 100644 --- a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs @@ -78,7 +78,7 @@ public static class ExcelExportHelper foreach (var itemValuePair in itemDic) { // 临床数据 1,1 会变成2024-01-01 - if (itemValuePair.Value?.ToString().Length > 4 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result)) + if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result)) { itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result); } @@ -338,7 +338,7 @@ public static class ExcelExportHelper //处理集合里面时间类型,根据当前语言将时间转变为字符串 foreach (var itemValuePair in itemDic) { - if (itemValuePair.Value?.ToString().Length > 4 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result)) + if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result)) { itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result); } diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 79b99ba7e..4677dfcc0 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -2445,10 +2445,10 @@ namespace IRaCIS.Core.Application.Service.Common // .Count(); #endregion - - var subjectReadingPeriodList= _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) + // subject(G1 产生裁判 G2 不产生裁判 那么该患者不计入总量) + var subjectReadingPeriodList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) - .GroupBy(t => new { t.SubjectId, t.VisitTaskNum ,t.JudgeVisitTaskId }) + .GroupBy(t => new { t.SubjectId, t.VisitTaskNum, t.JudgeVisitTaskId }) .Where(g => g.Count() == 2) .Select(g => new { g.Key.SubjectId, g.Key.VisitTaskNum, g.Key.JudgeVisitTaskId }) .ToList(); @@ -2458,31 +2458,87 @@ namespace IRaCIS.Core.Application.Service.Common .Where(t => t.JudgeVisitTaskId != null) .Count(); - - exportInfo.DoctorSubjectStatList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) - //筛选全局 已完成的任务 + var subjectReadingPeriodDoctorList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) - .GroupBy(t => new { t.DoctorUserId, t.DoctorUser.UserName, t.DoctorUser.FullName }) - .Select(g => new DoctorJudgeRatio() + .GroupBy(t => new { t.SubjectId, t.VisitTaskNum, t.JudgeVisitTaskId }) + .Where(g => g.Count() == 2) + .Select(g => new { - DoctorUserId = g.Key.DoctorUserId, - UserName = g.Key.UserName, - FullName = g.Key.FullName, + g.Key.SubjectId, + g.Key.VisitTaskNum, + g.Key.JudgeVisitTaskId, - //最后一个阅片期触发裁判 且裁判已阅 - TotalJudgeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) - .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) - .Max(t => t.VisitTaskNum)) - .Select(t => t.SubjectId).Distinct().Count(), + GlobalList = g.Select(t => new + { + t.Id, + t.VisitTaskNum, + t.DoctorUserId, + t.DoctorUser.UserName, + t.DoctorUser.FullName, + t.JudgeVisitTask.JudgeResultTaskId + }).ToList() + }) + .ToList(); - // G-2 G-4 可能选择的是不同的医生,要以最后一次选择的为准 - JudgeAgreeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) - .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) - .Max(t => t.VisitTaskNum)) - .Where(t => t.JudgeVisitTask.JudgeResultTaskId == t.Id) - .Select(t => t.SubjectId).Distinct().Count(), - }).ToList(); + // 每个subject 仅仅留最后一个全局 + var filteredList = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 + .Select(g => g.OrderByDescending(x => x.VisitTaskNum).First()) // 每组取 VisitTaskNum 最大的记录 + //最后一个全局没有产生裁判的subject要过滤掉 过滤后 + .Where(t => t.JudgeVisitTaskId != null) + .SelectMany(t => t.GlobalList.Select(u => new + { + t.SubjectId, + t.VisitTaskNum, + t.JudgeVisitTaskId, + u.DoctorUserId, + u.UserName, + u.FullName, + u.JudgeResultTaskId, + VisitTaskId = u.Id + })) + .ToList(); + + exportInfo.DoctorSubjectStatList= filteredList.GroupBy(t => new { t.DoctorUserId, t.UserName, t.FullName }).Select(g=>new DoctorJudgeRatio() + { + DoctorUserId = g.Key.DoctorUserId, + UserName = g.Key.UserName, + FullName = g.Key.FullName, + + TotalJudgeCount = g.Count(), + + JudgeAgreeCount = g.Count(t=>t.JudgeResultTaskId==t.VisitTaskId) + + }).ToList(); + + + + + + //exportInfo.DoctorSubjectStatList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) + // //筛选全局 已完成的任务 + // .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) + // .GroupBy(t => new { t.DoctorUserId, t.DoctorUser.UserName, t.DoctorUser.FullName }) + // .Select(g => new DoctorJudgeRatio() + // { + // DoctorUserId = g.Key.DoctorUserId, + // UserName = g.Key.UserName, + // FullName = g.Key.FullName, + + // //最后一个阅片期触发裁判 且裁判已阅 + // TotalJudgeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Max(t => t.VisitTaskNum)) + // .Select(t => t.SubjectId).Distinct().Count(), + + // // G-2 G-4 可能选择的是不同的医生,要以最后一次选择的为准 + // JudgeAgreeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Max(t => t.VisitTaskNum)) + // .Where(t => t.JudgeVisitTask.JudgeResultTaskId == t.Id) + // .Select(t => t.SubjectId).Distinct().Count(), + + // }).ToList(); #endregion From a9f22897e92ac17d00b4a3cc209d38621e030dd6 Mon Sep 17 00:00:00 2001 From: hang <87227557@qq.com> Date: Wed, 11 Dec 2024 00:42:43 +0800 Subject: [PATCH 06/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 48 ++++++++++++------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 4677dfcc0..8a203774a 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -2475,29 +2475,45 @@ namespace IRaCIS.Core.Application.Service.Common t.DoctorUserId, t.DoctorUser.UserName, t.DoctorUser.FullName, - t.JudgeVisitTask.JudgeResultTaskId + t.JudgeVisitTaskId, + t.ReadingTaskState, + t.JudgeVisitTask.JudgeResultTaskId, + JudgeTaskState = (ReadingTaskState?)t.JudgeVisitTask.ReadingTaskState }).ToList() }) .ToList(); + var cc = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 + + .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null)) + + .ToList(); + + var kk = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 + + .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null)) + .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c=>c.VisitTaskNum).FirstOrDefault()) + + .ToList(); //找到最大完成裁判的阅片期 // 每个subject 仅仅留最后一个全局 var filteredList = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 - .Select(g => g.OrderByDescending(x => x.VisitTaskNum).First()) // 每组取 VisitTaskNum 最大的记录 - //最后一个全局没有产生裁判的subject要过滤掉 过滤后 - .Where(t => t.JudgeVisitTaskId != null) - .SelectMany(t => t.GlobalList.Select(u => new - { - t.SubjectId, - t.VisitTaskNum, - t.JudgeVisitTaskId, - u.DoctorUserId, - u.UserName, - u.FullName, - u.JudgeResultTaskId, - VisitTaskId = u.Id - })) - .ToList(); + //最后一个全局没有产生裁判的subject要过滤掉 过滤后 + .Where(g=>g.OrderByDescending(x=>x.VisitTaskNum).First().GlobalList.Any(c=>c.JudgeVisitTaskId != null)) + //找到最大完成裁判的阅片期 + .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c => c.VisitTaskNum).First()) + .SelectMany(t => t.GlobalList.Select(u => new + { + t.SubjectId, + t.VisitTaskNum, + t.JudgeVisitTaskId, + u.DoctorUserId, + u.UserName, + u.FullName, + u.JudgeResultTaskId, + VisitTaskId = u.Id + })) + .ToList(); exportInfo.DoctorSubjectStatList= filteredList.GroupBy(t => new { t.DoctorUserId, t.UserName, t.FullName }).Select(g=>new DoctorJudgeRatio() { From 828bd38eab92ca292e760449dd95bae0feeef073 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 11 Dec 2024 08:57:39 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E6=95=B4=E7=90=86=E5=BA=9F=E5=BC=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 74 +++++++------------ 1 file changed, 28 insertions(+), 46 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 8a203774a..50bece4b2 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -2443,9 +2443,34 @@ namespace IRaCIS.Core.Application.Service.Common // .Any(g => g.OrderByDescending(c => c.VisitTaskNum).FirstOrDefault().JudgeVisitTaskId != null) // ) // .Count(); + + //exportInfo.DoctorSubjectStatList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) + // //筛选全局 已完成的任务 + // .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) + // .GroupBy(t => new { t.DoctorUserId, t.DoctorUser.UserName, t.DoctorUser.FullName }) + // .Select(g => new DoctorJudgeRatio() + // { + // DoctorUserId = g.Key.DoctorUserId, + // UserName = g.Key.UserName, + // FullName = g.Key.FullName, + + // //最后一个阅片期触发裁判 且裁判已阅 + // TotalJudgeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Max(t => t.VisitTaskNum)) + // .Select(t => t.SubjectId).Distinct().Count(), + + // // G-2 G-4 可能选择的是不同的医生,要以最后一次选择的为准 + // JudgeAgreeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) + // .Max(t => t.VisitTaskNum)) + // .Where(t => t.JudgeVisitTask.JudgeResultTaskId == t.Id) + // .Select(t => t.SubjectId).Distinct().Count(), + + // }).ToList(); #endregion - // subject(G1 产生裁判 G2 不产生裁判 那么该患者不计入总量) + // subject(G1 产生裁判 G2 不产生裁判 那么该患者不计入总量) var subjectReadingPeriodList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) .GroupBy(t => new { t.SubjectId, t.VisitTaskNum, t.JudgeVisitTaskId }) @@ -2483,24 +2508,11 @@ namespace IRaCIS.Core.Application.Service.Common }) .ToList(); - var cc = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 - - .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null)) - - .ToList(); - - var kk = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 - - .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null)) - .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c=>c.VisitTaskNum).FirstOrDefault()) - - .ToList(); //找到最大完成裁判的阅片期 - - // 每个subject 仅仅留最后一个全局 + var filteredList = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 //最后一个全局没有产生裁判的subject要过滤掉 过滤后 .Where(g=>g.OrderByDescending(x=>x.VisitTaskNum).First().GlobalList.Any(c=>c.JudgeVisitTaskId != null)) - //找到最大完成裁判的阅片期 + //找到最大完成裁判的阅片期 // 每个subject 仅仅留最后一个全局 .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c => c.VisitTaskNum).First()) .SelectMany(t => t.GlobalList.Select(u => new { @@ -2527,36 +2539,6 @@ namespace IRaCIS.Core.Application.Service.Common }).ToList(); - - - - - //exportInfo.DoctorSubjectStatList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) - // //筛选全局 已完成的任务 - // .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) - // .GroupBy(t => new { t.DoctorUserId, t.DoctorUser.UserName, t.DoctorUser.FullName }) - // .Select(g => new DoctorJudgeRatio() - // { - // DoctorUserId = g.Key.DoctorUserId, - // UserName = g.Key.UserName, - // FullName = g.Key.FullName, - - // //最后一个阅片期触发裁判 且裁判已阅 - // TotalJudgeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // .Max(t => t.VisitTaskNum)) - // .Select(t => t.SubjectId).Distinct().Count(), - - // // G-2 G-4 可能选择的是不同的医生,要以最后一次选择的为准 - // JudgeAgreeCount = g.Where(t => t.JudgeVisitTaskId != null && t.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // .Where(t => t.VisitTaskNum == g.Where(c => c.SubjectId == t.SubjectId && c.JudgeVisitTaskId != null && c.JudgeVisitTask.ReadingTaskState == ReadingTaskState.HaveSigned) - // .Max(t => t.VisitTaskNum)) - // .Where(t => t.JudgeVisitTask.JudgeResultTaskId == t.Id) - // .Select(t => t.SubjectId).Distinct().Count(), - - // }).ToList(); - - #endregion #region 阅片期部分 From 8ff23af18c26000542553f05942c091d2abb358a Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 11 Dec 2024 09:44:13 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/ExcelExportService.cs | 68 +++++++++++++------ 1 file changed, 48 insertions(+), 20 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index 50bece4b2..d46947b92 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -2485,13 +2485,12 @@ namespace IRaCIS.Core.Application.Service.Common var subjectReadingPeriodDoctorList = _visitTaskRepository.Where(comonTaskFilter).Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned) .Where(t => t.Subject.ReadModuleList.Any(c => c.SubjectVisit.VisitNum == (t.VisitTaskNum - addReadingPeriodNum) && c.TrialReadingCriterionId == trialReadingCriterionId)) - .GroupBy(t => new { t.SubjectId, t.VisitTaskNum, t.JudgeVisitTaskId }) + .GroupBy(t => new { t.SubjectId, t.VisitTaskNum }) .Where(g => g.Count() == 2) .Select(g => new { g.Key.SubjectId, g.Key.VisitTaskNum, - g.Key.JudgeVisitTaskId, GlobalList = g.Select(t => new { @@ -2503,31 +2502,60 @@ namespace IRaCIS.Core.Application.Service.Common t.JudgeVisitTaskId, t.ReadingTaskState, t.JudgeVisitTask.JudgeResultTaskId, - JudgeTaskState = (ReadingTaskState?)t.JudgeVisitTask.ReadingTaskState + JudgeTaskState = (ReadingTaskState?)t.JudgeVisitTask.ReadingTaskState }).ToList() }) .ToList(); - + #region 调试注释 + //var cc = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 + + // .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null)) + + // .ToList(); + + //var ss = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 + // //最后一个全局没有产生裁判的subject要过滤掉 过滤后 + // .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null)) + + // .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c => c.VisitTaskNum).FirstOrDefault()) + + // .ToList(); + + + //var kk = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 + // //最后一个全局没有产生裁判的subject要过滤掉 过滤后 + // .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null)) + // // 存在 已完成的全局裁判 + // .Where(subg => subg.Any(t => t.GlobalList.Any(c => c.JudgeTaskState == ReadingTaskState.HaveSigned))) + // .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c => c.VisitTaskNum).FirstOrDefault()) + + // .ToList(); + #endregion + + + var filteredList = subjectReadingPeriodDoctorList.GroupBy(x => x.SubjectId) // 按 SubjectId 分组 - //最后一个全局没有产生裁判的subject要过滤掉 过滤后 - .Where(g=>g.OrderByDescending(x=>x.VisitTaskNum).First().GlobalList.Any(c=>c.JudgeVisitTaskId != null)) - //找到最大完成裁判的阅片期 // 每个subject 仅仅留最后一个全局 - .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c => c.VisitTaskNum).First()) + //最后一个全局没有产生裁判的subject要过滤掉 过滤后 + .Where(g => g.OrderByDescending(x => x.VisitTaskNum).First().GlobalList.Any(c => c.JudgeVisitTaskId != null)) + // subject 存在 已完成的全局裁判 + .Where(subg => subg.Any(t => t.GlobalList.Any(c => c.JudgeTaskState == ReadingTaskState.HaveSigned))) + //找到最大完成裁判的阅片期 // 每个subject 仅仅留最后一个已完成的全局 + .Select(g => g.Where(c => c.GlobalList.Any(k => k.JudgeTaskState == ReadingTaskState.HaveSigned)).OrderByDescending(c => c.VisitTaskNum).FirstOrDefault()) .SelectMany(t => t.GlobalList.Select(u => new - { - t.SubjectId, - t.VisitTaskNum, - t.JudgeVisitTaskId, - u.DoctorUserId, - u.UserName, - u.FullName, - u.JudgeResultTaskId, - VisitTaskId = u.Id - })) + { + t.SubjectId, + t.VisitTaskNum, + u.JudgeVisitTaskId, + u.DoctorUserId, + u.UserName, + u.FullName, + u.JudgeResultTaskId, + VisitTaskId = u.Id + })) .ToList(); - exportInfo.DoctorSubjectStatList= filteredList.GroupBy(t => new { t.DoctorUserId, t.UserName, t.FullName }).Select(g=>new DoctorJudgeRatio() + exportInfo.DoctorSubjectStatList = filteredList.GroupBy(t => new { t.DoctorUserId, t.UserName, t.FullName }).Select(g => new DoctorJudgeRatio() { DoctorUserId = g.Key.DoctorUserId, UserName = g.Key.UserName, @@ -2535,7 +2563,7 @@ namespace IRaCIS.Core.Application.Service.Common TotalJudgeCount = g.Count(), - JudgeAgreeCount = g.Count(t=>t.JudgeResultTaskId==t.VisitTaskId) + JudgeAgreeCount = g.Count(t => t.JudgeResultTaskId == t.VisitTaskId) }).ToList(); From f8e498b2e14b37237d90a3a39c9b22ad3f0c9570 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 11 Dec 2024 10:27:24 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8?= =?UTF-8?q?=E5=92=8C=E6=97=B6=E9=97=B4=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FileDocProcess/ExcelExportHelper.cs | 34 +++++----- .../IRaCIS.Core.Application.xml | 2 +- .../Service/Common/ExcelExportService.cs | 36 ++++++++--- .../_IRaCIS/ObjectExtension.cs | 64 +++++++++++-------- 4 files changed, 82 insertions(+), 54 deletions(-) diff --git a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs index dc48dd66e..bb06c55a6 100644 --- a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs @@ -74,15 +74,15 @@ public static class ExcelExportHelper { var itemDic = item.ConvertToDictionary(); - //处理集合里面时间类型,根据当前语言将时间转变为字符串 - foreach (var itemValuePair in itemDic) - { - // 临床数据 1,1 会变成2024-01-01 - if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result)) - { - itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result); - } - } + ////处理集合里面时间类型,根据当前语言将时间转变为字符串 + //foreach (var itemValuePair in itemDic) + //{ + // // 临床数据 1,1 会变成2024-01-01 + // if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result)) + // { + // itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result); + // } + //} foreach (var needTranslateProperty in needTranslatePropertyList) @@ -335,14 +335,14 @@ public static class ExcelExportHelper //var itemDic = JsonConvert.DeserializeObject>(item.ToJsonNotIgnoreNull()); var itemDic = item.ConvertToDictionary(); - //处理集合里面时间类型,根据当前语言将时间转变为字符串 - foreach (var itemValuePair in itemDic) - { - if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result)) - { - itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result); - } - } + ////处理集合里面时间类型,根据当前语言将时间转变为字符串 + //foreach (var itemValuePair in itemDic) + //{ + // if (itemValuePair.Value?.ToString().Length > 8 && DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result)) + // { + // itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result); + // } + //} foreach (var needTranslateProperty in needTranslatePropertyList) { diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 5f91adc12..c9bfa490c 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -933,7 +933,7 @@ - + 裁判一致率导出 diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index d46947b92..2a35844f8 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -8,6 +8,7 @@ using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infra.EFCore.Migrations; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; @@ -2347,6 +2348,7 @@ namespace IRaCIS.Core.Application.Service.Common public async Task GetCommonJudgeRatioList_Export(VisitTaskQuery inQuery, [FromServices] IRepository _commonDocumentRepository, [FromServices] IDictionaryService _dictionaryService, + [FromServices] IRepository _subjectUserRepository, [FromServices] IRepository _trialRepository) { //每次查询必须是单标准的 @@ -2555,17 +2557,33 @@ namespace IRaCIS.Core.Application.Service.Common })) .ToList(); - exportInfo.DoctorSubjectStatList = filteredList.GroupBy(t => new { t.DoctorUserId, t.UserName, t.FullName }).Select(g => new DoctorJudgeRatio() + + + //找到该标准的阅片人 + var armList = new List() { Arm.SingleReadingArm, Arm.DoubleReadingArm1, Arm.DoubleReadingArm2 }; + + exportInfo.DoctorSubjectStatList = _subjectUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && armList.Contains(t.ArmEnum)) + .Select(t => new DoctorJudgeRatio() + { + DoctorUserId = t.DoctorUserId, + UserName = t.DoctorUser.UserName, + FullName = t.DoctorUser.FullName, + + TotalJudgeCount = 0, + + JudgeAgreeCount = 0 + + }).Distinct().ToList(); + + foreach (var doctor in exportInfo.DoctorSubjectStatList) { - DoctorUserId = g.Key.DoctorUserId, - UserName = g.Key.UserName, - FullName = g.Key.FullName, + if (filteredList.Any(t => t.DoctorUserId == doctor.DoctorUserId)) + { + doctor.TotalJudgeCount= filteredList.Where(t=>t.DoctorUserId==doctor.DoctorUserId).Count(); - TotalJudgeCount = g.Count(), - - JudgeAgreeCount = g.Count(t => t.JudgeResultTaskId == t.VisitTaskId) - - }).ToList(); + doctor.JudgeAgreeCount= filteredList.Where(t => t.DoctorUserId == doctor.DoctorUserId).Count(t => t.JudgeResultTaskId == t.VisitTaskId); + } + } #endregion diff --git a/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs b/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs index 0e08f7634..56be0b871 100644 --- a/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs +++ b/IRaCIS.Core.Infrastructure/_IRaCIS/ObjectExtension.cs @@ -1,4 +1,5 @@ -using Newtonsoft.Json; +using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Reflection; @@ -8,29 +9,29 @@ namespace IRaCIS.Core.Infrastructure.Extention public static class ObjectExtension { - public static T Clone(this T source) - { - // Don't serialize a null object, simply return the default for that object - if (Object.ReferenceEquals(source, null)) - { - return default(T); - } + public static T Clone(this T source) + { + // Don't serialize a null object, simply return the default for that object + if (Object.ReferenceEquals(source, null)) + { + return default(T); + } - var deserializeSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace }; - var serializeSettings = new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }; - return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(source, serializeSettings), deserializeSettings); - } + var deserializeSettings = new JsonSerializerSettings { ObjectCreationHandling = ObjectCreationHandling.Replace }; + var serializeSettings = new JsonSerializerSettings { ReferenceLoopHandling = ReferenceLoopHandling.Ignore }; + return JsonConvert.DeserializeObject(JsonConvert.SerializeObject(source, serializeSettings), deserializeSettings); + } - /// - /// 将对象序列化成稽查需要的Json字符串 - /// - /// - /// - public static string ToJsonStr(this object obj) - { - - return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Ignore }); - } + /// + /// 将对象序列化成稽查需要的Json字符串 + /// + /// + /// + public static string ToJsonStr(this object obj) + { + + return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Ignore }); + } /// /// 通过类型参数反序列化 JSON 字符串为指定类型的对象 @@ -55,12 +56,12 @@ namespace IRaCIS.Core.Infrastructure.Extention /// /// public static string ToJsonNotIgnoreNull(this object obj) - { + { - return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", Formatting = Formatting.Indented, ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Include }); - } + return JsonConvert.SerializeObject(obj, new JsonSerializerSettings { DateFormatString = "yyyy-MM-dd HH:mm:ss", Formatting = Formatting.Indented, ReferenceLoopHandling = ReferenceLoopHandling.Ignore, NullValueHandling = NullValueHandling.Include }); + } - public static Dictionary ConvertToDictionary(this object obj) + public static Dictionary ConvertToDictionary(this object obj) { if (obj == null) { @@ -77,10 +78,19 @@ namespace IRaCIS.Core.Infrastructure.Extention string propertyName = property.Name; object propertyValue = property.GetValue(obj); // 如果属性的类型是枚举,将其值保留为整数 - if (property.PropertyType.IsEnum || (Nullable.GetUnderlyingType(property.PropertyType)?.IsEnum == true && propertyValue!=null) ) + if (property.PropertyType.IsEnum || (Nullable.GetUnderlyingType(property.PropertyType)?.IsEnum == true && propertyValue != null)) { dictionary.Add(propertyName, (int)propertyValue); } + // 检查属性是否是时间类型 + else if (property.PropertyType == typeof(DateTime) || + property.PropertyType == typeof(DateTime?) && propertyValue != null) + { + DateTime.TryParse(propertyValue.ToString(), out DateTime result); + var dt = ExportExcelConverterDate.DateTimeInternationalToString(result); + // 如果需要,可以对时间值进行特定的处理 + dictionary.Add(propertyName, dt); + } else { dictionary.Add(propertyName, propertyValue); From 6b592cbda72b85bb47bc40165fbfe961a06bb3a9 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 11 Dec 2024 10:44:33 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E9=92=88=E5=AF=B9=E6=97=B6=E5=8C=BA?= =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extention/ExportExcelDateConverter.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/IRaCIS.Core.Infrastructure/Extention/ExportExcelDateConverter.cs b/IRaCIS.Core.Infrastructure/Extention/ExportExcelDateConverter.cs index 281ececa9..1f1c59326 100644 --- a/IRaCIS.Core.Infrastructure/Extention/ExportExcelDateConverter.cs +++ b/IRaCIS.Core.Infrastructure/Extention/ExportExcelDateConverter.cs @@ -89,17 +89,17 @@ namespace IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson var needDealTime = dateTime.Value; - if (!string.IsNullOrWhiteSpace(clientZoneId)) - { - needDealTime = TimeZoneInfo.ConvertTime(needDealTime, TimeZoneInfo.Local, TimeZoneInfo.FindSystemTimeZoneById(clientZoneId)); - } - if (needDealTime.Hour == 0 && needDealTime.Minute == 0 && needDealTime.Second == 0 && needDealTime.Millisecond==0) { return needDealTime.ToString("yyyy-MM-dd"); } else { + if (!string.IsNullOrWhiteSpace(clientZoneId)) + { + needDealTime = TimeZoneInfo.ConvertTime(needDealTime, TimeZoneInfo.Local, TimeZoneInfo.FindSystemTimeZoneById(clientZoneId)); + } + if (isEn_US) { //暂时保持一致,等需求确认,修改英文要展示的日期格式 From 125846e6b26b5ef16337a8dcba793a4d4174bf92 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 11 Dec 2024 13:00:03 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Helper/FileDocProcess/ExcelExportHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs index bb06c55a6..12d0b97f1 100644 --- a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs @@ -166,7 +166,7 @@ public static class ExcelExportHelper } //中文替换项目术语 - if (data.TrialObjectNameList.Count > 0) + if (data.TrialObjectNameList?.Count > 0) { var replaceObjectList = data.TrialObjectNameList; From a7441c8c78fe4ee314382d21b66c1af15c3f480e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 11 Dec 2024 13:26:59 +0800 Subject: [PATCH 12/13] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8?= =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Helper/FileDocProcess/ExcelExportHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs index 12d0b97f1..48700c78c 100644 --- a/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileDocProcess/ExcelExportHelper.cs @@ -64,7 +64,7 @@ public static class ExcelExportHelper foreach (var key in dic.Keys) { //是数组 那么找到对应的属性 进行翻译 - if (dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>))) + if (dic[key]!=null && dic[key].GetType().GetInterfaces().Any(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IList<>))) { var newObjList = new List(); From 34c50858c92469d4e287bb400adc815d87721713 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 11 Dec 2024 13:37:09 +0800 Subject: [PATCH 13/13] =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=82=AE=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/appsettings.Prod_IRC.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.API/appsettings.Prod_IRC.json b/IRaCIS.Core.API/appsettings.Prod_IRC.json index 9c63cd9b1..5513be6f7 100644 --- a/IRaCIS.Core.API/appsettings.Prod_IRC.json +++ b/IRaCIS.Core.API/appsettings.Prod_IRC.json @@ -71,7 +71,7 @@ "CompanyShortName": "Extensive Imaging", "CompanyShortNameCN": "展影医疗", "IsEnv_US": false, - "IsOpenErrorNoticeEmail": true, + "IsOpenErrorNoticeEmail": false, "ErrorNoticeEmailList": [ "872297557@qq.com" ] }, "SystemPacsConfig": {