修改中心调研

This commit is contained in:
2023-08-08 14:53:07 +08:00
parent 106cbfacce
commit 7e518bf3ab
11 changed files with 16 additions and 38 deletions
@@ -84,7 +84,6 @@ namespace IRaCIS.Core.Application.Contracts
public bool? IsGenerateAccount { get; set; }
public Guid? TrialRoleNameId { get; set; }
public TrialSiteUserStateEnum? State { get; set; }
@@ -48,9 +48,7 @@ namespace IRaCIS.Core.Application.Contracts
}
}
public string TrialRoleName { get; set; }
public string TrialRoleCode { get; set; }
public UserTypeEnum? UserTypeEnum { get; set; }
@@ -98,7 +96,7 @@ namespace IRaCIS.Core.Application.Contracts
[DictionaryTranslateAttribute("YesOrNo")]
public bool IsGenerateAccount { get; set; }
public Guid TrialRoleNameId { get; set; }
public int TrialRoleCode { get; set; }
public string OrganizationName { get; set; } = string.Empty;
}
@@ -263,7 +263,8 @@ namespace IRaCIS.Core.Application.Contracts
{
//找到最新的调研表
var currentLatest = await _trialSiteSurveyRepository.Where(t => t.TrialId == userInfo.TrialId && t.SiteId == userInfo.SiteId, true).OrderByDescending(t => t.CreateTime).FirstOrDefaultAsync();
var currentLatest = await _trialSiteSurveyRepository.Where(t => t.TrialId == userInfo.TrialId && t.SiteId == userInfo.SiteId, true)
.Include(u => u.TrialSiteEquipmentSurveyList).Include(u => u.TrialSiteUserSurveyList).OrderByDescending(t => t.CreateTime).FirstOrDefaultAsync();
if (currentLatest == null)
{
@@ -304,7 +305,7 @@ namespace IRaCIS.Core.Application.Contracts
copy.TrialSiteEquipmentSurveyList.ForEach(t => t.Id = Guid.Empty);
copy.TrialSiteUserSurveyList.ForEach(t => { t.Id = Guid.Empty; t.IsGenerateSuccess = false; });
currentEntity = await _repository.AddAsync(copy);
currentEntity = await _trialSiteSurveyRepository.AddAsync(copy);
}
@@ -448,7 +449,6 @@ namespace IRaCIS.Core.Application.Contracts
.Where(t => groupSelectIdQuery.Contains(t.TrialSiteSurveyId))
.WhereIf(queryParam.UserTypeId != null, t => t.UserTypeId == queryParam.UserTypeId)
.WhereIf(queryParam.IsGenerateAccount != null, t => t.IsGenerateAccount == queryParam.IsGenerateAccount)
.WhereIf(queryParam.TrialRoleNameId != null, t => t.TrialRoleNameId == queryParam.TrialRoleNameId)
.WhereIf(queryParam.State != null && queryParam.State != TrialSiteUserStateEnum.OverTime, t => t.InviteState == queryParam.State)
.WhereIf(!string.IsNullOrEmpty(queryParam.UserName), t => (t.LastName + " / " + t.FirstName).Contains(queryParam.UserName))
.WhereIf(!string.IsNullOrEmpty(queryParam.OrganizationName), t => t.OrganizationName.Contains(queryParam.OrganizationName))
@@ -619,7 +619,7 @@ namespace IRaCIS.Core.Application.Contracts
t.IsGenerateSuccess,
t.UserTypeId,
UserTypeEnum = (UserTypeEnum?)t.UserTypeRole.UserTypeEnum,
t.TrialRoleName.Code,
t.TrialRoleCode,
t.Email
}).ToListAsync();
@@ -629,7 +629,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 == "5"))
if (!currentUserList.Any(t => t.TrialRoleCode == 1) || !currentUserList.Any(t => t.TrialRoleCode == 5))
{
throw new BusinessValidationFailedException("本次提交,必须有CRC和影像阅片人信息");
}
@@ -62,7 +62,6 @@ namespace IRaCIS.Core.Application.Contracts
}
}
}
@@ -36,8 +36,6 @@ namespace IRaCIS.Core.Application.AutoMapper
var isEn_Us = false;
CreateMap<TrialSiteUserSurvey, TrialSiteUserSurveyView>()
.ForMember(t => t.TrialRoleName, u => u.MapFrom(d => isEn_Us? d.TrialRoleName.Value:d.TrialRoleName.ValueCN))
.ForMember(t => t.TrialRoleCode, u => u.MapFrom(d => d.TrialRoleName.Code))
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName))
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.UserTypeRole.UserTypeEnum));
@@ -70,7 +68,6 @@ namespace IRaCIS.Core.Application.AutoMapper
CreateMap<TrialSiteUserSurvey, TrialSiteUserSurveyAllDTO>()
.ForMember(t=>t.TrialSiteSurvey,u=>u.MapFrom(c=>c.TrialSiteSurvey))
.ForMember(t => t.TrialRoleName, u => u.MapFrom(d => d.TrialRoleName.Value))
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName))
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.UserTypeRole.UserTypeEnum));