From d859b250e9b05cd7aa8c20b650bbdad25e52aa7c Mon Sep 17 00:00:00 2001
From: hang <872297557@qq.com>
Date: Tue, 24 May 2022 15:02:03 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A8=BD=E6=9F=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../IRaCIS.Core.Application.xml | 4 --
.../Common/AuditingData.cs | 58 +++++++++--------
.../Common/Dto/SetDictionaryValueDto.cs | 63 ++++++++++---------
3 files changed, 65 insertions(+), 60 deletions(-)
diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
index 17dcf563..b294a208 100644
--- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
+++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml
@@ -1489,10 +1489,6 @@
关闭质疑,什么情况下允许?
-
-
-
-
diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
index 5aa6c9fa..0c0181d1 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs
@@ -1041,69 +1041,73 @@ namespace IRaCIS.Core.Infra.EFCore.Common
}
}
+
+
+
///
/// 设置项目以及名称
///
- ///
+ ///
///
- public async Task SetInspectionNameValue(InspectionGeneralData Data)
+ public async Task SetInspectionNameValue(InspectionGeneralData generalData)
{
#region 项目名称
- var trialdata = await _dbContext.Trial.Select(x => new { x.Id, x.ResearchProgramNo, x.ExperimentName, }).FirstOrDefaultAsync(x => x.Id == Data.TrialId);
- if (IsNullOrEmpty(Data.ResearchProgramNo))
- {
- Data.ResearchProgramNo = trialdata?.ResearchProgramNo;
+ if (generalData.TrialId != null)
+ {
+ var trialdata = (await _dbContext.Trial.Select(x => new { x.Id, x.ResearchProgramNo, x.ExperimentName, }).FirstOrDefaultAsync(x => x.Id == generalData.TrialId)).IfNullThrowException();
+
+ generalData.ResearchProgramNo = trialdata.ResearchProgramNo;
+
+ generalData.TrialName = trialdata.ExperimentName;
+
}
- if (IsNullOrEmpty(Data.TrialName))
- {
- Data.TrialName = trialdata?.ExperimentName;
- }
#endregion
#region 测试中心名称
-
-
- Data.SiteCode = (await _dbContext.TrialSite.IgnoreQueryFilters().FirstOrDefaultAsync(x => x.TrialId == Data.TrialId && x.SiteId == Data.SiteId))?.TrialSiteCode;
-
-
-
- if (IsNullOrEmpty(Data.SiteName) && Data.SiteId != null)
+ xiu
+ if(generalData.TrialId != null && generalData.SiteId != null)
{
- var sitedata = await _dbContext.Site.Where(x => x.Id == Data.SiteId).Select(x => new { x.SiteName }).FirstOrDefaultAsync();
- Data.SiteName = sitedata?.SiteName;
+
+ generalData.SiteCode = (await _dbContext.TrialSite.IgnoreQueryFilters().Where(x => x.TrialId == generalData.TrialId && x.SiteId == generalData.SiteId).Select(t=>t.TrialSiteCode).FirstOrDefaultAsync()).IfNullThrowException();
+
+
+ generalData.SiteName =( await _dbContext.Site.Where(x => x.Id == generalData.SiteId).Select(x => x.SiteName ).FirstOrDefaultAsync()).IfNullThrowException();
+
}
+
+
#endregion
#region 受试者
- if (IsNullOrEmpty(Data.SubjectCode) && Data.SubjectId != null)
+ if (IsNullOrEmpty(generalData.SubjectCode) && generalData.SubjectId != null)
{
- Data.SubjectCode = (await _dbContext.Subject.Where(x => x.Id == Data.SubjectId).Select(x => new { x.Code }).FirstOrDefaultAsync())?.Code;
+ generalData.SubjectCode = (await _dbContext.Subject.Where(x => x.Id == generalData.SubjectId).Select(x => new { x.Code }).FirstOrDefaultAsync())?.Code;
}
#endregion
#region 访视
- if (IsNullOrEmpty(Data.SubjectVisitName))
+ if (IsNullOrEmpty(generalData.SubjectVisitName))
{
- Data.SubjectVisitName = (await _dbContext.SubjectVisit.Where(x => x.Id == Data.SubjectVisitId).Select(x => new { x.VisitName }).FirstOrDefaultAsync())?.VisitName;
+ generalData.SubjectVisitName = (await _dbContext.SubjectVisit.Where(x => x.Id == generalData.SubjectVisitId).Select(x => new { x.VisitName }).FirstOrDefaultAsync())?.VisitName;
}
#endregion
#region 创建者
- if (IsNullOrEmpty(Data.CreateUserName))
+ if (IsNullOrEmpty(generalData.CreateUserName))
{
- Data.CreateUserName = _userInfo.RealName;
+ generalData.CreateUserName = _userInfo.RealName;
}
- if (IsNullOrEmpty(Data.RoleName))
+ if (IsNullOrEmpty(generalData.RoleName))
{
- Data.RoleName = _userInfo.UserTypeShortName;
+ generalData.RoleName = _userInfo.UserTypeShortName;
}
#endregion
}
diff --git a/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs b/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs
index 04c439c9..e1cdfcb8 100644
--- a/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs
+++ b/IRaCIS.Core.Infra.EFCore/Common/Dto/SetDictionaryValueDto.cs
@@ -96,45 +96,50 @@ namespace IRaCIS.Core.Infra.EFCore.Common.Dto
///
public Guid? SubjectVisitId { get; set; }
+
+ ///
+ /// 项目名称
+ ///
+ public string? TrialName { get; set; }
+
+ ///
+ /// 中心Code
+ ///
+ public string? SiteCode { get; set; }
+
+ ///
+ /// 项目编码
+ ///
+ public string? ResearchProgramNo { get; set; }
+
+ ///
+ /// 中心名称
+ ///
+ public string? SiteName { get; set; }
+
+ ///
+ /// 受试者名称
+ ///
+ public string? SubjectCode { get; set; }
+
+ ///
+ /// 访视名称
+ ///
+ public string? SubjectVisitName { get; set; }
+
+
+
///
/// 创建人名称
///
public string CreateUserName { get; set; }
- ///
- /// 项目名称
- ///
- public string TrialName { get; set; }
-
- ///
- /// 中心名称
- ///
- public string SiteName { get; set; }
-
- ///
- /// 受试者名称
- ///
- public string SubjectCode { get; set; }
-
- ///
- /// 访视名称
- ///
- public string SubjectVisitName { get; set; }
-
+
///
/// 角色名称
///
public string RoleName { get; set; }
- ///
- /// 中心Code
- ///
- public string SiteCode { get; set; }
-
- ///
- /// 项目编码
- ///
- public string ResearchProgramNo { get; set; }
}
public class SetInspectionEnum