项目参与人员和参与site修改

This commit is contained in:
2022-03-29 11:30:55 +08:00
parent 06c7b1ec52
commit 3b10124114
13 changed files with 131 additions and 119 deletions
@@ -488,7 +488,6 @@ namespace IRaCIS.Core.Application.Services
/// </summary>
/// <returns></returns>
[NonDynamicMethod]
public async Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand)
{
@@ -48,7 +48,6 @@ namespace IRaCIS.Core.Application.Service
CreateMap<Role, RoleDTO>();
CreateMap<Menu, MenuFunctionDTO>();
CreateMap<User, UserSelectionModel>();
CreateMap<UserType, UserTypeViewModel>();
@@ -83,8 +83,13 @@ namespace IRaCIS.Core.Application.Contracts
public int EfficacyEvaluatorType { get; set; }
public bool IsFollowStudyParameters { get; set; }
public string NotFollowReson { get; set; } = string.Empty;
//public bool IsLocked { get; set; } = false;
public TrialSiteSurveyEnum State { get; set; }
public string LatestBackReason { get; set; } = string.Empty;
}
///<summary>TrialSiteSurveyQuery 列表查询参数模型</summary>
@@ -21,8 +21,21 @@ namespace IRaCIS.Core.Application.Contracts
public string TrialRoleName { get; set; }
public Guid? SystemUserId { get; set; }
public UserInfoBasic ReviewerUser { get; set; }
public UserInfoBasic PreliminaryUser { get; set; }
}
public class UserInfoBasic
{
public Guid Id { get; set; }
public string RealName { get; set; } = string.Empty;
public string UserName { get; set; } = string.Empty;
}
///<summary>TrialSiteUserSurveyQuery 列表查询参数模型</summary>
public class TrialSiteUserSurveyQuery
{
@@ -509,10 +509,10 @@ namespace IRaCIS.Core.Application.Contracts
}
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM)
{
if (_repository.Where<TrialSiteUserSurvey>(t => t.TrialSiteSurveyId == trialSiteSurveyId && t.IsCorrect == false).Any())
{
return ResponseOutput.NotOk("人员信息有不正确项,不允许提交");
}
//if (_repository.Where<TrialSiteUserSurvey>(t => t.TrialSiteSurveyId == trialSiteSurveyId && t.IsCorrect == false).Any())
//{
// return ResponseOutput.NotOk("人员信息有不正确项,不允许提交");
//}
await _trialSiteSurveyRepository.UpdateFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved });
@@ -524,13 +524,13 @@ namespace IRaCIS.Core.Application.Contracts
if (trialSiteSurvey == null) return Null404NotFound(trialSiteSurvey);
if (_trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId && t.IsCorrect == false).Any())
{
return ResponseOutput.NotOk("人员信息有不正确项,不允许提交");
}
//if (_trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId && t.IsCorrect == false).Any())
//{
// return ResponseOutput.NotOk("人员信息有不正确项,不允许提交");
//}
//已生成的不管 管的只需要是 生成失败的并且需要生成账号的
var needGenerateList = _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId && t.IsCorrect && t.IsGenerateAccount && t.IsGenerateSuccess == false).ToList();
var needGenerateList = _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId && t.IsGenerateAccount && t.IsGenerateSuccess == false).ToList();
var trialInfo = await _repository.FirstOrDefaultAsync<Trial>(t => t.Id == trialId);
@@ -56,6 +56,10 @@ namespace IRaCIS.Core.Application.AutoMapper
CreateMap<TrialSiteUserSurvey, User>();
CreateMap<User, UserInfoBasic>().ForMember(d => d.RealName, u => u.MapFrom(s => s.LastName + " / " + s.FirstName));
}
}
}
@@ -131,13 +131,7 @@ namespace IRaCIS.Application.Contracts
public class UserSelectionModel
{
public Guid Id { get; set; }
public string RealName { get; set; } = string.Empty;
public string UserName { get; set; } = string.Empty;
}
public class TrialMaintenanceQuery : PageInput
@@ -150,6 +144,8 @@ namespace IRaCIS.Application.Contracts
public string OrganizationName { get; set; } = String.Empty;
public bool? IsDeleted { get; set; }
//public DateTime? RemoveTime { get; set; }
//public DateTime? JoinTime { get; set; }
@@ -31,15 +31,14 @@ namespace IRaCIS.Application.Services
.WhereIf(!string.IsNullOrWhiteSpace(param.UserType), t => t.User.UserTypeRole.UserTypeShortName.Contains(param.UserType))
.WhereIf(!string.IsNullOrWhiteSpace(param.UserName), t => t.User.UserName.Contains(param.UserName))
//.WhereIf( param.JoinTime!=null, t => t.JoinTime.to ==param.JoinTime.ToString("yyyy-MM-dd"))
//.WhereIf(param.RemoveTime!=null, t => t.RemoveTime.ToString("yyyy-MM-dd") == param.JoinTime.ToString("yyyy-MM-dd"))
//.WhereIf( param.JoinTime!=null, t => t.JoinTime.to ==param.JoinTime.ToString("yyyy-MM-dd"))
//.WhereIf(param.RemoveTime!=null, t => t.RemoveTime.ToString("yyyy-MM-dd") == param.JoinTime.ToString("yyyy-MM-dd"))
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName), t => t.User.OrganizationName.Contains(param.OrganizationName))
.WhereIf(!string.IsNullOrWhiteSpace(param.UserRealName), t => (t.User.LastName + " / " + t.User.FirstName).Contains(param.UserRealName))
.ProjectTo<TrialMaintenanceDTO>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(param.PageIndex,
param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "UpdateTime" : param.SortField, param.Asc);
return await query.ToPagedListAsync(param.PageIndex,param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "UpdateTime" : param.SortField, param.Asc);
}
@@ -61,9 +60,7 @@ namespace IRaCIS.Application.Services
return await query.ToPagedListAsync(param.PageIndex,
param.PageSize, string.IsNullOrWhiteSpace(param.SortField) ? "UpdateTime" : param.SortField, param.Asc);
}
@@ -84,16 +81,6 @@ namespace IRaCIS.Application.Services
return await query.ToPagedListAsync(trialUserQuery.PageIndex,
trialUserQuery.PageSize, string.IsNullOrWhiteSpace(trialUserQuery.SortField) ? "UserRealName" : trialUserQuery.SortField, trialUserQuery.Asc);
}
@@ -128,7 +115,7 @@ namespace IRaCIS.Application.Services
[HttpPut]
public async Task<IResponseOutput> UpdateTrialUser(UpdateTrialUserCommand updateTrialUserCommand)
{
var trialUser = await _trialUseRepository.AsQueryable().IgnoreQueryFilters().FirstOrDefaultAsync(t => t.Id == updateTrialUserCommand.Id);
var trialUser = await _trialUseRepository.Where(t => t.Id == updateTrialUserCommand.Id,true,true).FirstOrDefaultAsync();
if (trialUser == null) return Null404NotFound(trialUser);
@@ -26,6 +26,7 @@ namespace IRaCIS.Core.Application.Services
{
var siteStatQuery = _trialSiteRepository.Where(t => t.TrialId == param.TrialId, ignoreQueryFilters: true)
.WhereIf(param.IsDeleted!=null, t => t.IsDeleted==param.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.Site.SiteName.Contains(param.SiteName))
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName), t => t.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode), t => t.TrialSiteAliasName.Contains(param.TrialSiteCode))
@@ -48,6 +49,7 @@ namespace IRaCIS.Core.Application.Services
{
var siteStatQuery = _trialSiteRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.Site.SiteName.Contains(param.SiteName))
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName), t => t.TrialSiteAliasName.Contains(param.TrialSiteAliasName))
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode), t => t.TrialSiteAliasName.Contains(param.TrialSiteCode))
@@ -23,6 +23,12 @@ namespace IRaCIS.Core.Application.Service
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.SiteName))
.ForMember(x => x.Id, x => x.Ignore());
CreateMap<EditTrialSiteCommand, TrialSite>();
CreateMap<UpdateTrialUserCommand, TrialUser>();
CreateMap<AssginSiteCRCCommand, TrialUser>();
CreateMap<TrialUserAddCommand, TrialUser>();