From 6df64d68af1018e3773f6ce1068305e4d7cba68c Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 11 Jul 2023 09:58:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AD=E5=BF=83=E8=B0=83?= =?UTF-8?q?=E7=A0=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Allocation/DTO/VisitTaskViewModel.cs | 1 - .../Service/Allocation/VisitTaskService.cs | 1 - .../SiteSurvey/TrialSiteSurveyService.cs | 6 +-- IRaCIS.Core.Domain/Allocation/PIAudit.cs | 54 +++++++++++++++++++ IRaCIS.Core.Domain/Allocation/VisitTask.cs | 34 ++++++++++-- .../Context/IRaCISDBContext.cs | 2 + IRaCIS.Core.Test/DbHelper.ttinclude | 4 +- 7 files changed, 91 insertions(+), 11 deletions(-) create mode 100644 IRaCIS.Core.Domain/Allocation/PIAudit.cs diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 01b6b0444..cf4f5b786 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -154,7 +154,6 @@ namespace IRaCIS.Core.Application.ViewModel public string FirstAuditUserName { get; set; } public DateTime? FirstAuditTime { get; set; } - public int AuditResultEnum { get; set; } public Guid? LatestReplyUserId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 509433c0a..5c20add50 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -217,7 +217,6 @@ namespace IRaCIS.Core.Application.Service.Allocation .WhereIf(queryVisitTask.FirstAuditTimeEnd != null, t => t.AllocateTime < queryVisitTask.FirstAuditTimeEnd) .WhereIf(queryVisitTask.LatestReplyTimeBegin != null, t => t.AllocateTime > queryVisitTask.LatestReplyTimeBegin) .WhereIf(queryVisitTask.LatestReplyTimeEnd != null, t => t.AllocateTime < queryVisitTask.LatestReplyTimeEnd) - .WhereIf(queryVisitTask.AuditResultEnum != null, t => t.AuditResultEnum == queryVisitTask.AuditResultEnum) ; diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index e7271387a..83162ecf6 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -736,7 +736,7 @@ namespace IRaCIS.Core.Application.Contracts var trialSiteSurvey = (await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId).FirstOrDefaultAsync()).IfNullThrowException(); - var siteUserList = await _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurvey.SiteId == trialSiteSurvey.SiteId && t.TrialSiteSurvey.IsDeleted==false).Select(t => new { t.TrialSiteSurveyId, t.IsGenerateAccount, t.IsGenerateSuccess, t.UserTypeId, + var siteUserList = await _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurvey.TrialId==trialId && t.TrialSiteSurvey.SiteId == trialSiteSurvey.SiteId && t.TrialSiteSurvey.IsDeleted==false).Select(t => new { t.TrialSiteSurveyId, t.IsGenerateAccount, t.IsGenerateSuccess, t.UserTypeId, UserTypeEnum= (UserTypeEnum?) t.UserTypeRole.UserTypeEnum , t.TrialRoleName.Code }).ToListAsync(); @@ -748,7 +748,7 @@ namespace IRaCIS.Core.Application.Contracts { var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList(); - if(!currentUserList.Any(t=>t.Code=="1")|| !currentUserList.Any(t => t.Code == "4")) + if(!currentUserList.Any(t=>t.Code=="1") || !currentUserList.Any(t => t.Code == "4")) { throw new BusinessValidationFailedException("本次提交,必须有CRC和影像负责人信息"); } @@ -767,7 +767,7 @@ namespace IRaCIS.Core.Application.Contracts { var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList(); - if (!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator) || + if (!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator) || !currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.SR)) { throw new BusinessValidationFailedException("本次提交,生成账号必须要有CRC 和SR"); diff --git a/IRaCIS.Core.Domain/Allocation/PIAudit.cs b/IRaCIS.Core.Domain/Allocation/PIAudit.cs new file mode 100644 index 000000000..f760f4699 --- /dev/null +++ b/IRaCIS.Core.Domain/Allocation/PIAudit.cs @@ -0,0 +1,54 @@ + +//-------------------------------------------------------------------- +// 此代码由T4模板自动生成 byzhouhang 20210918 +// 生成时间 2023-07-10 15:14:16 +// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 +using System; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; +namespace IRaCIS.Core.Domain.Models +{ + /// + ///PIAudit + /// + [Table("PIAudit")] + public class PIAudit : Entity, IAuditAdd + { + + /// + /// Id + /// + [Key] + [Required] + public Guid Id { get; set; } + + /// + /// PIAuditNote + /// + public string PIAuditNote { get; set; } + + /// + /// NotAgreeReason + /// + public string NotAgreeReason { get; set; } + + /// + /// PIAuditImagePath + /// + public string PIAuditImagePath { get; set; } + + /// + /// CreateUserId + /// + [Required] + public Guid CreateUserId { get; set; } + + /// + /// CreateTime + /// + [Required] + public DateTime CreateTime { get; set; } + + } +} diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index f9426ee6c..807a75aad 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -376,8 +376,6 @@ namespace IRaCIS.Core.Domain.Models public Trial Trial { get; set; } - public PIAuditState PIAuditState { get; set; } - //影像质量 等等第一层级问题答案 [JsonIgnore] @@ -426,6 +424,36 @@ namespace IRaCIS.Core.Domain.Models } } + public string NotAgreeReason { get; set; } + public string PIAuditNote { get; set; } = string.Empty; + + public string PIAuditImagePath { get; set; } + + [NotMapped] + public List PIAuditImagePathList + { + get + { + + try + { + return this.PIAuditImagePath.Trim().Split('|').ToList(); + } + catch (Exception) + { + + return new List(); + } + + } + } + + + public PIAuditState PIAuditState { get; set; } + + + + [JsonIgnore] public User FirstAuditUser { get; set; } @@ -436,8 +464,6 @@ namespace IRaCIS.Core.Domain.Models public Guid? FirstAuditUserId { get; set; } public DateTime? FirstAuditTime { get; set; } - public int AuditResultEnum { get; set; } - public Guid? LatestReplyUserId { get;set; } public DateTime? LatestReplyTime { get; set; } diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index 344cd1c73..6e1d84aae 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -782,6 +782,8 @@ namespace IRaCIS.Core.Infra.EFCore public virtual DbSet Internationalization { get; set; } + public virtual DbSet PIAudit { get; set; } + } diff --git a/IRaCIS.Core.Test/DbHelper.ttinclude b/IRaCIS.Core.Test/DbHelper.ttinclude index b0b701547..19d633448 100644 --- a/IRaCIS.Core.Test/DbHelper.ttinclude +++ b/IRaCIS.Core.Test/DbHelper.ttinclude @@ -2,9 +2,9 @@ public class config { public static readonly string ConnectionString = "Server=123.56.94.154,1433\\MSSQLSERVER;Database=IRaCIS_New_Tet;User ID=sa;Password=dev123456DEV;TrustServerCertificate=true"; - public static readonly string DbDatabase = "IRaCIS_New_Tet"; + public static readonly string DbDatabase = "CenterImage_Test"; //ַ,ƴ - public static readonly string TableName = "ReadModuleCriterionFrom"; + public static readonly string TableName = "PIAudit"; //ļ service Ƿҳ } #>