diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs index 38904e2cf..2d51494cc 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs @@ -5,6 +5,7 @@ //-------------------------------------------------------------------- using System.ComponentModel.DataAnnotations; +using System.Text.Json.Serialization; using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Contracts { @@ -68,7 +69,8 @@ namespace IRaCIS.Core.Application.Contracts public List TrialSiteUserSurveyList { get; set; } = new List(); - public List FileConfigList { get; set; } = new List(); + + public SiteSurveyFiledConfig SiteSurveyFiledConfig { get; set; } } public class TrialSiteUserSurveyAllDTO : TrialSiteUserSurveyView diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 96a3c8bc8..5f6de6788 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -117,7 +117,7 @@ namespace IRaCIS.Core.Application.Contracts } else //验证码正确 并且 没有超时 { - var dockerInfo=await _repository.Where(t=>t.EMail==inDto.EmailOrPhone||t.Phone==inDto.EmailOrPhone).FirstOrDefaultAsync(); + var dockerInfo = await _repository.Where(t => t.EMail == inDto.EmailOrPhone || t.Phone == inDto.EmailOrPhone).FirstOrDefaultAsync(); if (dockerInfo != null) { @@ -391,9 +391,9 @@ namespace IRaCIS.Core.Application.Contracts var result = await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId && t.TrialId == trialId).IgnoreQueryFilters() .ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); - var siteSurveryConfig= _trialSiteSurveyRepository.Where(t=>t.Id == trialSiteSurveyId).Select(t=>t.Trial.SiteSurveyConfigJsonStr).FirstOrDefault(); + var siteSurveryConfig = _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId).Select(t => t.Trial.SiteSurveyConfigJsonStr).FirstOrDefault(); - result.FileConfigList= JsonConvert.DeserializeObject>(siteSurveryConfig) ?? new List(); + result.SiteSurveyFiledConfig = JsonConvert.DeserializeObject(siteSurveryConfig) ?? new SiteSurveyFiledConfig(); return result; } @@ -470,11 +470,11 @@ namespace IRaCIS.Core.Application.Contracts .WhereIf(surveyQueryDTO.State != null, t => t.State == surveyQueryDTO.State) .WhereIf(surveyQueryDTO.UpdateTimeBegin != null, t => t.UpdateTime >= surveyQueryDTO.UpdateTimeBegin) .WhereIf(surveyQueryDTO.UpdateTimeEnd != null, t => t.UpdateTime <= surveyQueryDTO.UpdateTimeEnd) - - .ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }) - .WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.PreliminaryUserName), t => t.PreliminaryUser.RealName.Contains(surveyQueryDTO.PreliminaryUserName)) - .WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.ReviewerUserName), t => t.ReviewerUser.RealName.Contains(surveyQueryDTO.ReviewerUserName)) - ; + + .ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }) + .WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.PreliminaryUserName), t => t.PreliminaryUser.RealName.Contains(surveyQueryDTO.PreliminaryUserName)) + .WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.ReviewerUserName), t => t.ReviewerUser.RealName.Contains(surveyQueryDTO.ReviewerUserName)) + ; return await trialSiteSurveyQueryable.ToPagedListAsync(surveyQueryDTO.PageIndex, surveyQueryDTO.PageSize, surveyQueryDTO.SortField, surveyQueryDTO.Asc); } @@ -501,7 +501,7 @@ namespace IRaCIS.Core.Application.Contracts var groupSelectIdQuery = _trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId) .WhereIf(queryParam.TrialSiteId != null, t => t.TrialSiteId == queryParam.TrialSiteId) - + .WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo)) .GroupBy(t => t.TrialSiteId) .Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First()); @@ -626,7 +626,7 @@ namespace IRaCIS.Core.Application.Contracts + Path.DirectorySeparatorChar.ToString() + "EmailTemplate" + Path.DirectorySeparatorChar.ToString() - + (_userInfo.IsEn_Us ? "TrialSiteSurveyReject_US.html" : "TrialSiteSurveyReject.html") ; + + (_userInfo.IsEn_Us ? "TrialSiteSurveyReject_US.html" : "TrialSiteSurveyReject.html"); using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile)) @@ -729,12 +729,12 @@ 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)) { throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_MissingAccount"]); } - if (currentUserList.Where(t=>t.IsGenerateAccount && t.UserTypeId!=null).GroupBy(t => new { t.UserTypeId, t.Email }) + if (currentUserList.Where(t => t.IsGenerateAccount && t.UserTypeId != null).GroupBy(t => new { t.UserTypeId, t.Email }) .Any(g => g.Count() > 1)) { throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_DuplicateEmail"]); @@ -764,7 +764,7 @@ namespace IRaCIS.Core.Application.Contracts await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved, PreliminaryUserId = _userInfo.Id, PreliminaryTime = DateTime.Now }); } - else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager|| _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM) + else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM) { var allUserList = _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ProjectTo(_mapper.ConfigurationProvider).ToList(); @@ -938,7 +938,7 @@ namespace IRaCIS.Core.Application.Contracts DeletedTime = DateTime.Now, }); - + await _repository.SaveChangesAsync(); } diff --git a/IRaCIS.Core.Domain.Share/Trial/TrialExpedited.cs b/IRaCIS.Core.Domain.Share/Trial/TrialExpedited.cs index 19a1df667..04d5da70a 100644 --- a/IRaCIS.Core.Domain.Share/Trial/TrialExpedited.cs +++ b/IRaCIS.Core.Domain.Share/Trial/TrialExpedited.cs @@ -1,11 +1,13 @@ -namespace IRaCIS.Core.Domain.Share +using System.Collections.Generic; + +namespace IRaCIS.Core.Domain.Share { public enum TrialExpedited { - All=-1, + All = -1, - None=0, + None = 0, ExpeditedIn24H = 1, @@ -29,20 +31,26 @@ { //0全部中国医生 1美国医生 2既有中国医生,也有美国医生 - CN=0, + CN = 0, - US=1, + US = 1, - EU=2, + EU = 2, - Other=3 + Other = 3 } public class SiteSurveyFiledConfig { - public string NotShowField { get; set; } + public List NotShowFieldList { get; set; }=new List(); + public List ModifyFiledList { get; set; }=new List(); + + } + + public class SiteSurveyModifyFiled + { public string NeedModifyFiled { get; set; } public string ReplaceContent { get; set; } @@ -52,14 +60,14 @@ public enum DeclarationType { - Other=3, + Other = 3, - US=1, + US = 1, - CN=0, + CN = 0, - EU=2, + EU = 2, - JP=4 + JP = 4 } } \ No newline at end of file