HIR 用户 文档调整第二次变更
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
9f10af6654
commit
552a77ecd4
|
|
@ -102,275 +102,6 @@ namespace IRaCIS.Api.Controllers
|
|||
}
|
||||
|
||||
|
||||
|
||||
[HttpGet, Route("user/loginSelectUserType")]
|
||||
public async Task<IResponseOutput<LoginReturnDTO>> LoginSelectUserType(Guid userId, Guid userTypeId,
|
||||
[FromServices] IUserService _userService,
|
||||
[FromServices] IFusionCache _fusionCache,
|
||||
[FromServices] ITokenService _tokenService,
|
||||
[FromServices] IReadingImageTaskService readingImageTaskService,
|
||||
[FromServices] IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
|
||||
[FromServices] IOptionsMonitor<SystemEmailSendConfig> _emailConfig,
|
||||
|
||||
[FromServices] IMailVerificationService _mailVerificationService)
|
||||
{
|
||||
var emailConfig = _emailConfig.CurrentValue;
|
||||
var companyInfo = new SystemEmailSendConfigView() { CompanyName = emailConfig.CompanyName, CompanyNameCN = emailConfig.CompanyNameCN, CompanyShortName = emailConfig.CompanyShortName, CompanyShortNameCN = emailConfig.CompanyShortNameCN };
|
||||
|
||||
var returnModel = await _userService.LoginSelectUserType(userId, userTypeId);
|
||||
|
||||
if (returnModel.IsSuccess)
|
||||
{
|
||||
if (_verifyConfig.CurrentValue.OpenLoginMFA)
|
||||
{
|
||||
//MFA 发送邮件
|
||||
|
||||
returnModel.Data.IsMFA = true;
|
||||
|
||||
var email = returnModel.Data.BasicInfo.EMail;
|
||||
|
||||
var hiddenEmail = IRCEmailPasswordHelper.MaskEmail(email);
|
||||
|
||||
returnModel.Data.BasicInfo.EMail = hiddenEmail;
|
||||
|
||||
//修改密码
|
||||
if (returnModel.Data.BasicInfo.IsFirstAdd || returnModel.Data.BasicInfo.LoginState == 1)
|
||||
{
|
||||
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
||||
}
|
||||
else
|
||||
{
|
||||
//正常登录才发送邮件
|
||||
await _userService.SendMFAEmail(userId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
||||
|
||||
// 创建一个 CookieOptions 对象,用于设置 Cookie 的属性
|
||||
var option = new CookieOptions
|
||||
{
|
||||
Expires = DateTime.Now.AddMonths(1), // 设置过期时间为 30 分钟之后
|
||||
HttpOnly = false, // 确保 cookie 只能通过 HTTP 访问
|
||||
SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None, // 设置 SameSite 属性
|
||||
Secure = false // 确保 cookie 只能通过 HTTPS 访问
|
||||
};
|
||||
|
||||
HttpContext.Response.Cookies.Append("access_token", returnModel.Data.JWTStr, option);
|
||||
|
||||
|
||||
|
||||
// 验证阅片休息时间
|
||||
await readingImageTaskService.ResetReadingRestTime(returnModel.Data.BasicInfo.Id);
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(userId), returnModel.Data.JWTStr, TimeSpan.FromDays(7));
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(userId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
}
|
||||
}
|
||||
|
||||
returnModel.Data.CompanyInfo = companyInfo;
|
||||
|
||||
return returnModel;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary> 系统用户登录接口[New] </summary>
|
||||
[HttpPost, Route("user/login")]
|
||||
[AllowAnonymous]
|
||||
public async Task<IResponseOutput> Login(UserLoginDTO loginUser,
|
||||
[FromServices] IFusionCache _fusionCache,
|
||||
[FromServices] IUserService _userService,
|
||||
[FromServices] ITokenService _tokenService,
|
||||
[FromServices] IReadingImageTaskService readingImageTaskService,
|
||||
[FromServices] IOptionsMonitor<ServiceVerifyConfigOption> _verifyConfig,
|
||||
[FromServices] IOptionsMonitor<SystemEmailSendConfig> _emailConfig,
|
||||
|
||||
[FromServices] IMailVerificationService _mailVerificationService)
|
||||
{
|
||||
var emailConfig = _emailConfig.CurrentValue;
|
||||
var companyInfo = new SystemEmailSendConfigView() { CompanyName = emailConfig.CompanyName, CompanyNameCN = emailConfig.CompanyNameCN, CompanyShortName = emailConfig.CompanyShortName, CompanyShortNameCN = emailConfig.CompanyShortNameCN };
|
||||
|
||||
//MFA 邮箱验证 前端传递用户Id 和MFACode
|
||||
if (loginUser.UserId != null && _verifyConfig.CurrentValue.OpenLoginMFA)
|
||||
{
|
||||
Guid userId = (Guid)loginUser.UserId;
|
||||
|
||||
//验证MFA 编码是否有问题 ,前端要拆开,自己调用验证的逻辑
|
||||
//await _userService.VerifyMFACodeAsync(userId, loginUser.MFACode);
|
||||
|
||||
//var loginUser = await _userRoleRepository.Where(u => u.UserName.Equals(userName) && u.Password == password).ProjectTo<UserBasicInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync();
|
||||
|
||||
var basicInfo = await _userService.GetUserBasicInfo(userId, loginUser.Password);
|
||||
|
||||
var loginReturn = new LoginReturnDTO() { BasicInfo = basicInfo };
|
||||
|
||||
loginReturn.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(loginReturn.BasicInfo));
|
||||
|
||||
|
||||
// 创建一个 CookieOptions 对象,用于设置 Cookie 的属性
|
||||
var option = new CookieOptions
|
||||
{
|
||||
Expires = DateTime.Now.AddMonths(1), // 设置过期时间为 30 分钟之后
|
||||
HttpOnly = false, // 确保 cookie 只能通过 HTTP 访问
|
||||
SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None, // 设置 SameSite 属性
|
||||
Secure = false // 确保 cookie 只能通过 HTTPS 访问
|
||||
};
|
||||
|
||||
HttpContext.Response.Cookies.Append("access_token", loginReturn.JWTStr, option);
|
||||
|
||||
// 验证阅片休息时间
|
||||
await readingImageTaskService.ResetReadingRestTime(userId);
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(userId), loginReturn.JWTStr, TimeSpan.FromDays(7));
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(userId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
|
||||
loginReturn.CompanyInfo = companyInfo;
|
||||
return ResponseOutput.Ok(loginReturn);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var returnModel = await _userService.Login(loginUser.UserName, loginUser.Password);
|
||||
|
||||
if (returnModel.IsSuccess)
|
||||
{
|
||||
#region GRPC 调用鉴权中心,因为服务器IIS问题 http/2 故而没法使用
|
||||
|
||||
////重试策略
|
||||
//var defaultMethodConfig = new MethodConfig
|
||||
//{
|
||||
// Names = { MethodName.Default },
|
||||
// RetryPolicy = new RetryPolicy
|
||||
// {
|
||||
// MaxAttempts = 3,
|
||||
// InitialBackoff = TimeSpan.FromSeconds(1),
|
||||
// MaxBackoff = TimeSpan.FromSeconds(5),
|
||||
// BackoffMultiplier = 1.5,
|
||||
// RetryableStatusCodes = { Grpc.Core.StatusCode.Unavailable }
|
||||
// }
|
||||
//};
|
||||
|
||||
//#region unable to trust the certificate then the gRPC client can be configured to ignore the invalid certificate
|
||||
|
||||
//var httpHandler = new HttpClientHandler();
|
||||
//// Return `true` to allow certificates that are untrusted/invalid
|
||||
//httpHandler.ServerCertificateCustomValidationCallback =
|
||||
// HttpClientHandler.DangerousAcceptAnyServerCertificateValidator;
|
||||
|
||||
|
||||
//////这一句是让grpc支持本地 http 如果本地访问部署在服务器上,那么是访问不成功的
|
||||
//AppContext.SetSwitch(
|
||||
// "System.Net.Http.SocketsHttpHandler.Http2UnencryptedSupport", true);
|
||||
|
||||
//#endregion
|
||||
|
||||
|
||||
|
||||
//var grpcAdress = configuration.GetValue<string>("GrpcAddress");
|
||||
////var grpcAdress = "http://localhost:7200";
|
||||
|
||||
//var channel = GrpcChannel.ForAddress(grpcAdress, new GrpcChannelOptions
|
||||
//{
|
||||
// HttpHandler = httpHandler,
|
||||
// ServiceConfig = new ServiceConfig { MethodConfigs = { defaultMethodConfig } }
|
||||
|
||||
//});
|
||||
////var channel = GrpcChannel.ForAddress(grpcAdress);
|
||||
//var grpcClient = new TokenGrpcService.TokenGrpcServiceClient(channel);
|
||||
|
||||
//var userInfo = returnModel.Data.BasicInfo;
|
||||
|
||||
//var tokenResponse = grpcClient.GetUserToken(new GetTokenReuqest()
|
||||
//{
|
||||
// Id = userInfo.Id.ToString(),
|
||||
// ReviewerCode = userInfo.ReviewerCode,
|
||||
// IsAdmin = userInfo.IsAdmin,
|
||||
// RealName = userInfo.RealName,
|
||||
// UserTypeEnumInt = (int)userInfo.UserTypeEnum,
|
||||
// UserTypeShortName = userInfo.UserTypeShortName,
|
||||
// UserName = userInfo.UserName
|
||||
//});
|
||||
|
||||
//returnModel.Data.JWTStr = tokenResponse.Token;
|
||||
|
||||
#endregion
|
||||
|
||||
var userId = returnModel.Data.BasicInfo.Id;
|
||||
|
||||
if (_verifyConfig.CurrentValue.OpenLoginMFA)
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
//MFA 发送邮件
|
||||
|
||||
returnModel.Data.IsMFA = true;
|
||||
|
||||
var email = returnModel.Data.BasicInfo.EMail;
|
||||
|
||||
var hiddenEmail = IRCEmailPasswordHelper.MaskEmail(email);
|
||||
|
||||
returnModel.Data.BasicInfo.EMail = hiddenEmail;
|
||||
|
||||
//修改密码
|
||||
if (returnModel.Data.BasicInfo.IsFirstAdd || returnModel.Data.BasicInfo.LoginState == 1)
|
||||
{
|
||||
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
||||
}
|
||||
else
|
||||
{
|
||||
//正常登录才发送邮件
|
||||
await _userService.SendMFAEmail(userId);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
returnModel.Data.JWTStr = _tokenService.GetToken(IRaCISClaims.Create(returnModel.Data.BasicInfo));
|
||||
|
||||
// 创建一个 CookieOptions 对象,用于设置 Cookie 的属性
|
||||
var option = new CookieOptions
|
||||
{
|
||||
Expires = DateTime.Now.AddMonths(1), // 设置过期时间为 30 分钟之后
|
||||
HttpOnly = false, // 确保 cookie 只能通过 HTTP 访问
|
||||
SameSite = Microsoft.AspNetCore.Http.SameSiteMode.None, // 设置 SameSite 属性
|
||||
Secure = false // 确保 cookie 只能通过 HTTPS 访问
|
||||
};
|
||||
|
||||
HttpContext.Response.Cookies.Append("access_token", returnModel.Data.JWTStr, option);
|
||||
|
||||
|
||||
|
||||
// 验证阅片休息时间
|
||||
await readingImageTaskService.ResetReadingRestTime(returnModel.Data.BasicInfo.Id);
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(userId), returnModel.Data.JWTStr, TimeSpan.FromDays(7));
|
||||
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(userId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(_verifyConfig.CurrentValue.AutoLoginOutMinutes));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
returnModel.Data.CompanyInfo = companyInfo;
|
||||
return returnModel;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
[AllowAnonymous]
|
||||
[HttpGet, Route("user/getPublicKey")]
|
||||
public IResponseOutput GetPublicKey([FromServices] IOptionsMonitor<IRCEncreptOption> _IRCEncreptOption)
|
||||
|
|
@ -385,18 +116,13 @@ namespace IRaCIS.Api.Controllers
|
|||
[AllowAnonymous]
|
||||
public IResponseOutput ShareImage([FromServices] ITokenService _tokenService)
|
||||
{
|
||||
var token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo()
|
||||
var token = _tokenService.GetToken(new UserTokenInfo()
|
||||
{
|
||||
Id = Guid.Empty,
|
||||
IsReviewer = false,
|
||||
IsAdmin = false,
|
||||
RealName = "Share001",
|
||||
IdentityUserId = Guid.NewGuid(),
|
||||
UserName = "Share001",
|
||||
Sex = 0,
|
||||
//UserType = "ShareType",
|
||||
UserTypeEnum = UserTypeEnum.ShareImage,
|
||||
Code = "ShareCode001",
|
||||
}));
|
||||
|
||||
});
|
||||
return ResponseOutput.Ok("/showdicom?studyId=f7b67793-8155-0223-2f15-118f2642efb8&type=Share&token=" + token);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ namespace IRaCIS.Core.API.Controllers
|
|||
[ApiController, ApiExplorerSettings(GroupName = "Reviewer")]
|
||||
[UnitOfWork]
|
||||
public class InspectionController(
|
||||
ITrialDocumentService _trialDocumentService,
|
||||
IReadingImageTaskService _iReadingImageTaskService,
|
||||
ITrialConfigService _trialConfigService,
|
||||
IClinicalAnswerService _clinicalAnswerService,
|
||||
|
|
@ -497,21 +496,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户 签名某个文档
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost, Route("Inspection/TrialDocument/userConfirm")]
|
||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "SignSystemDocNoTrialId", "AfterStopCannNotOpt" )]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> UserConfirm(DataInspectionDto<UserConfirmCommand> opt)
|
||||
{
|
||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||
opt.Data.SignText = opt.SignInfo.SignText;
|
||||
var result = await _trialDocumentService.UserConfirm(opt.Data);
|
||||
await _inspectionService.CompletedSign(singid, result);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
|
|
@ -370,7 +370,7 @@ namespace IRaCIS.Core.API.Controllers
|
|||
//await _uploadHub.Clients.All.ReceivProgressAsync(archiveStudyCommand.StudyInstanceUid, receivedCount);
|
||||
|
||||
|
||||
await _uploadHub.Clients.User(_userInfo.Id.ToString()).ReceivProgressAsync(archiveStudyCommand.StudyInstanceUid, receivedCount);
|
||||
await _uploadHub.Clients.User(_userInfo.UserRoleId.ToString()).ReceivProgressAsync(archiveStudyCommand.StudyInstanceUid, receivedCount);
|
||||
|
||||
archiveResult.ReceivedFileCount = receivedCount;
|
||||
|
||||
|
|
@ -797,116 +797,6 @@ namespace IRaCIS.Core.API.Controllers
|
|||
_userInfo = userInfo;
|
||||
}
|
||||
|
||||
[HttpPost, Route("TrialSiteSurvey/UploadTrialSiteSurveyUser")]
|
||||
[DisableFormValueModelBinding]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> UploadTrialSiteSurveyUser(Guid trialId, string baseUrl, string routeUrl,
|
||||
[FromServices] IRepository<TrialSite> _trialSiteRepository,
|
||||
[FromServices] IRepository<UserType> _usertypeRepository,
|
||||
[FromServices] ITrialSiteSurveyService _trialSiteSurveyService,
|
||||
[FromServices] IOSSService oSSService,
|
||||
[FromServices] IRepository<InspectionFile> _inspectionFileRepository)
|
||||
{
|
||||
var templateFileStream = new MemoryStream();
|
||||
|
||||
|
||||
await FileUploadToOSSAsync(async (realFileName, fileStream) =>
|
||||
{
|
||||
await fileStream.CopyToAsync(templateFileStream);
|
||||
templateFileStream.Seek(0, SeekOrigin.Begin);
|
||||
|
||||
if (!realFileName.EndsWith(".xlsx", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// 请用提供格式的模板excel上传需要处理的数据
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_TemplateUploadData"]);
|
||||
}
|
||||
|
||||
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, "InspectionUpload/SiteSurvey", realFileName);
|
||||
|
||||
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = realFileName, RelativePath = ossRelativePath, TrialId = trialId });
|
||||
|
||||
|
||||
|
||||
return ossRelativePath;
|
||||
|
||||
});
|
||||
|
||||
//去掉空白行
|
||||
var excelList = MiniExcel.Query<SiteSurveyUserImportDto>(templateFileStream, excelType: ExcelType.XLSX).ToList()
|
||||
.Where(t => !(string.IsNullOrWhiteSpace(t.TrialSiteCode) && string.IsNullOrWhiteSpace(t.FirstName) && string.IsNullOrWhiteSpace(t.LastName) && string.IsNullOrWhiteSpace(t.Email)
|
||||
&& string.IsNullOrWhiteSpace(t.Phone) && string.IsNullOrWhiteSpace(t.UserTypeStr) && string.IsNullOrWhiteSpace(t.OrganizationName))).ToList();
|
||||
|
||||
if (excelList.Any(t => string.IsNullOrWhiteSpace(t.TrialSiteCode) || string.IsNullOrWhiteSpace(t.FirstName) || string.IsNullOrWhiteSpace(t.LastName) || string.IsNullOrWhiteSpace(t.Email) || string.IsNullOrWhiteSpace(t.UserTypeStr)))
|
||||
{
|
||||
//请确保Excel中 每一行的 中心编号,姓名,邮箱,用户类型数据记录完整再进行上传
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_EnsureCompleteData"]);
|
||||
}
|
||||
|
||||
var siteCodeList = excelList.Select(t => t.TrialSiteCode.Trim().ToUpper()).Distinct().ToList();
|
||||
|
||||
if (_trialSiteRepository.Where(t => t.TrialId == trialId && siteCodeList.Contains(t.TrialSiteCode.ToUpper())).Count() != siteCodeList.Count)
|
||||
{
|
||||
//在项目中未找到该Excel中部分或全部中心
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidCenters"]);
|
||||
}
|
||||
|
||||
if (excelList.GroupBy(t => new { t.TrialSiteCode, t.UserTypeStr, t.Email }).Any(g => g.Count() > 1))
|
||||
{
|
||||
// 同一邮箱,同一用户类型,只能生成一个账户,请核查Excel数据
|
||||
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_CheckDuplicateAccounts"]);
|
||||
}
|
||||
|
||||
if (excelList.Any(t => !t.Email.Contains("@")))
|
||||
{
|
||||
//有邮箱不符合邮箱格式,请核查Excel数据
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidEmail"]);
|
||||
}
|
||||
var generateUserTypeList = new List<string>() { "CRC", "CRA" };
|
||||
|
||||
//if (excelList.Any(t => !generateUserTypeList.Contains(t.UserTypeStr.ToUpper())))
|
||||
//{
|
||||
// //用户类型仅能为 CRC,SR,CRA 请核查Excel数据
|
||||
// throw new BusinessValidationFailedException(_localizer["UploadDownLoad_InvalidUserType"]);
|
||||
//}
|
||||
if (excelList.Count == 0)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["UploadDownLoad_NoValiddata"]);
|
||||
}
|
||||
//处理好 用户类型 和用户类型枚举
|
||||
var sysUserTypeList = _usertypeRepository.Where(t => t.UserTypeEnum == UserTypeEnum.CRA || t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { UserTypeId = t.Id, t.UserTypeEnum }).ToList();
|
||||
var siteList = _trialSiteRepository.Where(t => t.TrialId == trialId && siteCodeList.Contains(t.TrialSiteCode)).Select(t => new { t.TrialSiteCode, TrialSiteId = t.Id }).ToList();
|
||||
|
||||
foreach (var item in excelList)
|
||||
{
|
||||
switch (item.UserTypeStr.ToUpper())
|
||||
{
|
||||
case "CRC":
|
||||
|
||||
item.UserTypeId = sysUserTypeList.FirstOrDefault(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).UserTypeId;
|
||||
item.UserTypeEnum = UserTypeEnum.ClinicalResearchCoordinator;
|
||||
break;
|
||||
|
||||
case "CRA":
|
||||
item.UserTypeId = sysUserTypeList.FirstOrDefault(t => t.UserTypeEnum == UserTypeEnum.CRA).UserTypeId;
|
||||
item.UserTypeEnum = UserTypeEnum.CRA;
|
||||
break;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
item.TrialSiteId = siteList.FirstOrDefault(t => t.TrialSiteCode.ToUpper() == item.TrialSiteCode.ToUpper()).TrialSiteId;
|
||||
}
|
||||
|
||||
var list = excelList.Where(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator || t.UserTypeEnum == UserTypeEnum.CRA).ToList();
|
||||
|
||||
await _trialSiteSurveyService.ImportGenerateAccountAndJoinTrialAsync(trialId, baseUrl, routeUrl, list);
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary> 通用文件下载 </summary>
|
||||
|
|
|
|||
|
|
@ -34,9 +34,6 @@
|
|||
<param name="doctorId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.Login(IRaCIS.Application.Contracts.UserLoginDTO,ZiggyCreatures.Caching.Fusion.IFusionCache,IRaCIS.Core.Application.Service.IUserService,IRaCIS.Core.Application.Auth.ITokenService,IRaCIS.Core.Application.Contracts.IReadingImageTaskService,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig},IRaCIS.Core.Application.Service.IMailVerificationService)">
|
||||
<summary> 系统用户登录接口[New] </summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Api.Controllers.ExtraController.OAuthCallBack(System.String,System.String)">
|
||||
<summary>
|
||||
回调到前端,前端调用后端的接口
|
||||
|
|
@ -278,12 +275,6 @@
|
|||
<param name="opt"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.UserConfirm(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.Contracts.UserConfirmCommand})">
|
||||
<summary>
|
||||
用户 签名某个文档
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.API.Controllers.InspectionController.ConfirmReReading(IRaCIS.Core.Application.Service.Inspection.DTO.DataInspectionDto{IRaCIS.Core.Application.ViewModel.ConfirmReReadingCommand},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService)">
|
||||
<summary>
|
||||
重阅同意
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ namespace IRaCIS.Core.API
|
|||
{
|
||||
public virtual string GetUserId(HubConnectionContext connection)
|
||||
{
|
||||
return connection.User?.FindFirst(JwtIRaCISClaimType.Id)?.Value!;
|
||||
return connection.User?.FindFirst(JwtIRaCISClaimType.IdentityUserId)?.Value!;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ namespace IRaCIS.Core.API
|
|||
=>
|
||||
{
|
||||
|
||||
|
||||
opts.MessageTemplate = "{FullName} {UserType} {UserIp} {Host} {RequestMethod} {RequestPath} {RequestBody} responded {StatusCode} in {Elapsed:0.0000} ms";
|
||||
|
||||
opts.EnrichDiagnosticContext = (diagnosticContext, httpContext) =>
|
||||
|
|
@ -38,7 +39,7 @@ namespace IRaCIS.Core.API
|
|||
diagnosticContext.Set("QueryString", request.QueryString.Value);
|
||||
}
|
||||
|
||||
diagnosticContext.Set("FullName", httpContext?.User?.FindFirst(JwtIRaCISClaimType.RealName)?.Value);
|
||||
diagnosticContext.Set("FullName", httpContext?.User?.FindFirst(JwtIRaCISClaimType.FullName)?.Value);
|
||||
|
||||
diagnosticContext.Set("UserType", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,46 +0,0 @@
|
|||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Application.Auth
|
||||
{
|
||||
public class IRaCISClaims
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string FullName { get; set; } = String.Empty;
|
||||
public string Code { get; set; } = String.Empty;
|
||||
public string RealName { get; set; } = String.Empty;
|
||||
|
||||
public string UserTypeShortName { get; set; } = String.Empty;
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
public string PermissionStr { get; set; } = String.Empty;
|
||||
|
||||
public Guid UserTypeId { get; set; }
|
||||
|
||||
public int IsAdmin { get; }
|
||||
|
||||
public bool IsTestUser { get; set; }
|
||||
|
||||
public bool IsZhiZhun { get; set; }
|
||||
|
||||
public string Phone { get; set; } = String.Empty;
|
||||
|
||||
public static IRaCISClaims Create(UserBasicInfo user)
|
||||
{
|
||||
return new IRaCISClaims
|
||||
{
|
||||
Id = user.Id,
|
||||
FullName = user.UserName,
|
||||
RealName = user.RealName,
|
||||
UserTypeEnum = user.UserTypeEnum,
|
||||
UserTypeId = user.UserTypeId,
|
||||
IsTestUser = user.IsTestUser,
|
||||
Code = user.Code,
|
||||
PermissionStr = user.PermissionStr,
|
||||
IsZhiZhun = user.IsZhiZhun,
|
||||
UserTypeShortName = user.UserTypeShortName
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,42 +1,39 @@
|
|||
using Microsoft.IdentityModel.Tokens;
|
||||
using System.Text;
|
||||
|
||||
namespace IRaCIS.Core.Application.Auth
|
||||
public class JwtSetting
|
||||
{
|
||||
public class JwtSetting
|
||||
/// <summary>
|
||||
/// 颁发者
|
||||
/// </summary>
|
||||
public string Issuer { get; set; } = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 接收者
|
||||
/// </summary>
|
||||
public string Audience { get; set; } = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 令牌密码
|
||||
/// </summary>
|
||||
public string SecurityKey { get; set; } = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
public int TokenExpireMinute { get; set; }
|
||||
|
||||
//public Dictionary<string, object> Claims { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 签名
|
||||
/// </summary>
|
||||
public SigningCredentials Credentials
|
||||
{
|
||||
/// <summary>
|
||||
/// 颁发者
|
||||
/// </summary>
|
||||
public string Issuer { get; set; } = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 接收者
|
||||
/// </summary>
|
||||
public string Audience { get; set; } = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 令牌密码
|
||||
/// </summary>
|
||||
public string SecurityKey { get; set; } = String.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 过期时间
|
||||
/// </summary>
|
||||
public int TokenExpireDays { get; set; }
|
||||
|
||||
//public Dictionary<string, object> Claims { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 签名
|
||||
/// </summary>
|
||||
public SigningCredentials Credentials
|
||||
get
|
||||
{
|
||||
get
|
||||
{
|
||||
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(SecurityKey));
|
||||
return new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
|
||||
}
|
||||
var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(SecurityKey));
|
||||
return new SigningCredentials(key, SecurityAlgorithms.HmacSha256);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -8,7 +8,9 @@ namespace IRaCIS.Core.Application.Auth
|
|||
|
||||
public interface ITokenService
|
||||
{
|
||||
string GetToken(IRaCISClaims user);
|
||||
string GetToken(UserTokenInfo user);
|
||||
|
||||
bool IsTokenExpired(string token);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -21,16 +23,16 @@ namespace IRaCIS.Core.Application.Auth
|
|||
_jwtSetting = option.Value;
|
||||
}
|
||||
|
||||
public string GetToken(IRaCISClaims user)
|
||||
public string GetToken(UserTokenInfo user)
|
||||
{
|
||||
//创建用户身份标识,可按需要添加更多信息
|
||||
var claims = new Claim[]
|
||||
{
|
||||
new Claim(Microsoft.IdentityModel.JsonWebTokens.JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()),
|
||||
new Claim(JwtIRaCISClaimType.Id, user.Id.ToString()),
|
||||
new Claim(JwtIRaCISClaimType.Name, user.FullName),
|
||||
new Claim(JwtIRaCISClaimType.RealName, user.RealName),
|
||||
new Claim(JwtIRaCISClaimType.Code,user.Code),
|
||||
new Claim(JwtIRaCISClaimType.IdentityUserId, user.IdentityUserId.ToString()),
|
||||
new Claim(JwtIRaCISClaimType.UserRoleId, user.UserRoleId.ToString()),
|
||||
new Claim(JwtIRaCISClaimType.UserName, user.UserName),
|
||||
new Claim(JwtIRaCISClaimType.FullName, user.FullName),
|
||||
new Claim(JwtIRaCISClaimType.UserTypeId,user.UserTypeId.ToString()),
|
||||
new Claim(JwtIRaCISClaimType.UserTypeEnum,user.UserTypeEnum.ToString()),
|
||||
new Claim(JwtIRaCISClaimType.UserTypeEnumInt,((int)user.UserTypeEnum).ToString()),
|
||||
|
|
@ -47,13 +49,27 @@ namespace IRaCIS.Core.Application.Auth
|
|||
signingCredentials: _jwtSetting.Credentials,
|
||||
claims: claims,
|
||||
notBefore: DateTime.Now,
|
||||
expires: DateTime.Now.AddDays(_jwtSetting.TokenExpireDays)
|
||||
expires: DateTime.Now.AddMinutes(_jwtSetting.TokenExpireMinute)
|
||||
);
|
||||
|
||||
string jwtToken = new JwtSecurityTokenHandler().WriteToken(token);
|
||||
return jwtToken;
|
||||
|
||||
}
|
||||
|
||||
public bool IsTokenExpired(string token)
|
||||
{
|
||||
var handler = new JwtSecurityTokenHandler();
|
||||
try
|
||||
{
|
||||
var jwtToken = handler.ReadJwtToken(token);
|
||||
return jwtToken.ValidTo < DateTime.UtcNow;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return true; // 无效 Token 也视为已过期
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Application.Auth
|
||||
{
|
||||
public class UserTokenInfo
|
||||
{
|
||||
public Guid IdentityUserId { get; set; }
|
||||
|
||||
public Guid UserRoleId { get; set; }
|
||||
|
||||
public Guid UserTypeId { get; set; }
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
|
||||
public string PermissionStr { get; set; } = string.Empty;
|
||||
|
||||
public bool IsTestUser { get; set; }
|
||||
|
||||
public bool IsZhiZhun { get; set; }
|
||||
|
||||
public string UserTypeShortName { get; set; } = string.Empty;
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ public class LimitUserRequestAuthorization(
|
|||
|
||||
|
||||
//2、在这里取缓存 进行比较 看是否有其他人进行了登陆,如果其他人登陆了,就把之前用户挤掉
|
||||
var cacheUserToken = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserToken(_userInfo.Id));
|
||||
var cacheUserToken = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserToken(_userInfo.UserRoleId));
|
||||
|
||||
|
||||
|
||||
|
|
@ -58,17 +58,17 @@ public class LimitUserRequestAuthorization(
|
|||
cacheUserToken = _userInfo.UserToken;
|
||||
|
||||
//设置当前用户最新Token
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(_userInfo.Id), _userInfo.UserToken, TimeSpan.FromDays(7));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(_userInfo.UserRoleId), _userInfo.UserToken, TimeSpan.FromDays(7));
|
||||
|
||||
//重启应用程序,所有人续期,不一下子踢出所有人
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.UserRoleId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
|
||||
}
|
||||
//是同一个人
|
||||
else if (cacheUserToken == _userInfo.UserToken)
|
||||
{
|
||||
|
||||
var cacheTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserAutoLoginOut(_userInfo.Id));
|
||||
var cacheTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserAutoLoginOut(_userInfo.UserRoleId));
|
||||
|
||||
//过期了 需要自动退出
|
||||
if (string.IsNullOrEmpty(cacheTime))
|
||||
|
|
@ -80,7 +80,7 @@ public class LimitUserRequestAuthorization(
|
|||
}
|
||||
else
|
||||
{
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.UserRoleId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -41,19 +41,19 @@ public class LimitUserRequestAuthorizationEndpointFilter(
|
|||
}
|
||||
|
||||
// 获取缓存中的用户 token
|
||||
var cacheUserToken = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserToken(_userInfo.Id));
|
||||
var cacheUserToken = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserToken(_userInfo.UserRoleId));
|
||||
|
||||
// 缓存中没有取到 token
|
||||
if (string.IsNullOrWhiteSpace(cacheUserToken))
|
||||
{
|
||||
// 设置当前用户最新 token
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(_userInfo.Id), _userInfo.UserToken, TimeSpan.FromDays(7));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserToken(_userInfo.UserRoleId), _userInfo.UserToken, TimeSpan.FromDays(7));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.UserRoleId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
}
|
||||
// 如果是同一个用户
|
||||
else if (cacheUserToken == _userInfo.UserToken)
|
||||
{
|
||||
var cacheTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserAutoLoginOut(_userInfo.Id));
|
||||
var cacheTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.UserAutoLoginOut(_userInfo.UserRoleId));
|
||||
|
||||
// 如果过期,自动登出
|
||||
if (string.IsNullOrEmpty(cacheTime))
|
||||
|
|
@ -63,7 +63,7 @@ public class LimitUserRequestAuthorizationEndpointFilter(
|
|||
}
|
||||
else
|
||||
{
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
await _fusionCache.SetAsync(CacheKeys.UserAutoLoginOut(_userInfo.UserRoleId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromMinutes(minutes));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -58,6 +58,8 @@ public class SystemEmailSendConfig
|
|||
|
||||
public string SiteUrl { get; set; } = string.Empty;
|
||||
|
||||
public string SystemShortName { get; set; } = string.Empty;
|
||||
|
||||
public string OrganizationName { get; set; } = string.Empty;
|
||||
public string OrganizationNameCN { get; set; } = string.Empty;
|
||||
|
||||
|
|
@ -73,11 +75,14 @@ public class SystemEmailSendConfig
|
|||
|
||||
public bool IsOpenErrorNoticeEmail { get; set; }
|
||||
|
||||
public string EmailRegexStr { get; set; }
|
||||
|
||||
public List<string> ErrorNoticeEmailList { get; set; } = new List<string>();
|
||||
}
|
||||
|
||||
public class SystemEmailSendConfigView
|
||||
{
|
||||
public string SystemShortName { get; set; } = string.Empty;
|
||||
public string CompanyName { get; set; } = string.Empty;
|
||||
|
||||
public string CompanyNameCN { get; set; } = string.Empty;
|
||||
|
|
@ -85,6 +90,8 @@ public class SystemEmailSendConfigView
|
|||
public string CompanyShortName { get; set; } = string.Empty;
|
||||
|
||||
public string CompanyShortNameCN { get; set; } = string.Empty;
|
||||
|
||||
public string EmailRegexStr { get; set; }
|
||||
}
|
||||
|
||||
public class SystemPacsConfig
|
||||
|
|
@ -147,7 +154,7 @@ public static class AppSettings
|
|||
case nameof(Doctor):
|
||||
return IRaCISBasicConfig.DoctorCodePrefix + codeInt.ToString("D4");
|
||||
|
||||
case nameof(UserRole):
|
||||
case nameof(IdentityUser):
|
||||
return IRaCISBasicConfig.UserCodePrefix + codeInt.ToString("D4");
|
||||
|
||||
case nameof(QCChallenge):
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper;
|
||||
|
||||
|
|
@ -30,6 +29,11 @@ public static class CacheKeys
|
|||
//超时没请求接口自动退出
|
||||
public static string UserAutoLoginOut(Guid userId) => $"UserAutoLoginOut:{userId}";
|
||||
|
||||
|
||||
public static string UserDisable(Guid userId) => $"UserDisable:{userId}";
|
||||
|
||||
public static string UserRoleDisable(Guid userRoleId) => $"UserRoleDisable:{userRoleId}";
|
||||
|
||||
/// <summary>
|
||||
/// 用户登录错误 限制登录
|
||||
/// </summary>
|
||||
|
|
@ -60,6 +64,7 @@ public static class CacheKeys
|
|||
public static string StartRestTime(Guid userId) => $"{userId}StartRestTime";
|
||||
|
||||
|
||||
|
||||
public static string CmoveStudyId(string studyIdStr) => $"CmoveStudyId:{studyIdStr}";
|
||||
|
||||
public static string Hospital => $"Hospital";
|
||||
|
|
@ -83,9 +88,9 @@ public static class CacheHelper
|
|||
return list;
|
||||
}
|
||||
|
||||
public static async Task<HIRHospital?> GetHospitalCode(IRepository<HIRHospital> _hirHospitalRepository)
|
||||
public static async Task<HIRHospital> GetHospitalCode(IRepository<HIRHospital> _hirHospitalRepository)
|
||||
{
|
||||
return await _hirHospitalRepository.Where(t => t.IsDefault == true).FirstOrDefaultAsync();
|
||||
return await _hirHospitalRepository.Where(t => t.IsDefault == true).FirstNotNullAsync();
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,42 @@
|
|||
using IRaCIS.Core.Domain.Models;
|
||||
using MaxMind.GeoIP2;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Application.Helper
|
||||
{
|
||||
public static class IPCityHelper
|
||||
{
|
||||
|
||||
public static string GetCityResponse(string ip)
|
||||
{
|
||||
var path = Path.Combine(AppContext.BaseDirectory, StaticData.Folder.Resources, "GeoLite2-City.mmdb");
|
||||
|
||||
try
|
||||
{
|
||||
using (var reader = new DatabaseReader(path))
|
||||
{
|
||||
|
||||
var city = reader.City(ip);
|
||||
|
||||
//Console.WriteLine(city.Country.IsoCode); // 'US' 'CN'
|
||||
//Console.WriteLine(city.Country.Name); // 'United States' 'China'
|
||||
////Console.WriteLine(city.Country.Names["zh-CN"]); // '美国'
|
||||
//Console.WriteLine(city.MostSpecificSubdivision.Name); // 'Minnesota' 'Hubei'
|
||||
//Console.WriteLine(city.City.Name); // 'Minneapolis' 'WUHan'
|
||||
|
||||
return $"{city.Country.Name} | {city.MostSpecificSubdivision.Name} | {city.City.Name}";
|
||||
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
||||
return $"UN | UN | {ip}";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -32,6 +32,7 @@
|
|||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="MaxMind.GeoIP2" Version="5.3.0" />
|
||||
<PackageReference Include="IdentityModel.OidcClient" Version="6.0.0" />
|
||||
<PackageReference Include="AlibabaCloud.SDK.Sts20150401" Version="1.1.4" />
|
||||
<PackageReference Include="AWSSDK.SecurityToken" Version="3.7.400.36" />
|
||||
|
|
|
|||
|
|
@ -4,31 +4,6 @@
|
|||
<name>IRaCIS.Core.Application</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="P:IRaCIS.Core.Application.Auth.JwtSetting.Issuer">
|
||||
<summary>
|
||||
颁发者
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Auth.JwtSetting.Audience">
|
||||
<summary>
|
||||
接收者
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Auth.JwtSetting.SecurityKey">
|
||||
<summary>
|
||||
令牌密码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Auth.JwtSetting.TokenExpireDays">
|
||||
<summary>
|
||||
过期时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Auth.JwtSetting.Credentials">
|
||||
<summary>
|
||||
签名
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.BusinessFilter.UnifiedApiResultFilter">
|
||||
<summary>
|
||||
统一返回前端数据包装,之前在控制器包装,现在修改为动态Api 在ResultFilter这里包装,减少重复冗余代码
|
||||
|
|
@ -724,19 +699,6 @@
|
|||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.TrialSiteUserSummaryListExport(IRaCIS.Core.Application.Contracts.TrialSiteUserSurveyExportQueryDto,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteUserSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Application.Interfaces.IDictionaryService)">
|
||||
<summary>
|
||||
Site用户汇总表导出
|
||||
</summary>
|
||||
<param name="queryParam"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_trialSiteSurveyRepository"></param>
|
||||
<param name="_trialSiteUserSurveyRepository"></param>
|
||||
<param name="_trialRepository"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:System.Exception"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetTrialList_Export(IRaCIS.Core.Application.Contracts.TrialToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
项目列表导出---new
|
||||
|
|
@ -747,17 +709,6 @@
|
|||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.PMTrainingRecordList_Export(IRaCIS.Core.Application.Contracts.DocumentTrialUnionQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
getDocumentConfirmList 培训记录导出--new
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<param name="_subjectVisitRepository"></param>
|
||||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.CRCVisitList_Export(IRaCIS.Core.Application.Contracts.CRCVisitSearchDTO,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
影像上传列表 只导出已上传状态的访视记录
|
||||
|
|
@ -1321,95 +1272,6 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService">
|
||||
<summary>
|
||||
TrialEmailNoticeConfigService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeConfig},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailBlackUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.EmailNoticeConfig},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskMedicalReview},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialEmailNoticeUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig},IRaCIS.Core.Application.Service.IEmailSendService,AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer,Microsoft.AspNetCore.Hosting.IWebHostEnvironment)">
|
||||
<summary>
|
||||
TrialEmailNoticeConfigService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.GetTrialEmail(IRaCIS.Core.Application.ViewModel.GetTrialEmailSetInDto)">
|
||||
<summary>
|
||||
获取项目邮箱
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.SetTrialEmail(IRaCIS.Core.Application.ViewModel.SetTrialEmailInDto)">
|
||||
<summary>
|
||||
设置项目邮箱
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.BaseBusinessScenarioSendEmailAsync(System.Guid,System.Nullable{System.Boolean},IRaCIS.Core.Domain.Share.Common.EmailStoreSendMode,System.String)">
|
||||
<summary>
|
||||
测试邮件 带附件 填充word
|
||||
</summary>
|
||||
<param name="visitTaskId"></param>
|
||||
<param name="isHandSend"> 为空 代表 正常任务自动发送,为true 代表医学审核手动发送 为false 代表医学审核自动发送 </param>
|
||||
<param name="emailStoreMode"></param>
|
||||
<param name="sendFileRelativePath"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.ManualGenerateEmailFile(IRaCIS.Core.Application.ViewModel.GenerateEmailCommand)">
|
||||
<summary>
|
||||
手动生成入组确认 或者PD 进展的邮件 如果能发送,会返回文件的路径,否则会给出提示
|
||||
</summary>
|
||||
<param name="generateEmailCommand"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.ManualSendEmail(System.Guid,System.String)">
|
||||
<summary>
|
||||
手动发送邮件
|
||||
</summary>
|
||||
<param name="visitTaskId"></param>
|
||||
<param name="sendFileRelativePath"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.TranslatePdStateAsync(System.Guid,IRaCIS.Core.Domain.Share.ReadingCategory,IRaCIS.Core.Domain.Share.CriterionType,System.Nullable{System.Boolean})">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="visitTaskId"> 任务Id</param>
|
||||
<param name="readingCategory"> 任务类型</param>
|
||||
<param name="criterionType">标准类型</param>
|
||||
<param name="IsGlobalGenerate"> 是否是全局产生(区分裁判任务)</param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.GetTrialUserTypeSelectList(System.Guid)">
|
||||
<summary>
|
||||
选择人员下拉
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.GetTrialUserIdSelectList(System.Guid)">
|
||||
<summary>
|
||||
黑名单用户Id 列表
|
||||
</summary>
|
||||
<param name="trialEmailNoticeConfigId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.GetSysEmailNoticeConfigList(IRaCIS.Core.Application.Contracts.EmailNoticeConfigQuery)">
|
||||
<summary>
|
||||
获取系统 邮件配置 勾选列表
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialEmailNoticeConfigService.BatchAddSysEmailConfig(System.Collections.Generic.List{IRaCIS.Core.Application.ViewModel.BatchAddTrialEmailNoticeConfig})">
|
||||
<summary>
|
||||
批量勾选 传递列表每行数据,后台进行处理转换,建立关联关系
|
||||
</summary>
|
||||
<param name="batchAddList"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.CalculateService.GetFinalConfirmedWorkloadAndPayPriceList(IRaCIS.Application.Contracts.CalculateDoctorAndMonthDTO)">
|
||||
<summary>
|
||||
获取某个月下的某些医生最终确认的工作量,用于计算月度费用
|
||||
|
|
@ -1837,11 +1699,6 @@
|
|||
</summary>
|
||||
<typeparam name="T">泛型</typeparam>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Service.Inspection.DTO.TrialDocumentConfirmDTO">
|
||||
<summary>
|
||||
用户 签名某个文档 Dto
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Service.Inspection.DTO.GetDataInspectionOutDto.ParentIdentification">
|
||||
<summary>
|
||||
父标识
|
||||
|
|
@ -2207,7 +2064,7 @@
|
|||
<summary>
|
||||
重置密码为 默认密码
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<param name="identityUserId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.AnonymousSendVerificationCode(System.String)">
|
||||
|
|
@ -2221,7 +2078,7 @@
|
|||
<summary>
|
||||
(未登陆) 设置新密码
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<param name="identityUserId"></param>
|
||||
<param name="newPwd"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
|
|
@ -2236,7 +2093,7 @@
|
|||
<summary>
|
||||
根据用户Id获取用户详细信息[New]
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<param name="identityUserId"></param>
|
||||
<returns></returns>xiuga
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.AddUser(IRaCIS.Application.Contracts.UserCommand)">
|
||||
|
|
@ -2253,38 +2110,6 @@
|
|||
<param name="model"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.DeleteUser(System.Guid)">
|
||||
<summary>
|
||||
删除用户
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.UpdateUserState(System.Guid,IRaCIS.Core.Domain.Share.UserStateEnum)">
|
||||
<summary>
|
||||
禁用或者启用账户
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<param name="state"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.SendMFAEmail(System.Guid,System.Int32)">
|
||||
<summary>
|
||||
发送MFA 验证邮件
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<param name="mfaType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.VerifyMFACodeAsync(System.Guid,System.String)">
|
||||
<summary>
|
||||
验证MFA 邮件
|
||||
</summary>
|
||||
<param name="userId"></param>
|
||||
<param name="Code"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.TJUserLoginInfo(System.String,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.HIRHospital})">
|
||||
<summary>
|
||||
同济生成账号
|
||||
|
|
@ -2294,14 +2119,6 @@
|
|||
<param name="_hirHospitalRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.Login(System.String,System.String)">
|
||||
<summary>
|
||||
用户登陆
|
||||
</summary>
|
||||
<param name="userName"></param>
|
||||
<param name="password"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.VerifyAnonymousVerifyCode(System.String,System.String)">
|
||||
<summary>
|
||||
验证验证码,没问题就返回用户所有的账户
|
||||
|
|
@ -2317,6 +2134,22 @@
|
|||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.GetUserLoginRoleList(IRaCIS.Core.Application.ViewModel.IRCLoginDto,IRaCIS.Core.Application.Auth.ITokenService,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig})">
|
||||
<summary>
|
||||
账号验证,获取账号角色信息 获取临时token
|
||||
</summary>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.UserService.LoginSelectUserRole(System.Guid,IRaCIS.Core.Application.Auth.ITokenService,IRaCIS.Core.Application.Contracts.IReadingImageTaskService)">
|
||||
<summary>
|
||||
验证密码成功后,选定角色,然后获取当前角色的Token
|
||||
</summary>
|
||||
<param name="userRoleId"></param>
|
||||
<param name="_tokenService"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.CodeTemplateService.GetDataBaseTableList(System.String,System.String)">
|
||||
<summary>
|
||||
获取数据库的表信息 以及字段信息
|
||||
|
|
@ -12790,7 +12623,7 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService,IRaCIS.Core.Application.Service.IReadingCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskRelation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCustomTag},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTrialCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Application.Service.IGeneralCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskStudy},IRaCIS.Core.Application.Service.ImageAndDoc.IDownloadAndUploadService,IRaCIS.Core.Application.Interfaces.ITrialEmailNoticeConfigService,AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer,ZiggyCreatures.Caching.Fusion.IFusionCache)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudy},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingOncologyTaskInfo},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Application.Service.IVisitTaskService,IRaCIS.Core.Application.Contracts.IReadingClinicalDataService,IRaCIS.Core.Application.Service.IReadingCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.ServiceVerifyConfigOption},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingGlobalTaskInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCriterionPage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskRelation},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingJudgeInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.OrganInfo},IRaCIS.Core.Application.Service.ReadingCalculate.Interface.ILuganoCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingCustomTag},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionMark},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTrialCriterionDictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableAnswerRowInfo},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTableQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingTaskQuestionAnswer},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionSystem},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Application.Service.IGeneralCalculateService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskStudy},IRaCIS.Core.Application.Service.ImageAndDoc.IDownloadAndUploadService,IRaCIS.Core.Application.Interfaces.ITrialEmailNoticeConfigService,AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer,ZiggyCreatures.Caching.Fusion.IFusionCache)">
|
||||
<summary>
|
||||
IR影像阅片
|
||||
</summary>
|
||||
|
|
@ -12858,13 +12691,6 @@
|
|||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.GetManualList(IRaCIS.Core.Application.Service.Reading.Dto.GetManualListInDto)">
|
||||
<summary>
|
||||
获取手册
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingImageTaskService.GetTaskAdditionalQuestion(IRaCIS.Core.Application.Service.Reading.Dto.GetTaskAdditionalQuestionInDto)">
|
||||
<summary>
|
||||
获取任务附加问题
|
||||
|
|
@ -13648,13 +13474,6 @@
|
|||
项目外部人员 录入流程相关
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialExternalUserService.AddOrUpdateTrialExternalUser(IRaCIS.Core.Application.ViewModel.TrialExternalUserAddAndSendEmail)">
|
||||
<summary>
|
||||
添加和更新接口 已验证邮箱和账户类型不允许添加重复项
|
||||
</summary>
|
||||
<param name="addOrEditTrialExternalUser"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialMaintenanceService.GetMaintenanceUserList(IRaCIS.Application.Contracts.TrialMaintenanceQuery)">
|
||||
<summary>
|
||||
Setting页面 获取项目参与人员列表
|
||||
|
|
@ -13868,11 +13687,6 @@
|
|||
入组流程-CRO确定医生名单 [ Approve]
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.EnrollService.ConfirmReviewer(IRaCIS.Core.Application.Service.WorkLoad.DTO.ConfirmReviewerCommand,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TaskAllocationRule})">
|
||||
<summary>
|
||||
入组流程-后台确认医生入组[Confirm]
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.EnrollService.EnrollBackOrOut(System.Guid,System.Guid,System.Int32,System.Nullable{System.DateTime})">
|
||||
<summary>
|
||||
optType 0表示入组,列表没这条数据了, 1表示出组,需要填写出组时间 废弃
|
||||
|
|
@ -13893,7 +13707,7 @@
|
|||
<param name="_readingConsistentClinicalDataRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TestService.OldTrialDeleteUser(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Management.TrialIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole})">
|
||||
<member name="M:IRaCIS.Core.Application.Service.TestService.OldTrialDeleteUser(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole})">
|
||||
<summary>
|
||||
项目退出历史数据维护
|
||||
</summary>
|
||||
|
|
@ -13901,13 +13715,13 @@
|
|||
<param name="_trialUserRoleReposiotry"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TestService.UserMutiAccount(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Management.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserPassWordLog})">
|
||||
<member name="M:IRaCIS.Core.Application.Service.TestService.UserMutiAccount(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserPassWordLog})">
|
||||
<summary>
|
||||
用户多账号,初次维护数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TestService.UserTrialUser(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Management.TrialIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole})">
|
||||
<member name="M:IRaCIS.Core.Application.Service.TestService.UserTrialUser(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole})">
|
||||
<summary>
|
||||
项目用户 维护数据
|
||||
</summary>
|
||||
|
|
@ -15730,15 +15544,6 @@
|
|||
ISystemBasicDataService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.SystemDocumentView">
|
||||
<summary> SystemDocumentView 列表视图模型 </summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.SystemDocumentQuery">
|
||||
<summary>SystemDocumentQuery 列表查询参数模型</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.SystemDocumentAddOrEdit">
|
||||
<summary> SystemDocumentAddOrEdit 列表查询参数模型</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialDocumentUserConfirmView">
|
||||
<summary> TrialDocumentUserConfirmView 列表视图模型 </summary>
|
||||
</member>
|
||||
|
|
@ -15751,11 +15556,6 @@
|
|||
<member name="T:IRaCIS.Core.Application.Contracts.TrialDocumentAddOrEdit">
|
||||
<summary> TrialDocumentAddOrEdit 列表查询参数模型</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.ISystemDocumentService">
|
||||
<summary>
|
||||
ISystemDocumentService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.NoneDicomStudyService">
|
||||
<summary>
|
||||
NoneDicomStudyService
|
||||
|
|
@ -16170,157 +15970,6 @@
|
|||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteEquipmentSurveyView">
|
||||
<summary> TrialSiteEquipmentSurveyView 列表视图模型 </summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteEquipmentSurveyQuery">
|
||||
<summary>TrialSiteEquipmentSurveyQuery 列表查询参数模型</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteEquipmentSurveyAddOrEdit">
|
||||
<summary> TrialSiteEquipmentSurveyAddOrEdit 列表查询参数模型</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteSurveyView">
|
||||
<summary> TrialSiteSurveyView 列表视图模型 </summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteSurveyQuery">
|
||||
<summary>TrialSiteSurveyQuery 列表查询参数模型</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.UseUserIDGetDoctorIDOutDto">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteSurveyAddOrEdit">
|
||||
<summary> TrialSiteSurveyAddOrEdit 列表查询参数模型</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteUserSurveyView">
|
||||
<summary> TrialSiteUserSurveyView 列表视图模型 </summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteUserSurveyQuery">
|
||||
<summary>TrialSiteUserSurveyQuery 列表查询参数模型</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteUserSurveyAddOrEdit">
|
||||
<summary> TrialSiteUserSurveyAddOrEdit 列表查询参数模型</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteEquipmentSurveyService">
|
||||
<summary>
|
||||
TrialSiteEquipmentSurveyService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteEquipmentSurveyService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteEquipmentSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteSurvey},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
TrialSiteEquipmentSurveyService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService">
|
||||
<summary>
|
||||
TrialSiteSurveyService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteUserSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSite},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Doctor},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VerificationCode},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteUser},Medallion.Threading.IDistributedLockProvider,IRaCIS.Core.Application.Auth.ITokenService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserType},IRaCIS.Core.Application.Service.IMailVerificationService,Microsoft.Extensions.Options.IOptionsMonitor{IRaCIS.Core.Domain.Share.SystemEmailSendConfig},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
TrialSiteSurveyService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.SendEmialVerifyCode(IRaCIS.Core.Application.Contracts.SendEmialVerifyCodeInDto)">
|
||||
<summary>
|
||||
发送验证码
|
||||
</summary>
|
||||
<param name="userInfo"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.UseUserIDGetDoctorID(IRaCIS.Core.Application.Contracts.UseUserIDGetDoctorIDInDto)">
|
||||
<summary>
|
||||
通过UserId获取Doctorid
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.VerifyEmialGetDoctorInfo(IRaCIS.Core.Application.Contracts.VerifyEmialGetDoctorInfoInDto)">
|
||||
<summary>
|
||||
验证邮箱验证码 获取医生信息Id
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.SendVerifyCode(IRaCIS.Core.Application.Contracts.SiteSurveySendVerifyCode)">
|
||||
<summary>
|
||||
site 调研 发送验证码
|
||||
</summary>
|
||||
<param name="userInfo"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.VerifySendCode(IRaCIS.Core.Application.Contracts.LoginDto,IRaCIS.Core.Application.Auth.ITokenService)">
|
||||
<summary>
|
||||
验证后 如果数据库该项目不存在该邮箱 那么就插入记录 存在
|
||||
</summary>
|
||||
<param name="userInfo"></param>
|
||||
<param name="_tokenService"></param>
|
||||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.GetSiteSurveyInfo(System.Guid,System.Guid)">
|
||||
<summary>
|
||||
直接查询相关所有数据
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.AddOrUpdateTrialSiteSurvey(IRaCIS.Core.Application.Contracts.TrialSiteSurveyAddOrEdit)">
|
||||
<summary>
|
||||
实际这里只会是更新 添加在login的时候做了
|
||||
</summary>
|
||||
<param name="addOrEditTrialSiteSurvey"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.DeleteTrialSiteSurvey(System.Guid)">
|
||||
<summary>
|
||||
删除调研表
|
||||
</summary>
|
||||
<param name="trialSiteSurveyId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.GetTrialSiteSurveyList(IRaCIS.Core.Application.Contracts.TrialSiteSurveyQueryDTO)">
|
||||
<summary>
|
||||
获取 项目 site的调研记录 New
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.TrialSiteSurveyUserList(IRaCIS.Core.Application.Contracts.TrialSiteUserSurveyAllQuery)">
|
||||
<summary>
|
||||
项目Site调研用户列表 所有site的调研用户 最新的调研表的记录的用户 new
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.GetTrialSurveyInitInfo(System.Guid)">
|
||||
<summary>
|
||||
初始登陆界面 项目基本信息+下拉框数据
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.SubmissionRejection(IRaCIS.Core.Application.Contracts.TrialSiteSubmitBackCommand,IRaCIS.Core.Application.Service.IMailVerificationService)">
|
||||
<summary>
|
||||
驳回 New
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteSurveyService.TrialSurveySubmit(IRaCIS.Core.Application.Contracts.TrialSiteSurvyeSubmitDTO)">
|
||||
<summary>
|
||||
提交 后台自动识别是谁提交
|
||||
</summary>
|
||||
<param name="siteSurvyeSubmit"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Contracts.TrialSiteUserSurveyService">
|
||||
<summary>
|
||||
TrialSiteUserSurveyService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Contracts.TrialSiteUserSurveyService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteUserSurvey},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialSiteSurvey},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
TrialSiteUserSurveyService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Core.Application.Contracts.BasicTrialConfig.SubjectCodeRule">
|
||||
<summary>
|
||||
受试者编号具体规则
|
||||
|
|
@ -16832,125 +16481,6 @@
|
|||
<param name="searchArray"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Services.SystemDocumentService">
|
||||
<summary>
|
||||
SystemDocumentService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedUser},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
SystemDocumentService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.GetSystemDocumentListAsync(IRaCIS.Core.Application.Contracts.SystemDocumentQuery)">
|
||||
<summary>
|
||||
管理端列表
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.SystemDocumentService.getWaitSignSysDocList(IRaCIS.Core.Application.Contracts.SystemDocumentQuery)">
|
||||
<summary>
|
||||
获取需要签署的系统文档列表
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Services.TrialDocumentService">
|
||||
<summary>
|
||||
TrialDocumentService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocConfirmedUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Contracts.ISystemDocumentService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocConfirmedUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocNeedConfirmedUserType},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SystemDocument},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialDocConfirmedUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
TrialDocumentService
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialDocumentList(IRaCIS.Core.Application.Contracts.TrialDocumentQuery)">
|
||||
<summary>
|
||||
Setting 界面的 项目所有文档列表
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetNextUnSignDocument(IRaCIS.Core.Application.Contracts.GetNextUnSignDocumentInDto)">
|
||||
<summary>
|
||||
获取下一个未签名的文件
|
||||
</summary>
|
||||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetUserDocumentList(IRaCIS.Core.Application.Contracts.TrialUserDocUnionQuery)">
|
||||
<summary>
|
||||
具体用户看到的 系统文件列表 + 项目类型文档
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetDocumentConfirmList(IRaCIS.Core.Application.Contracts.DocumentTrialUnionQuery)">
|
||||
<summary>
|
||||
获取确认列表情况 项目文档+系统文档+具体的人
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialUserSelect(System.Guid)">
|
||||
<summary>
|
||||
项目下面的参与用户下拉
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialDocAndSystemDocType(System.Guid)">
|
||||
<summary>
|
||||
项目+系统的文档类型 下拉
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.DeleteTrialDocument(System.Guid,System.Guid)">
|
||||
<summary>
|
||||
已签名的文档 不允许删除
|
||||
</summary>
|
||||
<param name="trialDocumentId"></param>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.SetFirstViewDocumentTime(System.Guid,System.Boolean)">
|
||||
<summary>
|
||||
浏览文档说明时调用,记录第一次看的时间
|
||||
</summary>
|
||||
<param name="documentId"></param>
|
||||
<param name="isSystemDoc"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.UserConfirm(IRaCIS.Core.Application.Contracts.UserConfirmCommand)">
|
||||
<summary>
|
||||
用户 签名某个文档 可能是系统的,也可能是项目的
|
||||
</summary>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.UserAbandonDoc(System.Guid,System.Boolean)">
|
||||
<summary>
|
||||
用户 废除某个文档
|
||||
</summary>
|
||||
<param name="documentId"></param>
|
||||
<param name="isSystemDoc"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialUserDocumentList(System.Guid)">
|
||||
<summary>
|
||||
从项目下参与者的维度 先看人员列表(展示统计数字) 点击数字 再看人员具体签署的 系统文档+项目文档(共用上面与人相关的具体文档列表)
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialDocumentService.GetTrialSystemDocumentList(IRaCIS.Core.Application.Contracts.DocumentTrialUnionQuery)">
|
||||
<summary>
|
||||
从 文档的维度 先看到文档列表(系统文档+项目文档 以及需要确认的人数 和已经确认人数) 点击数字查看某文档下面人确认情况
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.Services.TrialRevenuesPriceVerificationService">
|
||||
<summary>
|
||||
Financial---项目收入价格验证
|
||||
|
|
@ -17015,13 +16545,6 @@
|
|||
<member name="M:IRaCIS.Core.Application.Services.TrialMaintenanceService.DeleteSiteCRC(System.Guid,System.Boolean)">
|
||||
<summary> 删除CRC人员</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialMaintenanceService.GetTrialSiteSelect(System.Guid)">
|
||||
<summary>
|
||||
获取项目下的 site 下拉框数据 CRC只看到他负责的
|
||||
</summary>
|
||||
<param name="trialId"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Services.TrialMaintenanceService.DeleteTrialSite(System.Guid)">
|
||||
<summary>删除 项目 下某一site </summary>
|
||||
</member>
|
||||
|
|
@ -17402,11 +16925,6 @@
|
|||
<param name="command"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Core.Application.AutoMapper.SiteSurveyConfig">
|
||||
<summary>
|
||||
映射配置
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetSiteSurveyApprovalList(IRaCIS.Core.Application.Contracts.TrialSiteSurveyStatQuery)">
|
||||
<summary>
|
||||
中心调研 每个项目 需要处理的审批统计
|
||||
|
|
@ -17414,13 +16932,6 @@
|
|||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetTrialDocStatList(IRaCIS.Core.Application.Contracts.TrialSiteSurveyStatQuery)">
|
||||
<summary>
|
||||
待签署的项目文件 需要签署文件数量 系统级别的在第一行
|
||||
</summary>
|
||||
<param name="inQuery"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.PersonalWorkstation.GetCheckToBeDoneList(IRaCIS.Core.Application.Contracts.CheckToBeDoneQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
一致性核查待处理 -- PM APM 待办
|
||||
|
|
@ -18294,11 +17805,6 @@
|
|||
GCP机构
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.UserBasicInfo.LastLoginIP">
|
||||
<summary>
|
||||
LastLoginIP
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.UserBasicInfo.LastChangePassWordTime">
|
||||
<summary>
|
||||
上一次修改密码的时间
|
||||
|
|
@ -18899,5 +18405,30 @@
|
|||
<param name="inCommand"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="P:JwtSetting.Issuer">
|
||||
<summary>
|
||||
颁发者
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JwtSetting.Audience">
|
||||
<summary>
|
||||
接收者
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JwtSetting.SecurityKey">
|
||||
<summary>
|
||||
令牌密码
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JwtSetting.TokenExpireMinute">
|
||||
<summary>
|
||||
过期时间
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:JwtSetting.Credentials">
|
||||
<summary>
|
||||
签名
|
||||
</summary>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer
|
|||
|
||||
// dialogMsg.AppendLine(@$"<br>说明:为高效解决/处理以上全部质疑问题,麻烦您准确核实实际影像检查情况。请注意影像日期与实际检查的日期可能会不一致,部分检查(如PET -CT)可能同时存在多种模态影像。准确核实后,请回复该访视正确的影像检查情况。");
|
||||
dbSV.CheckState = CheckStateEnum.CVPassed;
|
||||
dbSV.CheckUserId = _userInfo.Id;
|
||||
dbSV.CheckUserId = _userInfo.UserRoleId;
|
||||
dbSV.CheckPassedTime = DateTime.Now;
|
||||
dbSV.CheckChallengeState = CheckChanllengeTypeEnum.Closed;
|
||||
|
||||
|
|
|
|||
|
|
@ -196,7 +196,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<IResponseOutput<PageOutput<TaskMedicalReviewView>>> GetMIMMedicalReviewTaskList(TaskMedicalReviewQuery inQuery)
|
||||
{
|
||||
|
||||
var taskMedicalReviewQueryable = _taskMedicalReviewRepository.Where(t => t.VisitTask.TrialId == inQuery.TrialId && t.MedicalManagerUserId == _userInfo.Id && t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
var taskMedicalReviewQueryable = _taskMedicalReviewRepository.Where(t => t.VisitTask.TrialId == inQuery.TrialId && t.MedicalManagerUserId == _userInfo.UserRoleId && t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||
|
||||
.WhereIf(inQuery.IsGetNextMedicalReviewTask,
|
||||
x => (
|
||||
|
|
|
|||
|
|
@ -141,14 +141,14 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
visitTask.PIAuditImagePath = string.Join('|', incommand.PIAuditImagePathList);
|
||||
visitTask.PIAuditState = incommand.PIAuditState;
|
||||
|
||||
visitTask.LatestReplyUserId = _userInfo.Id;
|
||||
visitTask.LatestReplyUserId = _userInfo.UserRoleId;
|
||||
visitTask.LatestReplyTime = DateTime.Now;
|
||||
visitTask.IsEnrollment = incommand.PIAuditState == PIAuditState.PINotAgree ? null : visitTask.IsEnrollment;
|
||||
visitTask.IsPDConfirm = incommand.PIAuditState == PIAuditState.PINotAgree ? null : visitTask.IsPDConfirm;
|
||||
|
||||
if (isFirstAudit)
|
||||
{
|
||||
visitTask.FirstAuditUserId = _userInfo.Id;
|
||||
visitTask.FirstAuditUserId = _userInfo.UserRoleId;
|
||||
visitTask.FirstAuditTime = DateTime.Now;
|
||||
}
|
||||
|
||||
|
|
@ -175,7 +175,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
var visitTask = await _visitTaskRepository.FirstOrDefaultAsync(t => t.Id == incommand.VisitTaskId);
|
||||
visitTask.IsEnrollment = incommand.IsEnrollment != null ? incommand.IsEnrollment : visitTask.IsEnrollment;
|
||||
visitTask.IsPDConfirm = incommand.IsPDConfirm != null ? incommand.IsPDConfirm : visitTask.IsPDConfirm;
|
||||
visitTask.LatestReplyUserId = _userInfo.Id;
|
||||
visitTask.LatestReplyUserId = _userInfo.UserRoleId;
|
||||
visitTask.LatestReplyTime = DateTime.Now;
|
||||
|
||||
await _visitTaskRepository.SaveChangesAsync();
|
||||
|
|
@ -213,7 +213,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
|
||||
foreach (var item in list)
|
||||
{
|
||||
item.IsCurrentUser = item.CreateUserId == _userInfo.Id;
|
||||
item.IsCurrentUser = item.CreateUserId == _userInfo.UserRoleId;
|
||||
}
|
||||
return list;
|
||||
}
|
||||
|
|
@ -1030,7 +1030,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
|
||||
var visitTaskQueryable = _visitTaskReReadingRepository
|
||||
.Where(t => t.RequestReReadingType == RequestReReadingType.DocotorApply)
|
||||
.Where(t => t.OriginalReReadingTask.DoctorUserId == _userInfo.Id)
|
||||
.Where(t => t.OriginalReReadingTask.DoctorUserId == _userInfo.UserRoleId)
|
||||
.Where(t => t.OriginalReReadingTask.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.RequestReReadingResultEnum != null, t => t.RequestReReadingResultEnum == inQuery.RequestReReadingResultEnum)
|
||||
.WhereIf(inQuery.RootReReadingTaskId != null, t => t.RootReReadingTaskId == inQuery.RootReReadingTaskId || t.OriginalReReadingTaskId == inQuery.RootReReadingTaskId)
|
||||
|
|
@ -1183,7 +1183,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
//随机阅片
|
||||
else
|
||||
{
|
||||
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
|
||||
var taskQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == trialReadingCriterionId)
|
||||
.Where(x => !x.Subject.IsDeleted).Where(x => (x.IsNeedClinicalDataSign && x.IsClinicalDataSign) || !x.IsNeedClinicalDataSign);
|
||||
|
||||
iRUnReadOut = new IRUnReadOutDto()
|
||||
|
|
@ -1391,19 +1391,19 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
if (subjectId != null)
|
||||
{
|
||||
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
||||
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
||||
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskBlindName == "Timepoint" && t.ReadingCategory == ReadingCategory.Visit
|
||||
&& (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze), true).ToListAsync();
|
||||
|
||||
if (needDealTaskList.Count > 0)
|
||||
{
|
||||
//已完成的访视任务数量(包含重阅的)
|
||||
var haveFinishedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
var haveFinishedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit);
|
||||
|
||||
//已经处理过的任务名称的数量
|
||||
|
||||
var haveDealedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
var haveDealedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
||||
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit && t.TaskBlindName != "Timepoint");
|
||||
|
||||
|
||||
|
|
@ -1423,7 +1423,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
}
|
||||
}
|
||||
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.Id && x.TaskState == TaskState.Effect)
|
||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == trialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect)
|
||||
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||
.WhereIf(!string.IsNullOrEmpty(subjectCode), t => (t.Subject.Code.Contains(subjectCode!) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(subjectCode!) && t.IsAnalysisCreate));
|
||||
|
||||
|
|
@ -1528,10 +1528,10 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
{
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.AIR)
|
||||
{
|
||||
var baseLineTaskList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
||||
var baseLineTaskList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.UserRoleId
|
||||
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Visit && t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SourceSubjectVisit.IsBaseLine == true).ToListAsync();
|
||||
|
||||
var judegeList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.Id
|
||||
var judegeList = await _visitTaskRepository.Where(t => t.TrialId == command.TrialId && t.TrialReadingCriterionId == command.TrialReadingCriterionId && t.DoctorUserId == _userInfo.UserRoleId
|
||||
&& t.TaskState == TaskState.Effect && t.ReadingCategory == ReadingCategory.Judge && t.ReadingTaskState == ReadingTaskState.HaveSigned).ToListAsync();
|
||||
|
||||
foreach (var item in judegeList)
|
||||
|
|
@ -1559,7 +1559,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
|
||||
|
||||
|
||||
var requestRecordList = await _visitTaskReReadingRepository.Where(t => baseLineTaskIdList.Contains(t.OriginalReReadingTaskId) && t.RequestReReadingUserId == _userInfo.Id && t.RequestReReadingReason == "AIR自动重阅基线").ToListAsync();
|
||||
var requestRecordList = await _visitTaskReReadingRepository.Where(t => baseLineTaskIdList.Contains(t.OriginalReReadingTaskId) && t.RequestReReadingUserId == _userInfo.UserRoleId && t.RequestReReadingReason == "AIR自动重阅基线").ToListAsync();
|
||||
|
||||
if (requestRecordList.Count != baseLineTaskIdList.Count)
|
||||
{
|
||||
|
|
@ -1586,7 +1586,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
|
||||
await ApplyReReading(new ApplyReReadingCommand() { IsCopyFollowForms = false, IsCopyOrigenalForms = true, TaskIdList = taskIdList, TrialId = command.TrialId, RequestReReadingReason = "阅片人自动重阅阅片任务", RequestReReadingType = RequestReReadingType.DocotorApply });
|
||||
|
||||
var requestRecord = await _visitTaskReReadingRepository.Where(t => visitTaskId == t.OriginalReReadingTaskId && t.RequestReReadingUserId == _userInfo.Id && t.RequestReReadingReason == "阅片人自动重阅阅片任务").FirstAsync();
|
||||
var requestRecord = await _visitTaskReReadingRepository.Where(t => visitTaskId == t.OriginalReReadingTaskId && t.RequestReReadingUserId == _userInfo.UserRoleId && t.RequestReReadingReason == "阅片人自动重阅阅片任务").FirstAsync();
|
||||
|
||||
await ConfirmReReading(new ConfirmReReadingCommand()
|
||||
{
|
||||
|
|
@ -1817,7 +1817,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
RootReReadingTaskId = rootReReadingTaskId == Guid.Empty ? task.Id : rootReReadingTaskId,
|
||||
OriginalReReadingTaskId = task.Id,
|
||||
RequestReReadingTime = DateTime.Now,
|
||||
RequestReReadingUserId = _userInfo.Id,
|
||||
RequestReReadingUserId = _userInfo.UserRoleId,
|
||||
IsCopyOrigenalForms = applyReReadingCommand.IsCopyOrigenalForms,
|
||||
IsCopyFollowForms = applyReReadingCommand.IsCopyFollowForms,
|
||||
RequestReReadingReason = applyReReadingCommand.RequestReReadingReason,
|
||||
|
|
@ -1921,7 +1921,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
|
||||
if ((origenalTask.TaskState != TaskState.Effect && origenalTask.TaskState != TaskState.Freeze))
|
||||
{
|
||||
await _visitTaskReReadingRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new VisitTaskReReading() { RequestReReadingConfirmUserId = _userInfo.Id, RequestReReadingResultEnum = RequestReReadingResult.Invalid });
|
||||
await _visitTaskReReadingRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, u => new VisitTaskReReading() { RequestReReadingConfirmUserId = _userInfo.UserRoleId, RequestReReadingResultEnum = RequestReReadingResult.Invalid });
|
||||
|
||||
//---当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作
|
||||
return ResponseOutput.Ok(string.Empty, msg: _localizer["VisitTask_ReapplyStatusConflict"]);
|
||||
|
|
@ -1932,7 +1932,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
|
||||
//更新申请信息
|
||||
var visitTaskReReadingAppply = await _visitTaskReReadingRepository.FirstOrDefaultAsync(t => t.Id == item.Id);
|
||||
visitTaskReReadingAppply.RequestReReadingConfirmUserId = _userInfo.Id;
|
||||
visitTaskReReadingAppply.RequestReReadingConfirmUserId = _userInfo.UserRoleId;
|
||||
visitTaskReReadingAppply.RequestReReadingResultEnum = agreeReReadingCommand.RequestReReadingResultEnum;
|
||||
visitTaskReReadingAppply.RequestReReadingRejectReason = agreeReReadingCommand.RequestReReadingRejectReason;
|
||||
|
||||
|
|
@ -3181,7 +3181,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
|||
|
||||
var list = await _visitTaskRepository.Where(filterExpression)
|
||||
//IR 申请的时候,仅仅看到影响自己的
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer, t => t.DoctorUserId == _userInfo.Id)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer, t => t.DoctorUserId == _userInfo.UserRoleId)
|
||||
.OrderBy(t => t.VisitTaskNum).ProjectTo<InfluenceTaskInfo>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
#region 影响后的操作
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(queryCommonDocument.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == queryCommonDocument.BusinessScenarioEnum)
|
||||
.WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Code), t => t.Code.Contains(queryCommonDocument.Code))
|
||||
.WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Name), t => t.Name.Contains(queryCommonDocument.Name) || t.NameCN.Contains(queryCommonDocument.Name))
|
||||
.ProjectTo<CommonDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
|
||||
.ProjectTo<CommonDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.UserRoleId });
|
||||
|
||||
return await commonDocumentQueryable.ToPagedListAsync(queryCommonDocument);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,16 +25,12 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
public class ExcelExportService(IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<DicomStudy> _dicomStudyRepository,
|
||||
IRepository<QCChallenge> _qcChallengeRepository,
|
||||
IRepository<ReadModule> _readModuleRepository,
|
||||
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
||||
IRepository<StudyMonitor> _studyMonitorRepository,
|
||||
IRepository<CommonDocument> _commonDocumentRepository,
|
||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
||||
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<TrialDocConfirmedUser> _trialDocConfirmedUserRepository,
|
||||
IRepository<Subject> _subjectRepository,
|
||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IWebHostEnvironment _hostEnvironment) : BaseService
|
||||
{
|
||||
|
|
@ -119,7 +115,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteCode),
|
||||
t => t.TrialSite.TrialSiteCode.Contains(param.TrialSiteCode))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator,
|
||||
t => t.UserId == _userInfo.Id)
|
||||
t => t.UserId == _userInfo.UserRoleId)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserKeyInfo), t => (t.User.FullName).Contains(param.UserKeyInfo)
|
||||
|| t.User.UserName.Contains(param.UserKeyInfo) || t.User.EMail.Contains(param.UserKeyInfo))
|
||||
|
||||
|
|
@ -135,58 +131,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Site用户汇总表导出
|
||||
/// </summary>
|
||||
/// <param name="queryParam"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_trialSiteSurveyRepository"></param>
|
||||
/// <param name="_trialSiteUserSurveyRepository"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> TrialSiteUserSummaryListExport(TrialSiteUserSurveyExportQueryDto queryParam,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||
[FromServices] IRepository<TrialSiteUserSurvey> _trialSiteUserSurveyRepository,
|
||||
[FromServices] IRepository<Trial> _trialRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService
|
||||
)
|
||||
{
|
||||
|
||||
var data = (await _trialRepository.Where(t => t.Id == queryParam.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
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());
|
||||
|
||||
|
||||
var query = _trialSiteUserSurveyRepository
|
||||
.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.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))
|
||||
.ProjectTo<TrialSiteUserSummaryDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
var list = await query.ToListAsync();
|
||||
data.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
|
||||
var exportInfo = data;
|
||||
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialSiteUserSummaryDto));
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -220,7 +165,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserList.Any(t => t.UserRole.EMail.Contains(inQuery.PM_EMail) && (t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)))
|
||||
.Select(t => new TrialToBeDoneDto()
|
||||
|
|
@ -247,49 +192,49 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
SPM_ReviewerSelectApprovalCount = isSPMOrCPM ? t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count() : 0,
|
||||
|
||||
MIM_UrgentCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
MIM_UrgentCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.VisitTask.IsUrgent &&
|
||||
u.AuditState != MedicalReviewAuditState.HaveSigned).Count() : 0,
|
||||
|
||||
MIM_PendingResponseCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
MIM_PendingResponseCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing).Count() : 0,
|
||||
|
||||
MIM_PendingReviewCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
MIM_PendingReviewCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count() : 0,
|
||||
|
||||
CRC_UrgentCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id) && t.IsUrgent).Count() : 0,
|
||||
CRC_UrgentCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId) && t.IsUrgent).Count() : 0,
|
||||
|
||||
CRC_CheckQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
CRC_CheckQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() : 0,
|
||||
|
||||
CRC_QCQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)).SelectMany(c => c.QCChallengeList)
|
||||
CRC_QCQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId)).SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count() : 0,
|
||||
|
||||
|
||||
//待审核 审核中 加急的数量
|
||||
IQC_UrgentCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit && t.IsUrgent).Count() : 0,
|
||||
IQC_UrgentCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId && t.QCProcessEnum != TrialQCProcess.NotAudit && t.IsUrgent).Count() : 0,
|
||||
|
||||
//审核未完成
|
||||
IQC_AuditToBeDealedCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit).Count() : 0,
|
||||
IQC_AuditToBeDealedCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId && t.QCProcessEnum != TrialQCProcess.NotAudit).Count() : 0,
|
||||
|
||||
//质疑待处理
|
||||
IQC_QuestionToBeDealedCount = isIQC ? t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
|
||||
.Where(u => u.CreateUserId == _userInfo.UserRoleId && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
|
||||
|
||||
//待领取
|
||||
IQC_ToBeClaimedCount = isIQC ? t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed)
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count() : 0,
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.UserRoleId && u.ReviewAuditUserId == null))).Count() : 0,
|
||||
|
||||
|
||||
IR_ReadingCriterionList = isIR ? t.TrialReadingCriterionList.Where(t => t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t => t.CriterionName).ToList() : null,
|
||||
|
||||
IR_PMEmailList = isIR ? t.TrialUserList.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.UserRole.EMail).Select(t => t.UserRole.EMail).ToList() : null,
|
||||
|
||||
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
|
||||
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
|
||||
|
||||
|
||||
IR_UnReadCount = isIR ? t.VisitTaskList
|
||||
.Where(c => c.DoctorUserId == _userInfo.Id && c.ReadingTaskState != ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterion.IsSigned)
|
||||
.Where(c => c.DoctorUserId == _userInfo.UserRoleId && c.ReadingTaskState != ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterion.IsSigned)
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||
//前序 不存在 未生成任务的访视
|
||||
|
|
@ -324,118 +269,6 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
#region 导表查询
|
||||
|
||||
/// <summary>
|
||||
/// getDocumentConfirmList 培训记录导出--new
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <param name="_subjectVisitRepository"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[AllowAnonymous]
|
||||
public async Task<IActionResult> PMTrainingRecordList_Export(DocumentTrialUnionQuery inQuery,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
[FromServices] IRepository<Trial> _trialRepository
|
||||
)
|
||||
{
|
||||
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
|
||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserRole.UserTypeId == inQuery.UserTypeId)
|
||||
on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
|
||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDocumentNeedConfirmedUserType.TrialDocumentId } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new TrainingRecordExportDTO()
|
||||
{
|
||||
IsSystemDoc = false,
|
||||
|
||||
Id = trialDocumentNeedConfirmedUserType.TrialDocument.Id,
|
||||
CreateTime = trialDocumentNeedConfirmedUserType.TrialDocument.CreateTime,
|
||||
IsDeleted = trialDocumentNeedConfirmedUserType.TrialDocument.IsDeleted,
|
||||
//SignViewMinimumMinutes = trialDocumentNeedConfirmedUserType.TrialDocument.SignViewMinimumMinutes,
|
||||
Name = trialDocumentNeedConfirmedUserType.TrialDocument.Name,
|
||||
//Path = trialDocumentNeedConfirmedUserType.TrialDocument.Path,
|
||||
FileTypeId = trialDocumentNeedConfirmedUserType.TrialDocument.FileTypeId,
|
||||
FileType = _userInfo.IsEn_Us ? trialDocumentNeedConfirmedUserType.TrialDocument.FileType.Value : trialDocumentNeedConfirmedUserType.TrialDocument.FileType.ValueCN,
|
||||
//UpdateTime = trialDocumentNeedConfirmedUserType.TrialDocument.UpdateTime,
|
||||
//IsConfirmed= confirm.ConfirmTime!=null,
|
||||
|
||||
|
||||
|
||||
//ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = trialUser.UserRole.FullName,
|
||||
UserName = trialUser.UserRole.UserName,
|
||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||
|
||||
//FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path
|
||||
};
|
||||
|
||||
|
||||
|
||||
var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new TrainingRecordExportDTO()
|
||||
{
|
||||
IsSystemDoc = true,
|
||||
|
||||
Id = needConfirmEdUserType.SystemDocument.Id,
|
||||
CreateTime = needConfirmEdUserType.SystemDocument.CreateTime,
|
||||
IsDeleted = needConfirmEdUserType.SystemDocument.IsDeleted,
|
||||
//SignViewMinimumMinutes = needConfirmEdUserType.SystemDocument.SignViewMinimumMinutes,
|
||||
Name = needConfirmEdUserType.SystemDocument.Name,
|
||||
//Path = needConfirmEdUserType.SystemDocument.Path,
|
||||
FileType = _userInfo.IsEn_Us ? needConfirmEdUserType.SystemDocument.FileType.Value : needConfirmEdUserType.SystemDocument.FileType.ValueCN,
|
||||
FileTypeId = needConfirmEdUserType.SystemDocument.FileTypeId,
|
||||
//UpdateTime = needConfirmEdUserType.SystemDocument.UpdateTime,
|
||||
//IsConfirmed = confirm.ConfirmTime != null,
|
||||
|
||||
//ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = trialUser.UserRole.FullName,
|
||||
UserName = trialUser.UserRole.UserName,
|
||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||
|
||||
//FullFilePath = needConfirmEdUserType.SystemDocument.Path
|
||||
};
|
||||
|
||||
var unionQuery = trialDocQuery.Union(systemDocQuery)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
|
||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserTypeId == inQuery.UserTypeId);
|
||||
|
||||
var list = await unionQuery.ToListAsync();
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List = list;
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
|
||||
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialTrainingRecordList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrainingRecordExportDTO));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -476,7 +309,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(inQuery.SubmitState != null, t => t.SubmitState == inQuery.SubmitState)
|
||||
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.ProjectTo<CRCVisitExportDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
var list = query.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.SubjectCode).ThenBy(t => t.BlindName).ToList();
|
||||
|
|
@ -584,7 +417,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(inQuery.IsOverTime != null && inQuery.IsOverTime == true, t => t.IsClosed ? t.ClosedTime > t.DeadlineTime : DateTime.Now > t.DeadlineTime)
|
||||
.WhereIf(inQuery.IsOverTime != null && inQuery.IsOverTime == false, t => t.IsClosed ? t.ClosedTime < t.DeadlineTime : DateTime.Now < t.DeadlineTime)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.SubjectVisit.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
|
||||
.ProjectTo<QCChanllengeExportDto>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
|
@ -625,7 +458,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||
// CRC 只负责他管理site的受试者
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.ProjectTo<SubjectExportDTO>(_mapper.ConfigurationProvider)
|
||||
.WhereIf(inQuery.IsMissingImages == true, t => t.MissingSubmmitCount > 0)
|
||||
.WhereIf(inQuery.IsMissingImages == false, t => t.MissingSubmmitCount == 0)
|
||||
|
|
@ -807,7 +640,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
var svExpression = QCCommon.GetStudyMonitorSubjectVisitFilter(inQuery.VisitPlanArray);
|
||||
var StudyMonitorQuery = _studyMonitorRepository.Where(t => t.TrialId == inQuery.TrialId, ignoreQueryFilters: true)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo))
|
||||
|
|
@ -922,7 +755,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
|
||||
var dicomStudyQuery = _dicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.Where(x => x.SubjectVisit.AuditState == AuditStateEnum.QCPassed)
|
||||
|
|
@ -950,7 +783,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
|
||||
var nodeDicomStudyQuery = _noneDicomStudyRepository.Where(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression2)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.Where(x => x.SubjectVisit.AuditState == AuditStateEnum.QCPassed)
|
||||
|
|
@ -1019,7 +852,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo))
|
||||
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
//.WhereIf(!string.IsNullOrEmpty(checkQuery.VisitPlanInfo), checkQuery.VisitPlanInfo.Contains('.') ? t => t.InPlan == false : t => t.VisitNum == decimal.Parse(checkQuery.VisitPlanInfo))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))//CRC 过滤负责的site
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))//CRC 过滤负责的site
|
||||
.ProjectTo<PMKCheckEXportDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
var list = query.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.SubjectCode).ThenBy(t => t.VisitNum).ToList();
|
||||
|
|
|
|||
|
|
@ -29,11 +29,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
Task AdminResetPwdSendEmailAsync(Guid userId, string pwdNotMd5 = "123456");
|
||||
|
||||
Task SiteSurveyUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl);
|
||||
|
||||
Task ExternalUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl);
|
||||
|
||||
Task<Guid> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl);
|
||||
|
||||
Task UserFeedBackMail(Guid feedBackId);
|
||||
}
|
||||
|
|
@ -45,6 +40,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
IRepository<UserRole> _userRoleRepository,
|
||||
IRepository<UserFeedBack> _userFeedBackRepository,
|
||||
ITokenService _tokenService,
|
||||
IRepository<IdentityUser> _identityUserRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<UserType> _userTypeRepository,
|
||||
|
|
@ -338,7 +334,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task AddUserSendEmailAsync(Guid userId, string baseUrl, string routeUrl)
|
||||
{
|
||||
|
||||
var sysUserInfo = (await _userRoleRepository.Where(t => t.Id == userId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
var sysUserInfo = (await _identityUserRepository.Where(t => t.Id == userId).Include(t => t.UserRoleList).ThenInclude(c => c.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
|
||||
var messageToSend = new MimeMessage();
|
||||
|
|
@ -350,11 +346,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
//---[来自展影IRC] 关于创建账户的提醒
|
||||
|
||||
|
||||
var token = _tokenService.GetToken(IRaCISClaims.Create(_mapper.Map<UserBasicInfo>(sysUserInfo)));
|
||||
var token = _tokenService.GetToken(new UserTokenInfo() { IdentityUserId = sysUserInfo.Id });
|
||||
|
||||
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new UserRole() { EmailToken = token });
|
||||
await _identityUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new IdentityUser() { EmailToken = token });
|
||||
|
||||
routeUrl = routeUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
||||
routeUrl = routeUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
||||
|
||||
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
||||
|
||||
|
|
@ -370,8 +366,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||
|
||||
sysUserInfo.FullName,
|
||||
sysUserInfo.UserName,
|
||||
sysUserInfo.UserTypeRole.UserTypeShortName,
|
||||
sysUserInfo.EMail,
|
||||
//string.Join(',', sysUserInfo.UserRoleList.Select(t => t.UserTypeRole.UserTypeShortName)),
|
||||
redirectUrl
|
||||
);
|
||||
|
||||
|
|
@ -422,242 +418,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
|
||||
//Site调研 用户加入项目
|
||||
public async Task SiteSurveyUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl)
|
||||
{
|
||||
var sysUserInfo = (await _userRoleRepository.Where(t => t.Id == userId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
||||
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
//收件地址
|
||||
messageToSend.To.Add(new MailboxAddress(sysUserInfo.FullName, sysUserInfo.EMail));
|
||||
//主题
|
||||
// $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信";
|
||||
|
||||
|
||||
var token = _tokenService.GetToken(IRaCISClaims.Create(_mapper.Map<UserBasicInfo>(sysUserInfo)));
|
||||
|
||||
if (sysUserInfo.IsFirstAdd)
|
||||
{
|
||||
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new UserRole() { EmailToken = token });
|
||||
}
|
||||
|
||||
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
||||
|
||||
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
||||
|
||||
var redirectUrl = $"{domain}/api/User/UserRedirect?url={System.Web.HttpUtility.UrlEncode(routeUrl)}";
|
||||
|
||||
|
||||
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
||||
|
||||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||
|
||||
sysUserInfo.FullName,
|
||||
trialInfo.ExperimentName,
|
||||
trialInfo.ResearchProgramNo,
|
||||
trialInfo.TrialCode,
|
||||
sysUserInfo.UserName,
|
||||
sysUserInfo.UserTypeRole.UserTypeShortName,
|
||||
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
||||
);
|
||||
|
||||
return (topicStr, htmlBodyStr);
|
||||
};
|
||||
|
||||
|
||||
await GetEmailSubejctAndHtmlInfoAndBuildAsync(sysUserInfo.IsFirstAdd ? EmailBusinessScenario.SiteUseOrExternalUserFirstrJoinTrial : EmailBusinessScenario.SiteUserOrExternalUserExistJoinTrial, messageToSend, emailConfigFunc);
|
||||
|
||||
|
||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//外部用户 加入项目
|
||||
public async Task ExternalUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl)
|
||||
{
|
||||
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId)).IfNullThrowException();
|
||||
|
||||
var sysUserInfo = (await _userRoleRepository.Where(t => t.Id == userId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
//收件地址
|
||||
messageToSend.To.Add(new MailboxAddress(String.Empty, sysUserInfo.EMail));
|
||||
//主题
|
||||
// $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信";
|
||||
|
||||
|
||||
|
||||
var token = _tokenService.GetToken(IRaCISClaims.Create(_mapper.Map<UserBasicInfo>(sysUserInfo)));
|
||||
if (sysUserInfo.IsFirstAdd)
|
||||
{
|
||||
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new UserRole() { EmailToken = token });
|
||||
}
|
||||
|
||||
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
||||
|
||||
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + sysUserInfo.UserTypeRole.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
||||
|
||||
var redirectUrl = $"{domain}/api/User/UserRedirect?url={System.Web.HttpUtility.UrlEncode(routeUrl)}";
|
||||
|
||||
|
||||
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
||||
|
||||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||
|
||||
sysUserInfo.FullName,
|
||||
trialInfo.ExperimentName,
|
||||
trialInfo.ResearchProgramNo,
|
||||
trialInfo.TrialCode,
|
||||
sysUserInfo.UserName,
|
||||
sysUserInfo.UserTypeRole.UserTypeShortName,
|
||||
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
||||
);
|
||||
|
||||
return (topicStr, htmlBodyStr);
|
||||
};
|
||||
|
||||
|
||||
await GetEmailSubejctAndHtmlInfoAndBuildAsync(sysUserInfo.IsFirstAdd ? EmailBusinessScenario.SiteUseOrExternalUserFirstrJoinTrial : EmailBusinessScenario.SiteUserOrExternalUserExistJoinTrial, messageToSend, emailConfigFunc);
|
||||
|
||||
|
||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, null);
|
||||
|
||||
}
|
||||
|
||||
|
||||
//医生生成账号加入 或者已存在账号加入到项目中
|
||||
public async Task<Guid> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl)
|
||||
{
|
||||
var doctor = await _doctorTypeRepository.FindAsync(doctorId);
|
||||
UserRole sysUserInfo = new UserRole();
|
||||
|
||||
var userType = await _userTypeRepository.FirstAsync(t => t.UserTypeEnum == UserTypeEnum.IndependentReviewer);
|
||||
|
||||
var @lock = _distributedLockProvider.CreateLock($"UserCode");
|
||||
|
||||
using (await @lock.AcquireAsync())
|
||||
{
|
||||
var isDoctorHaveAccount = await _userRoleRepository.AnyAsync(t => t.DoctorId == doctorId);
|
||||
|
||||
|
||||
if (!isDoctorHaveAccount)
|
||||
{
|
||||
|
||||
var saveItem = new UserRole() { FirstName = doctor.FirstName, LastName = doctor.LastName, EMail = doctor.EMail };
|
||||
|
||||
var trialType = await _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefaultAsync();
|
||||
|
||||
if (trialType == TrialType.NoneOfficial)
|
||||
{
|
||||
saveItem.IsTestUser = true;
|
||||
}
|
||||
|
||||
|
||||
saveItem.Code = _userRoleRepository.Select(t => t.Code).DefaultIfEmpty().Max() + 1;
|
||||
|
||||
saveItem.UserCode = AppSettings.GetCodeStr(saveItem.Code, nameof(UserRole));
|
||||
|
||||
saveItem.UserName = saveItem.UserCode;
|
||||
|
||||
saveItem.UserTypeEnum = UserTypeEnum.IndependentReviewer;
|
||||
|
||||
saveItem.DoctorId = doctorId;
|
||||
saveItem.UserTypeId = userType.Id;
|
||||
|
||||
var savedUser = await _userRoleRepository.AddAsync(saveItem);
|
||||
|
||||
//下面获取Token 需要这部分信息
|
||||
sysUserInfo = savedUser.Clone();
|
||||
|
||||
sysUserInfo.UserTypeRole = userType;
|
||||
|
||||
await _userRoleRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
sysUserInfo = (await _userRoleRepository.Where(t => t.DoctorId == doctorId).Include(t => t.UserTypeRole).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
||||
|
||||
var messageToSend = new MimeMessage();
|
||||
//发件地址
|
||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||
//收件地址
|
||||
messageToSend.To.Add(new MailboxAddress(doctor.FullName, doctor.EMail));
|
||||
|
||||
|
||||
|
||||
var basicInfo = IRaCISClaims.Create(_mapper.Map<UserBasicInfo>(sysUserInfo));
|
||||
|
||||
////第一次添加的时候 注意赋值
|
||||
//basicInfo.PermissionStr = userType.PermissionStr;
|
||||
//basicInfo.UserTypeShortName = userType.UserTypeShortName;
|
||||
|
||||
var token = _tokenService.GetToken(basicInfo);
|
||||
|
||||
if (sysUserInfo.IsFirstAdd)
|
||||
{
|
||||
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == sysUserInfo.Id, u => new UserRole() { EmailToken = token });
|
||||
}
|
||||
|
||||
var routeUrl = rootUrl + "?UserId=" + sysUserInfo.Id + "&Email=" + sysUserInfo.EMail + "&UserName=" + sysUserInfo.UserName + "&UserType=" + userType.UserTypeShortName + "&lang=" + (_userInfo.IsEn_Us ? "en" : "zh") + "&access_token=" + token;
|
||||
|
||||
var domain = baseUrl.Substring(0, baseUrl.IndexOf("/login"));
|
||||
|
||||
var redirectUrl = $"{domain}/api/User/UserRedirect?url={System.Web.HttpUtility.UrlEncode(routeUrl)}";
|
||||
|
||||
//主题
|
||||
// $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信";
|
||||
|
||||
|
||||
var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN;
|
||||
|
||||
Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input =>
|
||||
{
|
||||
var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo);
|
||||
|
||||
var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr),
|
||||
|
||||
sysUserInfo.FullName,
|
||||
trialInfo.ExperimentName,
|
||||
trialInfo.ResearchProgramNo,
|
||||
trialInfo.TrialCode,
|
||||
sysUserInfo.UserName,
|
||||
userType.UserTypeShortName,
|
||||
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
||||
);
|
||||
|
||||
return (topicStr, htmlBodyStr);
|
||||
};
|
||||
|
||||
|
||||
await GetEmailSubejctAndHtmlInfoAndBuildAsync(sysUserInfo.IsFirstAdd ? EmailBusinessScenario.DoctorUserFirstJoinTrial : EmailBusinessScenario.DoctorUserExistJoinTrial, messageToSend, emailConfigFunc);
|
||||
|
||||
|
||||
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, null);
|
||||
|
||||
return sysUserInfo.Id;
|
||||
}
|
||||
|
||||
|
||||
//用户反馈邮件
|
||||
|
|
|
|||
|
|
@ -629,7 +629,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> UpdateAuditResume(ResumeConfirmCommand auditResumeParam)
|
||||
{
|
||||
var userId = _userInfo.Id;
|
||||
var userId = _userInfo.UserRoleId;
|
||||
//判断 合作协议、正式简历 是否有。如果没有,显示提示信息,并且不能保存
|
||||
var attachmentList = await _attachmentRepository.Where(u => u.DoctorId == auditResumeParam.Id)
|
||||
.Select(u => u.Type).ToListAsync();
|
||||
|
|
|
|||
|
|
@ -93,11 +93,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<DoctorDTO, SelectionReviewerDTO>()
|
||||
;
|
||||
|
||||
CreateMap<UserRole, UserBasicInfo>()
|
||||
.ForMember(d => d.UserTypeShortName, u => u.MapFrom(t => t.UserTypeRole.UserTypeShortName))
|
||||
.ForMember(d => d.Code, u => u.MapFrom(t => t.UserCode))
|
||||
.ForMember(d => d.PermissionStr, u => u.MapFrom(t => t.UserTypeRole.PermissionStr))
|
||||
.ForMember(d => d.RealName, u => u.MapFrom(user => string.IsNullOrEmpty(user.FirstName) ? user.LastName : user.LastName + " / " + user.FirstName));
|
||||
|
||||
CreateMap<TrialExperience, TrialExperienceListDTO>()
|
||||
.ForMember(x=>x.VisitReadingCount, u => u.MapFrom(t => (t.ExperienceDataType==ExperienceDataType.TrialAuto||t.ExperienceDataType==ExperienceDataType.SystemAuto)?
|
||||
|
|
@ -110,11 +105,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.ForMember(d => d.EvaluationCriteriaList, u => u.MapFrom(t => t.ExperienceCriteriaList.Select(t => t.EvaluationCriteria.Value)))
|
||||
.ForMember(d => d.EvaluationCriteriaIdList, u => u.MapFrom(t => t.ExperienceCriteriaList.Select(t => t.EvaluationCriteriaId)));
|
||||
|
||||
CreateMap<Doctor, UserBasicInfo>()
|
||||
.ForMember(d => d.Code, u => u.MapFrom(t => t.ReviewerCode))
|
||||
.ForMember(d => d.RealName, u => u.MapFrom(t => t.ChineseName))
|
||||
.ForMember(d => d.IsReviewer, u => u.MapFrom(t => true))
|
||||
.ForMember(d => d.UserName, u => u.MapFrom(doctor => doctor.LastName + " / " + doctor.FirstName));
|
||||
|
||||
|
||||
#region 医生基本信息
|
||||
CreateMap<Doctor, SelectionReviewerDTO>()
|
||||
|
|
|
|||
|
|
@ -1,202 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2022-01-05 09:17:10
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
/// <summary> SystemDocumentView 列表视图模型 </summary>
|
||||
public class SystemDocumentView : SystemDocumentAddOrEdit
|
||||
{
|
||||
public string FullFilePath { get; set; } = string.Empty;
|
||||
public DateTime CreateTime { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
public string FileType { get; set; } = string.Empty;
|
||||
|
||||
public List<NeedConfirmedUserTypeView> NeedConfirmedUserTypeList { get; set; } = new List<NeedConfirmedUserTypeView>();
|
||||
}
|
||||
|
||||
public class UnionDocumentView : SystemDocumentAddOrEdit
|
||||
{
|
||||
public string FullFilePath { get; set; } = string.Empty;
|
||||
public DateTime CreateTime { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
|
||||
public bool IsSystemDoc { get; set; }
|
||||
|
||||
public string FileType { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
public class TrialSignDocView : UnionDocumentWithConfirmInfoView
|
||||
{
|
||||
public string TrialCode { get; set; }
|
||||
public string ResearchProgramNo { get; set; }
|
||||
|
||||
public string ExperimentName { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class UnionDocumentWithConfirmInfoView : UnionDocumentView
|
||||
{
|
||||
|
||||
|
||||
public DateTime? ConfirmTime { get; set; }
|
||||
|
||||
public Guid? ConfirmUserId { get; set; }
|
||||
|
||||
public bool IsConfirmed => ConfirmTime != null;
|
||||
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
|
||||
public string RealName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public Guid UserTypeId { get; set; }
|
||||
public string UserTypeShortName { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
public class TrialUserDto
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
|
||||
public string RealName { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class DocumentUnionWithUserStatView : UnionDocumentView
|
||||
{
|
||||
public int? DocumentUserCount { get; set; }
|
||||
public int? DocumentConfirmedUserCount { get; set; }
|
||||
}
|
||||
|
||||
public class TrialUserUnionDocumentView
|
||||
{
|
||||
public Guid UserId { get; set; }
|
||||
|
||||
public string UserTypeShortName { get; set; } = string.Empty;
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string RealName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public int? SystemDocumentCount { get; set; }
|
||||
public int? TrialDocumentCount { get; set; }
|
||||
public int? TrialDocumentConfirmedCount { get; set; }
|
||||
public int? SystemDocumentConfirmedCount { get; set; }
|
||||
|
||||
//public List<UnionDocumentView> DocumentList { get; set; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
///<summary>SystemDocumentQuery 列表查询参数模型</summary>
|
||||
public class SystemDocumentQuery : PageInput
|
||||
{
|
||||
|
||||
public bool? IsDeleted { get; set; }
|
||||
public Guid? SystemDocumentId { get; set; }
|
||||
|
||||
public Guid? FileTypeId { get; set; }
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public bool IsSigned { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class GetNextUnSignDocumentInDto
|
||||
{
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
public bool Asc { get; set; } = true;
|
||||
public string SortField { get; set; } = "";
|
||||
}
|
||||
|
||||
public class TrialDocQuery : PageInput
|
||||
{
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
public Guid? FileTypeId { get; set; }
|
||||
|
||||
public string TrialCode { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public bool IsSigned { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class TrialUserDocUnionQuery : PageInput
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? FileTypeId { get; set; }
|
||||
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public bool? IsSign { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class UserConfirmCommand
|
||||
{
|
||||
|
||||
[NotDefault]
|
||||
public Guid DocumentId { get; set; }
|
||||
|
||||
|
||||
public bool isSystemDoc { get; set; }
|
||||
|
||||
public string SignText { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class DocumentTrialUnionQuery : TrialUserDocUnionQuery
|
||||
{
|
||||
|
||||
public Guid? UserTypeId { get; set; }
|
||||
public Guid? UserId { get; set; }
|
||||
|
||||
public bool? IsConfirmed { get; set; }
|
||||
|
||||
public bool? IsDeleted { get; set; }
|
||||
}
|
||||
|
||||
///<summary> SystemDocumentAddOrEdit 列表查询参数模型</summary>
|
||||
public class SystemDocumentAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public Guid FileTypeId { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
public int SignViewMinimumMinutes { get; set; }
|
||||
|
||||
public DocUserSignType DocUserSignType { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class AddOrEditSystemDocument : SystemDocumentAddOrEdit
|
||||
{
|
||||
|
||||
public List<Guid> NeedConfirmedUserTypeIdList { get; set; } = new List<Guid>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2022-01-05 09:17:00
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// ISystemDocumentService
|
||||
/// </summary>
|
||||
public interface ISystemDocumentService
|
||||
{
|
||||
|
||||
//PageOutput<SystemDocumentView> GetSystemDocumentList(SystemDocumentQuery querySystemDocument);
|
||||
|
||||
|
||||
//IResponseOutput AddOrUpdateSystemDocument(AddOrEditSystemDocument addOrEditSystemDocument);
|
||||
|
||||
//IResponseOutput DeleteSystemDocument(Guid systemDocumentId);
|
||||
|
||||
Task<PageOutput<SystemDocumentView>> GetSystemDocumentListAsync(SystemDocumentQuery querySystemDocument);
|
||||
|
||||
Task<IResponseOutput> AddOrUpdateSystemDocumentAsync(AddOrEditSystemDocument addOrEditSystemDocument);
|
||||
|
||||
Task<IResponseOutput> DeleteSystemDocumentAsync(Guid systemDocumentId);
|
||||
|
||||
Task<PageOutput<UnionDocumentWithConfirmInfoView>> getWaitSignSysDocList(SystemDocumentQuery querySystemDocument);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2022-01-05 09:17:03
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface ITrialDocumentService
|
||||
{
|
||||
Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc);
|
||||
Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument);
|
||||
Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId);
|
||||
//Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetDocumentConfirmList(DocumentTrialUnionQuery querySystemDocument);
|
||||
Task<PageOutput<TrialDocumentView>> GetTrialDocumentList(TrialDocumentQuery queryTrialDocument);
|
||||
|
||||
Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetUserDocumentList(TrialUserDocUnionQuery querySystemDocument);
|
||||
Task<IResponseOutput> SetFirstViewDocumentTime(Guid documentId, bool isSystemDoc);
|
||||
Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand);
|
||||
Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId);
|
||||
|
||||
|
||||
Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery querySystemDocument);
|
||||
List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,191 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2022-01-05 09:17:03
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using UserRole = IRaCIS.Core.Domain.Models.UserRole;
|
||||
|
||||
namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// SystemDocumentService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class SystemDocumentService(IRepository<SystemDocument> _systemDocumentRepository,
|
||||
IRepository<UserRole> _userRoleRepository,
|
||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISystemDocumentService
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 管理端列表
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<SystemDocumentView>> GetSystemDocumentListAsync(SystemDocumentQuery inQuery)
|
||||
{
|
||||
var systemDocumentQueryable = _systemDocumentRepository.AsQueryable(true)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
||||
.ProjectTo<SystemDocumentView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us, userId = _userInfo.Id });
|
||||
|
||||
return await systemDocumentQueryable.ToPagedListAsync(inQuery);
|
||||
}
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateSystemDocumentAsync(AddOrEditSystemDocument addOrEditSystemDocument)
|
||||
{
|
||||
if (addOrEditSystemDocument.Id == null)
|
||||
{
|
||||
var entity = _mapper.Map<SystemDocument>(addOrEditSystemDocument);
|
||||
|
||||
|
||||
if (await _systemDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditSystemDocument.FileTypeId && t.Name == addOrEditSystemDocument.Name, true))
|
||||
{
|
||||
//---系统中已存在同类型的同名文件。
|
||||
return ResponseOutput.NotOk(_localizer["SystemD_DuplicateFile"]);
|
||||
}
|
||||
|
||||
await _systemDocumentRepository.AddAsync(entity, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
var document = (await _systemDocumentRepository.Where(t => t.Id == addOrEditSystemDocument.Id, true, true).Include(t => t.NeedConfirmedUserTypeList).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
|
||||
if (await _systemDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditSystemDocument.FileTypeId && t.Name == addOrEditSystemDocument.Name && t.Id != addOrEditSystemDocument.Id, true))
|
||||
{
|
||||
//---系统中已存在同类型的同名文件。
|
||||
return ResponseOutput.NotOk(_localizer["SystemD_DuplicateFile"]);
|
||||
}
|
||||
|
||||
|
||||
_mapper.Map(addOrEditSystemDocument, document);
|
||||
|
||||
#region 之前区分路径文件夹 现在不区分废弃
|
||||
|
||||
//if (document.FileTypeId != addOrEditSystemDocument.FileTypeId)
|
||||
//{
|
||||
// var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName;
|
||||
// var beforeFilePath = Path.Combine(rootPath, document.Path);
|
||||
|
||||
// document.Path = document.Path.Replace(document.FileTypeId.ToString(), addOrEditSystemDocument.FileTypeId.ToString());
|
||||
|
||||
// var nowPath = Path.Combine(rootPath, document.Path);
|
||||
|
||||
// if (File.Exists(beforeFilePath))
|
||||
// {
|
||||
// File.Move(beforeFilePath, nowPath, true);
|
||||
// File.Delete(beforeFilePath);
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
var success = await _systemDocumentRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(document.Id.ToString());
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
[HttpDelete("{systemDocumentId:guid}")]
|
||||
public async Task<IResponseOutput> AbandonSystemDocumentAsync(Guid systemDocumentId)
|
||||
{
|
||||
|
||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(systemDocumentId, u => new SystemDocument() { IsDeleted = true });
|
||||
|
||||
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == systemDocumentId, x => new SystemDocConfirmedUser()
|
||||
{
|
||||
IsDeleted = true
|
||||
});
|
||||
|
||||
await _systemDocConfirmedUserRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
[HttpDelete("{systemDocumentId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteSystemDocumentAsync(Guid systemDocumentId)
|
||||
{
|
||||
|
||||
if (await _systemDocumentRepository.Where(t => t.Id == systemDocumentId).AnyAsync(u => u.SystemDocConfirmedUserList.Any()))
|
||||
{
|
||||
//---已有用户阅读该文档,并签名,不允许删除。
|
||||
return ResponseOutput.NotOk(_localizer["SystemD_CannotDeleteSignedFile"]);
|
||||
}
|
||||
|
||||
var success = await _systemDocumentRepository.DeleteFromQueryAsync(t => t.Id == systemDocumentId, true, true);
|
||||
|
||||
return ResponseOutput.Result(true);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取需要签署的系统文档列表
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<UnionDocumentWithConfirmInfoView>> getWaitSignSysDocList(SystemDocumentQuery inQuery)
|
||||
{
|
||||
|
||||
var isInternal = _userInfo.IsZhiZhun;
|
||||
|
||||
var query = from sysDoc in _systemDocumentRepository.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
//外部人员 只签署 文档类型枚举值有值的
|
||||
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = _userInfo.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
|
||||
join user in _userRoleRepository.Where() on _userInfo.Id equals user.Id
|
||||
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
IsSystemDoc = true,
|
||||
|
||||
Id = sysDoc.Id,
|
||||
CreateTime = sysDoc.CreateTime,
|
||||
IsDeleted = sysDoc.IsDeleted,
|
||||
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
|
||||
Name = sysDoc.Name,
|
||||
Path = sysDoc.Path,
|
||||
FileType = _userInfo.IsEn_Us ? sysDoc.FileType.Value : sysDoc.FileType.ValueCN,
|
||||
UpdateTime = sysDoc.UpdateTime,
|
||||
|
||||
FullFilePath = sysDoc.Path,
|
||||
|
||||
ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = user.LastName + " / " + user.FirstName,
|
||||
UserName = user.UserName,
|
||||
UserTypeId = user.UserTypeId,
|
||||
UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
||||
};
|
||||
|
||||
return await query.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null)
|
||||
.ToPagedListAsync(inQuery);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,855 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2022-01-05 09:17:03
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
/// <summary>
|
||||
/// TrialDocumentService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TrialDocumentService(IRepository<TrialDocument> _trialDocumentRepository,
|
||||
IRepository<TrialDocConfirmedUser> _trialDocUserTypeConfirmedUserRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
ISystemDocumentService _systemDocumentService,
|
||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
||||
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<SystemDocument> _systemDocumentRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialDocConfirmedUser> _trialDocConfirmedUserRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialDocumentService
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Setting 界面的 项目所有文档列表
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialDocumentView>> GetTrialDocumentList(TrialDocumentQuery inQuery)
|
||||
{
|
||||
|
||||
var trialDocumentQueryable = _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId))
|
||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
||||
.ProjectTo<TrialDocumentView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
return await trialDocumentQueryable.ToPagedListAsync(inQuery);
|
||||
}
|
||||
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<TrialSignDocView>> GetTrialSignDocumentList(TrialDocQuery inQuery)
|
||||
{
|
||||
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true)
|
||||
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join confirm in _trialDocConfirmedUserRepository.Where() on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new TrialSignDocView()
|
||||
{
|
||||
TrialCode = trialDoc.Trial.TrialCode,
|
||||
ResearchProgramNo = trialDoc.Trial.ResearchProgramNo,
|
||||
ExperimentName = trialDoc.Trial.ExperimentName,
|
||||
Id = trialDoc.Id,
|
||||
IsSystemDoc = false,
|
||||
CreateTime = trialDoc.CreateTime,
|
||||
FullFilePath = trialDoc.Path,
|
||||
IsDeleted = trialDoc.IsDeleted,
|
||||
Name = trialDoc.Name,
|
||||
Path = trialDoc.Path,
|
||||
FileTypeId = trialDoc.FileTypeId,
|
||||
FileType = _userInfo.IsEn_Us ? trialDoc.FileType.Value : trialDoc.FileType.ValueCN,
|
||||
UpdateTime = trialDoc.UpdateTime,
|
||||
SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
|
||||
|
||||
//IsConfirmed = confirm.ConfirmTime != null,
|
||||
ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = trialUser.UserRole.FullName,
|
||||
UserName = trialUser.UserRole.UserName,
|
||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||
|
||||
};
|
||||
|
||||
trialDocQueryable = trialDocQueryable.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null);
|
||||
|
||||
|
||||
return await trialDocQueryable.ToPagedListAsync(inQuery);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取下一个未签名的文件
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<UnionDocumentWithConfirmInfoView?> GetNextUnSignDocument(GetNextUnSignDocumentInDto inDto)
|
||||
{
|
||||
var result = new PageOutput<UnionDocumentWithConfirmInfoView>() { };
|
||||
|
||||
if (inDto.TrialId != null)
|
||||
{
|
||||
result = (await this.GetUserDocumentList(new TrialUserDocUnionQuery()
|
||||
{
|
||||
Asc = inDto.Asc,
|
||||
IsSign = false,
|
||||
SortField = inDto.SortField,
|
||||
TrialId = inDto.TrialId.Value,
|
||||
PageIndex = 1,
|
||||
PageSize = 1,
|
||||
})).Data;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = await _systemDocumentService.getWaitSignSysDocList(new SystemDocumentQuery()
|
||||
{
|
||||
PageIndex = 1,
|
||||
IsSigned = false,
|
||||
PageSize = 1,
|
||||
Asc = false,
|
||||
SortField = "UpdateTime",
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (result.CurrentPageData.Count > 0)
|
||||
{
|
||||
return result.CurrentPageData.First();
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 具体用户看到的 系统文件列表 + 项目类型文档
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetUserDocumentList(TrialUserDocUnionQuery inQuery)
|
||||
{
|
||||
#region https://github.com/dotnet/efcore/issues/16243 操作不行
|
||||
////系统文档查询
|
||||
//var systemDocumentQueryable = _systemDocumentRepository
|
||||
// .WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
// .WhereIf(!_userInfo.IsAdmin, t => t.IsAbandon == false || (t.IsAbandon == true && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
||||
//.ProjectTo<UnionDocumentView>(_mapper.ConfigurationProvider, new { userId = _userInfo.Id, token = _userInfo.UserToken });
|
||||
|
||||
////项目文档查询
|
||||
//var trialDocQueryable = _trialDocumentRepository.Where(t => t.TrialId == querySystemDocument.TrialId)
|
||||
// .WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
// .WhereIf(!_userInfo.IsAdmin, t => t.IsAbandon == false || (t.IsAbandon == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
||||
// .ProjectTo<UnionDocumentView>(_mapper.ConfigurationProvider, new { userId = _userInfo.Id, token = _userInfo.UserToken });
|
||||
|
||||
//var unionQuery = systemDocumentQueryable.Union(trialDocQueryable);
|
||||
// .WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
||||
// .WhereIf(!string.IsNullOrEmpty(querySystemDocument.Type), t => t.Type.Contains(querySystemDocument.Type));
|
||||
#endregion
|
||||
|
||||
#region 仅仅文档信息
|
||||
|
||||
////系统文档查询
|
||||
//var systemDocumentQueryable = _systemDocumentRepository
|
||||
// .WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
// .WhereIf(!_userInfo.IsAdmin, t => t.IsAbandon == false || (t.IsAbandon == true && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
||||
// .Select(t => new UnionDocumentView()
|
||||
// {
|
||||
// Id = t.Id,
|
||||
// IsSystemDoc = true,
|
||||
// CreateTime = t.CreateTime,
|
||||
// FullFilePath = t.Path + "?access_token=" + _userInfo.UserToken,
|
||||
// IsAbandon = t.IsAbandon,
|
||||
// Name = t.Name,
|
||||
// Path = t.Path,
|
||||
// Type = t.Type,
|
||||
// UpdateTime = t.UpdateTime,
|
||||
// SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
||||
|
||||
// });
|
||||
|
||||
////项目文档查询
|
||||
//var trialDocQueryable = _trialDocumentRepository.Where(t => t.TrialId == querySystemDocument.TrialId)
|
||||
// .WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
// .WhereIf(!_userInfo.IsAdmin, t => t.IsAbandon == false || (t.IsAbandon == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
||||
// .Select(t => new UnionDocumentView()
|
||||
// {
|
||||
// Id = t.Id,
|
||||
// IsSystemDoc = false,
|
||||
// CreateTime = t.CreateTime,
|
||||
// FullFilePath = t.Path + "?access_token=" + _userInfo.UserToken,
|
||||
// IsAbandon = t.IsAbandon,
|
||||
// Name = t.Name,
|
||||
// Path = t.Path,
|
||||
// Type = t.Type,
|
||||
// UpdateTime = t.UpdateTime,
|
||||
// SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
||||
|
||||
// });
|
||||
|
||||
#endregion
|
||||
|
||||
var trialId = inQuery.TrialId;
|
||||
|
||||
var trialInfo = await (_trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
|
||||
//系统文档查询
|
||||
var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId, ignoreQueryFilters: true)
|
||||
.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.Id)
|
||||
on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmedUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
IsSystemDoc = true,
|
||||
|
||||
Id = needConfirmedUserType.SystemDocument.Id,
|
||||
CreateTime = needConfirmedUserType.SystemDocument.CreateTime,
|
||||
IsDeleted = needConfirmedUserType.SystemDocument.IsDeleted,
|
||||
SignViewMinimumMinutes = needConfirmedUserType.SystemDocument.SignViewMinimumMinutes,
|
||||
Name = needConfirmedUserType.SystemDocument.Name,
|
||||
Path = needConfirmedUserType.SystemDocument.Path,
|
||||
FileTypeId = needConfirmedUserType.SystemDocument.FileTypeId,
|
||||
FileType = _userInfo.IsEn_Us ? needConfirmedUserType.SystemDocument.FileType.Value : needConfirmedUserType.SystemDocument.FileType.ValueCN,
|
||||
UpdateTime = needConfirmedUserType.SystemDocument.UpdateTime,
|
||||
|
||||
FullFilePath = needConfirmedUserType.SystemDocument.Path,
|
||||
|
||||
//IsConfirmed = confirm.ConfirmTime != null,
|
||||
ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = trialUser.UserRole.FullName,
|
||||
UserName = trialUser.UserRole.UserName,
|
||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||
};
|
||||
|
||||
//项目文档查询
|
||||
var trialDocQueryable = from trialDoc in _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id)))
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.Id) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
Id = trialDoc.Id,
|
||||
IsSystemDoc = false,
|
||||
CreateTime = trialDoc.CreateTime,
|
||||
FullFilePath = trialDoc.Path,
|
||||
IsDeleted = trialDoc.IsDeleted,
|
||||
Name = trialDoc.Name,
|
||||
Path = trialDoc.Path,
|
||||
FileTypeId = trialDoc.FileTypeId,
|
||||
FileType = _userInfo.IsEn_Us ? trialDoc.FileType.Value : trialDoc.FileType.ValueCN,
|
||||
UpdateTime = trialDoc.UpdateTime,
|
||||
SignViewMinimumMinutes = trialDoc.SignViewMinimumMinutes,
|
||||
|
||||
//IsConfirmed = confirm.ConfirmTime != null,
|
||||
ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = trialUser.UserRole.FullName,
|
||||
UserName = trialUser.UserRole.UserName,
|
||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||
|
||||
};
|
||||
|
||||
#region 报错 奇怪的bug
|
||||
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
.WhereIf(inQuery.IsSign == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(inQuery.IsSign == false, t => t.ConfirmTime == null);
|
||||
|
||||
|
||||
|
||||
var result = await unionQuery.ToPagedListAsync(inQuery);
|
||||
#endregion
|
||||
|
||||
#region 临时方案
|
||||
|
||||
//var list1 = systemDocumentQueryable
|
||||
// .WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
||||
// .WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
|
||||
// .WhereIf(querySystemDocument.IsSign == true, t => t.ConfirmTime != null)
|
||||
// .WhereIf(querySystemDocument.IsSign == false, t => t.ConfirmTime == null).ToList();
|
||||
|
||||
//var list2 = trialDocQueryable
|
||||
// .WhereIf(!string.IsNullOrEmpty(querySystemDocument.Name), t => t.Name.Contains(querySystemDocument.Name))
|
||||
//.WhereIf(querySystemDocument.FileTypeId != null, t => t.FileTypeId == querySystemDocument.FileTypeId)
|
||||
//.WhereIf(querySystemDocument.IsSign == true, t => t.ConfirmTime != null)
|
||||
//.WhereIf(querySystemDocument.IsSign == false, t => t.ConfirmTime == null).ToList();
|
||||
|
||||
//var list3 = list1.Union(list2).ToList();
|
||||
|
||||
//var result=list3.ToPagedList(querySystemDocument.PageIndex, querySystemDocument.PageSize, querySystemDocument.SortField, querySystemDocument.Asc);
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true).Where(t => t.TrialId == inQuery.TrialId && t.Trial.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.CountAsync();
|
||||
|
||||
|
||||
var needSignSystemDocCount = await _systemDocumentRepository
|
||||
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.CountAsync();
|
||||
|
||||
var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo<TrialProcessConfigDTO>(_mapper.ConfigurationProvider).FirstOrDefault();
|
||||
|
||||
|
||||
|
||||
var isManualGenerateTask = _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsSigned && t.IsAutoCreate == false).Any();
|
||||
var isAdditionalAssessment = _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsSigned && t.IsAdditionalAssessment == true
|
||||
&& t.TrialCriterionAdditionalAssessmentTypeList.Any(c =>/*c.AdditionalAssessmentType==Domain.Share.Reading.AdditionalAssessmentType.BrainMetastasis &&*/ c.IsSelected == true)).Any();
|
||||
|
||||
return ResponseOutput.Ok<PageOutput<UnionDocumentWithConfirmInfoView>>(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, IsAdditionalAssessment = isAdditionalAssessment && isManualGenerateTask, TrialStatusStr = trialInfo.TrialStatusStr, TrialConfig = trialTaskConfig });
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取确认列表情况 项目文档+系统文档+具体的人
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<UnionDocumentWithConfirmInfoView>>> GetDocumentConfirmList(DocumentTrialUnionQuery inQuery)
|
||||
{
|
||||
|
||||
|
||||
#region linq join 方式
|
||||
//var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocumentNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == querySystemDocument.TrialId)
|
||||
// join trialUser in _trialUserRepository.Where(t => t.TrialId == querySystemDocument.TrialId)
|
||||
// .WhereIf(querySystemDocument.UserId != null, t => t.UserId == querySystemDocument.UserId)
|
||||
// on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
||||
|
||||
// join confirm in _trialDocuserConfrimedRepository.AsQueryable() on trialUser.UserId equals confirm.ConfirmUserId into cc
|
||||
// from confirm in cc.DefaultIfEmpty()
|
||||
// select new UnionDocumentConfirmListView()
|
||||
// {
|
||||
// Id = trialDocumentNeedConfirmedUserType.TrialDocument.Id,
|
||||
// CreateTime = trialDocumentNeedConfirmedUserType.TrialDocument.CreateTime,
|
||||
// IsAbandon = trialDocumentNeedConfirmedUserType.TrialDocument.IsAbandon,
|
||||
// SignViewMinimumMinutes = trialDocumentNeedConfirmedUserType.TrialDocument.SignViewMinimumMinutes,
|
||||
// Name = trialDocumentNeedConfirmedUserType.TrialDocument.Name,
|
||||
// Path = trialDocumentNeedConfirmedUserType.TrialDocument.Path,
|
||||
// Type = trialDocumentNeedConfirmedUserType.TrialDocument.Type,
|
||||
// UpdateTime = trialDocumentNeedConfirmedUserType.TrialDocument.UpdateTime,
|
||||
|
||||
// UserConfirmInfo = /*confirm == null ? null : */new UnionDocumentUserConfirmView()
|
||||
// {
|
||||
|
||||
// ConfirmUserId = confirm.ConfirmUserId,
|
||||
// ConfirmTime = confirm.ConfirmTime,
|
||||
// RealName = trialUser.User.LastName + " / " + trialUser.User.LastName,
|
||||
// UserName = trialUser.User.UserName,
|
||||
// },
|
||||
|
||||
// FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path + "?access_token=" + _userInfo.UserToken
|
||||
// };
|
||||
|
||||
#endregion
|
||||
|
||||
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
|
||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserRole.UserTypeId == inQuery.UserTypeId)
|
||||
on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
|
||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDocumentNeedConfirmedUserType.TrialDocumentId } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
IsSystemDoc = false,
|
||||
|
||||
Id = trialDocumentNeedConfirmedUserType.TrialDocument.Id,
|
||||
CreateTime = trialDocumentNeedConfirmedUserType.TrialDocument.CreateTime,
|
||||
IsDeleted = trialDocumentNeedConfirmedUserType.TrialDocument.IsDeleted,
|
||||
SignViewMinimumMinutes = trialDocumentNeedConfirmedUserType.TrialDocument.SignViewMinimumMinutes,
|
||||
Name = trialDocumentNeedConfirmedUserType.TrialDocument.Name,
|
||||
Path = trialDocumentNeedConfirmedUserType.TrialDocument.Path,
|
||||
FileTypeId = trialDocumentNeedConfirmedUserType.TrialDocument.FileTypeId,
|
||||
FileType = _userInfo.IsEn_Us ? trialDocumentNeedConfirmedUserType.TrialDocument.FileType.Value : trialDocumentNeedConfirmedUserType.TrialDocument.FileType.ValueCN,
|
||||
UpdateTime = trialDocumentNeedConfirmedUserType.TrialDocument.UpdateTime,
|
||||
//IsConfirmed= confirm.ConfirmTime!=null,
|
||||
|
||||
|
||||
|
||||
ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = trialUser.UserRole.FullName,
|
||||
UserName = trialUser.UserRole.UserName,
|
||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||
|
||||
FullFilePath = trialDocumentNeedConfirmedUserType.TrialDocument.Path
|
||||
};
|
||||
|
||||
|
||||
|
||||
var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
IsSystemDoc = true,
|
||||
|
||||
Id = needConfirmEdUserType.SystemDocument.Id,
|
||||
CreateTime = needConfirmEdUserType.SystemDocument.CreateTime,
|
||||
IsDeleted = needConfirmEdUserType.SystemDocument.IsDeleted,
|
||||
SignViewMinimumMinutes = needConfirmEdUserType.SystemDocument.SignViewMinimumMinutes,
|
||||
Name = needConfirmEdUserType.SystemDocument.Name,
|
||||
Path = needConfirmEdUserType.SystemDocument.Path,
|
||||
FileType = _userInfo.IsEn_Us ? needConfirmEdUserType.SystemDocument.FileType.Value : needConfirmEdUserType.SystemDocument.FileType.ValueCN,
|
||||
FileTypeId = needConfirmEdUserType.SystemDocument.FileTypeId,
|
||||
UpdateTime = needConfirmEdUserType.SystemDocument.UpdateTime,
|
||||
//IsConfirmed = confirm.ConfirmTime != null,
|
||||
|
||||
ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = trialUser.UserRole.FullName,
|
||||
UserName = trialUser.UserRole.UserName,
|
||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||
|
||||
FullFilePath = needConfirmEdUserType.SystemDocument.Path
|
||||
};
|
||||
|
||||
var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmUserId == null))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId)
|
||||
.WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null)
|
||||
.WhereIf(inQuery.IsConfirmed == false, t => t.ConfirmTime == null)
|
||||
.WhereIf(inQuery.IsDeleted != null, t => t.IsDeleted == inQuery.IsDeleted)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserTypeId == inQuery.UserTypeId);
|
||||
|
||||
var result = await unionQuery.ToPagedListAsync(inQuery);
|
||||
|
||||
var needSignTrialDocCount = await _trialDocumentRepository.AsQueryable(true)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsDeleted == false && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.CountAsync();
|
||||
|
||||
|
||||
var needSignSystemDocCount = await _systemDocumentRepository
|
||||
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id) && t.NeedConfirmedUserTypeList.Any(u => u.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.CountAsync();
|
||||
|
||||
|
||||
return ResponseOutput.Ok(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr });
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 项目下面的参与用户下拉
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
||||
{
|
||||
return await _trialUserRepository.Where(t => t.TrialId == trialId)
|
||||
.Select(t => new TrialUserDto() { UserId = t.UserId, RealName = t.UserRole.FullName, UserName = t.UserRole.UserName })
|
||||
.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 项目+系统的文档类型 下拉
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<IResponseOutput> GetTrialDocAndSystemDocType(Guid trialId)
|
||||
{
|
||||
var result = await _trialDocumentRepository.Where(t => t.TrialId == trialId).Select(t => new { FileType = _userInfo.IsEn_Us ? t.FileType.Value : t.FileType.ValueCN, t.FileTypeId })
|
||||
.Union(_systemDocumentRepository.Select(t => new { FileType = _userInfo.IsEn_Us ? t.FileType.Value : t.FileType.ValueCN, t.FileTypeId }))
|
||||
.ToListAsync();
|
||||
|
||||
return ResponseOutput.Ok(result);
|
||||
}
|
||||
|
||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
||||
//[Authorize(Policy = IRaCISPolicy.PM)]
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialDocument(AddOrEditTrialDocument addOrEditTrialDocument)
|
||||
{
|
||||
if (addOrEditTrialDocument.Id == null)
|
||||
{
|
||||
var entity = _mapper.Map<TrialDocument>(addOrEditTrialDocument);
|
||||
|
||||
|
||||
if (await _trialDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditTrialDocument.FileTypeId && t.Name == addOrEditTrialDocument.Name && t.TrialId == addOrEditTrialDocument.TrialId, true))
|
||||
{
|
||||
//---该项目中已经存在同类型的同名文件。
|
||||
return ResponseOutput.NotOk(_localizer["TrialD_DuplicateFileInProject"]);
|
||||
}
|
||||
|
||||
//entity.Id = NewId.NextGuid();
|
||||
await _trialDocumentRepository.AddAsync(entity, true);
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (await _trialDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditTrialDocument.FileTypeId && t.Name == addOrEditTrialDocument.Name && t.Id != addOrEditTrialDocument.Id && t.TrialId == addOrEditTrialDocument.TrialId, true))
|
||||
{
|
||||
//---该项目中已经存在同类型的同名文件。
|
||||
return ResponseOutput.NotOk(_localizer["TrialD_DuplicateFileInProject"]);
|
||||
}
|
||||
|
||||
var document = (await _trialDocumentRepository.Where(t => t.Id == addOrEditTrialDocument.Id, true).Include(t => t.NeedConfirmedUserTypeList).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
|
||||
|
||||
_mapper.Map(addOrEditTrialDocument, document);
|
||||
|
||||
#region 不区分路径了
|
||||
|
||||
//if (document.FileTypeId != addOrEditTrialDocument.FileTypeId)
|
||||
//{
|
||||
|
||||
|
||||
// var rootPath = Directory.GetParent(_hostEnvironment.ContentRootPath.TrimEnd('\\')).IfNullThrowException().FullName;
|
||||
// var beforeFilePath = Path.Combine(rootPath, document.Path);
|
||||
|
||||
// document.Path = document.Path.Replace(document.FileTypeId.ToString(), addOrEditTrialDocument.FileTypeId.ToString());
|
||||
|
||||
// var nowPath = Path.Combine(rootPath, document.Path);
|
||||
|
||||
// if (File.Exists(beforeFilePath))
|
||||
// {
|
||||
// File.Move(beforeFilePath, nowPath, true);
|
||||
// File.Delete(beforeFilePath);
|
||||
// }
|
||||
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
var success = await _trialDocumentRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(document.Id.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 已签名的文档 不允许删除
|
||||
/// </summary>
|
||||
/// <param name="trialDocumentId"></param>
|
||||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{trialId:guid}/{trialDocumentId:guid}")]
|
||||
//[Authorize(Policy = IRaCISPolicy.PM)]
|
||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
||||
public async Task<IResponseOutput> DeleteTrialDocument(Guid trialDocumentId, Guid trialId)
|
||||
{
|
||||
if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any()))
|
||||
{
|
||||
//---已有用户阅读该文档,并签名,不允许删除。
|
||||
return ResponseOutput.NotOk(_localizer["TrialD_DocumentHasAlready"]);
|
||||
}
|
||||
|
||||
var success = await _trialDocumentRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialDocumentId);
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 浏览文档说明时调用,记录第一次看的时间
|
||||
/// </summary>
|
||||
/// <param name="documentId"></param>
|
||||
/// <param name="isSystemDoc"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("{trialId:guid}/{documentId:guid}/{isSystemDoc:bool}")]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> SetFirstViewDocumentTime(Guid documentId, bool isSystemDoc)
|
||||
{
|
||||
|
||||
var success = false;
|
||||
if (isSystemDoc)
|
||||
{
|
||||
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
||||
{
|
||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
if (!await _trialDocUserTypeConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
||||
{
|
||||
|
||||
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
success = await _systemDocConfirmedUserRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(success);
|
||||
}
|
||||
|
||||
[HttpPut("{documentId:guid}")]
|
||||
public async Task<IResponseOutput> SetSystemDocFirstViewTime(Guid documentId)
|
||||
{
|
||||
if (!await _systemDocConfirmedUserRepository.AnyAsync(t => t.SystemDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
||||
{
|
||||
await _systemDocConfirmedUserRepository.AddAsync(new SystemDocConfirmedUser() { SystemDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
|
||||
}
|
||||
|
||||
var success = await _systemDocConfirmedUserRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(success);
|
||||
}
|
||||
|
||||
[HttpPut("{trialId:guid}/{documentId:guid}")]
|
||||
public async Task<IResponseOutput> SetTrialDocFirstViewTime(Guid documentId)
|
||||
{
|
||||
if (!await _trialDocUserTypeConfirmedUserRepository.AnyAsync(t => t.TrialDocumentId == documentId && t.ConfirmUserId == _userInfo.Id))
|
||||
{
|
||||
|
||||
await _trialDocConfirmedUserRepository.AddAsync(new TrialDocConfirmedUser() { TrialDocumentId = documentId, ConfirmUserId = _userInfo.Id, SignFirstViewTime = DateTime.Now });
|
||||
|
||||
}
|
||||
var success = await _trialDocConfirmedUserRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Ok(success);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户 签名某个文档 可能是系统的,也可能是项目的
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt" )]
|
||||
public async Task<IResponseOutput> UserConfirm(UserConfirmCommand userConfirmCommand)
|
||||
{
|
||||
|
||||
if (userConfirmCommand.isSystemDoc)
|
||||
{
|
||||
|
||||
var sysDocConfirm = await _systemDocConfirmedUserRepository.FirstOrDefaultAsync(t => t.SystemDocumentId == userConfirmCommand.DocumentId && t.ConfirmUserId == _userInfo.Id, true);
|
||||
|
||||
if (sysDocConfirm.ConfirmTime != null)
|
||||
{
|
||||
//---该文件已经签名
|
||||
return ResponseOutput.NotOk(_localizer["TrialD_FileAlreadySigned"]);
|
||||
}
|
||||
|
||||
if (sysDocConfirm.IsDeleted)
|
||||
{
|
||||
//---文件已废除,签署失败!
|
||||
return ResponseOutput.NotOk(_localizer["TrialD_ObsoleteFile"]);
|
||||
}
|
||||
|
||||
|
||||
sysDocConfirm.ConfirmTime = DateTime.Now;
|
||||
sysDocConfirm.SignText = userConfirmCommand.SignText;
|
||||
|
||||
|
||||
|
||||
await _systemDocConfirmedUserRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
var trialDocConfirm = await _trialDocUserTypeConfirmedUserRepository.FirstOrDefaultAsync(t => t.TrialDocumentId == userConfirmCommand.DocumentId && t.ConfirmUserId == _userInfo.Id, true);
|
||||
|
||||
if (trialDocConfirm.ConfirmTime != null)
|
||||
{
|
||||
//---该文件已经签名
|
||||
return ResponseOutput.NotOk(_localizer["TrialD_FileAlreadySigned"]);
|
||||
}
|
||||
|
||||
if (trialDocConfirm.IsDeleted)
|
||||
{
|
||||
//---文件已废除,签署失败!
|
||||
return ResponseOutput.NotOk(_localizer["TrialD_ObsoleteFile"]);
|
||||
}
|
||||
|
||||
trialDocConfirm.ConfirmTime = DateTime.Now;
|
||||
trialDocConfirm.SignText = userConfirmCommand.SignText;
|
||||
|
||||
await _trialDocUserTypeConfirmedUserRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户 废除某个文档
|
||||
/// </summary>
|
||||
/// <param name="documentId"></param>
|
||||
/// <param name="isSystemDoc"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPut("{documentId:guid}/{isSystemDoc:bool}")]
|
||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "AfterStopCannNotOpt", "SignSystemDocNoTrialId" )]
|
||||
public async Task<IResponseOutput> UserAbandonDoc(Guid documentId, bool isSystemDoc)
|
||||
{
|
||||
if (isSystemDoc)
|
||||
{
|
||||
await _systemDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new SystemDocument() { IsDeleted = true });
|
||||
await _systemDocConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.SystemDocumentId == documentId, x => new SystemDocConfirmedUser()
|
||||
{
|
||||
IsDeleted = true
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
await _trialDocumentRepository.UpdatePartialFromQueryAsync(documentId, u => new TrialDocument() { IsDeleted = true });
|
||||
await _trialDocUserTypeConfirmedUserRepository.UpdatePartialFromQueryAsync(x => x.TrialDocumentId == documentId, x => new TrialDocConfirmedUser()
|
||||
{
|
||||
IsDeleted = true
|
||||
});
|
||||
}
|
||||
await _systemDocumentRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
#region 废弃
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 从项目下参与者的维度 先看人员列表(展示统计数字) 点击数字 再看人员具体签署的 系统文档+项目文档(共用上面与人相关的具体文档列表)
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{trialId:guid}")]
|
||||
[Obsolete]
|
||||
public List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId)
|
||||
{
|
||||
var query = _trialUserRepository.Where(t => t.TrialId == trialId)
|
||||
.Select(t => new TrialUserUnionDocumentView()
|
||||
{
|
||||
UserId = t.UserId,
|
||||
UserName = t.UserRole.UserName,
|
||||
RealName = t.UserRole.FullName,
|
||||
UserTypeShortName = t.UserRole.UserTypeRole.UserTypeShortName,
|
||||
TrialDocumentCount = t.Trial.TrialDocumentList.Count(u => u.NeedConfirmedUserTypeList.Any(k => k.NeedConfirmUserTypeId == t.UserRole.UserTypeId)),
|
||||
TrialDocumentConfirmedCount = t.Trial.TrialDocumentList.SelectMany(u => u.TrialDocConfirmedUserList).Count(k => k.ConfirmUserId == t.UserId),
|
||||
SystemDocumentConfirmedCount = t.UserRole.SystemDocConfirmedList.Count(),
|
||||
//这样写不行
|
||||
//SystemDocumentCount = _systemDocumentRepository.Where(s => s.NeedConfirmedUserTypeList.Any(kk => kk.NeedConfirmUserTypeId == t.User.UserTypeId))
|
||||
// .WhereIf(!_userInfo.IsAdmin, s => s.IsAbandon == false || (s.IsAbandon == true && s.SystemDocConfirmedUserList.Any(uu => uu.ConfirmUserId == t.UserId))).Count()
|
||||
SystemDocumentCount = t.UserRole.UserTypeRole.SystemDocNeedConfirmedUserTypeList.Where(cc => cc.NeedConfirmUserTypeId == t.UserRole.UserTypeId).Select(y => y.SystemDocument).Count()
|
||||
});
|
||||
|
||||
return query.ToList();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 从 文档的维度 先看到文档列表(系统文档+项目文档 以及需要确认的人数 和已经确认人数) 点击数字查看某文档下面人确认情况
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[Obsolete]
|
||||
public async Task<PageOutput<DocumentUnionWithUserStatView>> GetTrialSystemDocumentList(DocumentTrialUnionQuery inQuery)
|
||||
{
|
||||
var systemDocumentQueryable = _systemDocumentRepository
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false)
|
||||
.Select(t => new DocumentUnionWithUserStatView()
|
||||
{
|
||||
Id = t.Id,
|
||||
IsSystemDoc = true,
|
||||
CreateTime = t.CreateTime,
|
||||
FullFilePath = t.Path,
|
||||
IsDeleted = t.IsDeleted,
|
||||
Name = t.Name,
|
||||
Path = t.Path,
|
||||
FileType = t.FileType.Value,
|
||||
UpdateTime = t.UpdateTime,
|
||||
SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
||||
DocumentConfirmedUserCount = t.SystemDocConfirmedUserList.Count(),
|
||||
|
||||
//DocumentUserCount= _trialUserRepository.Where(tu=>tu.TrialId== querySystemDocument.TrialId).Count(u=>t.NeedConfirmedUserTypeList.Any(cc=>cc.NeedConfirmUserTypeId== u.User.UserTypeId ))
|
||||
DocumentUserCount = t.NeedConfirmedUserTypeList.SelectMany(u => u.UserTypeRole.UserList.SelectMany(b => b.UserTrials.Where(r => r.TrialId == inQuery.TrialId))).Count()
|
||||
});
|
||||
|
||||
var trialDocQueryable = _trialDocumentRepository.Where(t => t.TrialId == inQuery.TrialId).Select(t => new DocumentUnionWithUserStatView()
|
||||
{
|
||||
Id = t.Id,
|
||||
IsSystemDoc = false,
|
||||
CreateTime = t.CreateTime,
|
||||
FullFilePath = t.Path,
|
||||
IsDeleted = t.IsDeleted,
|
||||
Name = t.Name,
|
||||
Path = t.Path,
|
||||
FileType = t.FileType.Value,
|
||||
UpdateTime = t.UpdateTime,
|
||||
SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
||||
|
||||
DocumentConfirmedUserCount = t.TrialDocConfirmedUserList.Count(),
|
||||
DocumentUserCount = t.Trial.TrialUserList.Count(cc => t.NeedConfirmedUserTypeList.Any(k => k.NeedConfirmUserTypeId == cc.UserRole.UserTypeId))
|
||||
|
||||
});
|
||||
|
||||
var unionQuery = systemDocumentQueryable.Union(trialDocQueryable)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name))
|
||||
.WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId);
|
||||
|
||||
return await unionQuery.ToPagedListAsync(inQuery);
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -14,40 +14,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var userId = Guid.Empty;
|
||||
var isEn_Us = false;
|
||||
|
||||
CreateMap<SystemDocument, SystemDocumentView>()
|
||||
.ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value : s.FileType.ValueCN))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
|
||||
|
||||
CreateMap<TrialDocument, TrialDocumentView>()
|
||||
.ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value : s.FileType.ValueCN))
|
||||
.ForMember(d => d.IsSomeUserSigned, u => u.MapFrom(s => s.TrialDocConfirmedUserList.Any(t => t.ConfirmTime != null)))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
|
||||
|
||||
|
||||
CreateMap<SystemDocument, UnionDocumentView>()
|
||||
.ForMember(d => d.IsSystemDoc, u => u.MapFrom(s => true))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
|
||||
|
||||
CreateMap<TrialDocument, UnionDocumentView>()
|
||||
.ForMember(d => d.IsSystemDoc, u => u.MapFrom(s => false))
|
||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path));
|
||||
|
||||
CreateMap<TrialDocNeedConfirmedUserType, NeedConfirmedUserTypeView>().ForMember(d => d.UserTypeShortName, t => t.MapFrom(c => c.UserTypeRole.UserTypeShortName));
|
||||
CreateMap<SystemDocNeedConfirmedUserType, NeedConfirmedUserTypeView>().ForMember(d => d.UserTypeShortName, t => t.MapFrom(c => c.UserTypeRole.UserTypeShortName));
|
||||
|
||||
|
||||
//CreateMap<TrialDocument, TrialDocumentUserView>()
|
||||
// .ForMember(t => t.UserConfirmInfo, c => c.MapFrom(t => t.TrialDocConfirmedUserList.Where(u => u.ConfirmUserId == userId).FirstOrDefault()))
|
||||
// .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token)); ;
|
||||
|
||||
CreateMap<TrialDocConfirmedUser, TrialDocumentUserConfirmView>()
|
||||
.ForMember(d => d.UserName, c => c.MapFrom(t => t.User.UserName))
|
||||
.ForMember(d => d.RealName, c => c.MapFrom(t => t.User.FullName));
|
||||
|
||||
//CreateMap<SystemDocConfirmedUser, SystemDocumentUserConfirmView>()
|
||||
// .ForMember(d => d.UserName, c => c.MapFrom(t => t.User.UserName))
|
||||
// .ForMember(d => d.RealName, c => c.MapFrom(t => t.User.LastName + " / " + t.User.FirstName));
|
||||
|
||||
|
||||
|
||||
CreateMap<TrialUserRole, TrialDocumentUserConfirmView>();
|
||||
|
||||
|
|
@ -56,20 +23,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<TrialSelectEmailNoticeConfigView, BatchAddTrialEmailNoticeConfig > ();
|
||||
|
||||
|
||||
CreateMap<AddOrEditTrialDocument, TrialDocument>()
|
||||
.ForMember(d => d.NeedConfirmedUserTypeList, c => c.MapFrom(t => t.NeedConfirmedUserTypeIdList));
|
||||
|
||||
CreateMap<Guid, TrialDocNeedConfirmedUserType>().EqualityComparison((odto, o) => odto == o.NeedConfirmUserTypeId)
|
||||
.ForMember(d => d.NeedConfirmUserTypeId, c => c.MapFrom(t => t))
|
||||
.ForMember(d => d.TrialDocumentId, c => c.Ignore());
|
||||
|
||||
|
||||
|
||||
CreateMap<AddOrEditSystemDocument, SystemDocument>().ForMember(d => d.NeedConfirmedUserTypeList, c => c.MapFrom(t => t.NeedConfirmedUserTypeIdList));
|
||||
CreateMap<Guid, SystemDocNeedConfirmedUserType>().EqualityComparison((odto, o) => odto == o.NeedConfirmUserTypeId)
|
||||
.ForMember(d => d.NeedConfirmUserTypeId, c => c.MapFrom(t => t))
|
||||
.ForMember(d => d.SystemDocumentId, c => c.Ignore());
|
||||
|
||||
|
||||
CreateMap<TrialEmailNoticeConfig, TrialEmailNoticeConfigView>()
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
SowPath = "",
|
||||
SowName = "",
|
||||
UpdateTime = DateTime.Now,
|
||||
UpdateUserId = _userInfo.Id
|
||||
UpdateUserId = _userInfo.UserRoleId
|
||||
});
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
|
|
|
|||
|
|
@ -65,19 +65,19 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageUploadEnum != ReadingImageUpload.None))))
|
||||
{
|
||||
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
||||
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
||||
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskBlindName == "Timepoint" && t.ReadingCategory == ReadingCategory.Visit
|
||||
&& (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze), true).ToListAsync();
|
||||
|
||||
if (needDealTaskList.Count > 0)
|
||||
{
|
||||
//已完成的访视任务数量(包含重阅的)
|
||||
var haveFinishedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
var haveFinishedTaskCount = await _visitTaskRepository.CountAsync(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit);
|
||||
|
||||
//已经处理过的任务名称的数量
|
||||
|
||||
var haveDealedTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.Id
|
||||
var haveDealedTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
||||
&& t.ReadingTaskState != ReadingTaskState.HaveSigned && t.ReadingCategory == ReadingCategory.Visit && t.TaskBlindName != "Timepoint").Select(t => new { t.TaskBlindName, t.SourceSubjectVisitId, t.SouceReadModuleId }).ToListAsync();
|
||||
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SourceSubjectVisitId != null
|
||||
&& t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||
&& t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect)
|
||||
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
||||
.WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId)
|
||||
.Select(u => new SubjectImageUploadDTO()
|
||||
|
|
@ -402,7 +402,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
else
|
||||
{
|
||||
//在事务未完成前 防止前端重复提交
|
||||
await _fusionCache.SetAsync(CacheKeys.TrialTaskStudyUidDBLock(incommand.TrialId, incommand.VisitTaskId, incommand.Study.StudyInstanceUid), _userInfo.Id, TimeSpan.FromMinutes(1));
|
||||
await _fusionCache.SetAsync(CacheKeys.TrialTaskStudyUidDBLock(incommand.TrialId, incommand.VisitTaskId, incommand.Study.StudyInstanceUid), _userInfo.UserRoleId, TimeSpan.FromMinutes(1));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -653,7 +653,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
{
|
||||
var subjectCode = inQuery.SubjectCode;
|
||||
var subjectId = inQuery.SubjectId;
|
||||
var doctorUserId = _userInfo.Id;
|
||||
var doctorUserId = _userInfo.UserRoleId;
|
||||
|
||||
if (inQuery.VisitTaskId != null)
|
||||
{
|
||||
|
|
@ -839,7 +839,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
public async Task<List<SubjectCRCImageUploadedStudyDto>> GetSubjectImageDownloadSelectList(IRReadingDownloadQuery inQuery)
|
||||
{
|
||||
|
||||
var doctorUserId = _userInfo.Id;
|
||||
var doctorUserId = _userInfo.UserRoleId;
|
||||
var isAnalysisCreate = false;
|
||||
|
||||
//要根据标准阅片顺序,确定是否查询单个任务的,还是查询所有的
|
||||
|
|
@ -1538,7 +1538,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
public async Task<List<SubjectUploadTaskInfo>> GetIRUploadTaskList_Old(CRCUploadTaskQuery inQuery)
|
||||
{
|
||||
var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect)
|
||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect)
|
||||
.ProjectTo<SubjectUploadTaskInfo>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -102,18 +102,13 @@ namespace IRaCIS.Core.Application.Services
|
|||
var resource = new ResourceInfo()
|
||||
{
|
||||
StudyId = imageShare.StudyId,
|
||||
Token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo()
|
||||
Token = _tokenService.GetToken(new UserTokenInfo()
|
||||
{
|
||||
Id = Guid.Empty,
|
||||
IsReviewer = false,
|
||||
IsAdmin = false,
|
||||
RealName = "Share001",
|
||||
IdentityUserId = Guid.NewGuid(),
|
||||
FullName = "Share001",
|
||||
UserName = "Share001",
|
||||
Sex = 0,
|
||||
//UserType = "ShareType",
|
||||
UserTypeEnum = UserTypeEnum.ShareImage,
|
||||
Code = "ShareCode001",
|
||||
}))
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -99,20 +99,20 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
if (visitTaskId != null)
|
||||
{
|
||||
var cacheValue = _fusionCache.GetOrDefault<Guid>(CacheKeys.TrialTaskStudyUidUploading(trialId, visitTaskId.Value, studyInstanceUid));
|
||||
if (cacheValue != Guid.Empty && cacheValue != _userInfo.Id)
|
||||
if (cacheValue != Guid.Empty && cacheValue != _userInfo.UserRoleId)
|
||||
{
|
||||
//---当前已有人正在上传和归档该检查!
|
||||
return ResponseOutput.NotOk(I18n.T("UploadDownLoad_ArchiveInProgress"));
|
||||
}
|
||||
else
|
||||
{
|
||||
await _fusionCache.SetAsync(CacheKeys.TrialTaskStudyUidUploading(trialId, visitTaskId.Value, studyInstanceUid), _userInfo.Id, TimeSpan.FromSeconds(15));
|
||||
await _fusionCache.SetAsync(CacheKeys.TrialTaskStudyUidUploading(trialId, visitTaskId.Value, studyInstanceUid), _userInfo.UserRoleId, TimeSpan.FromSeconds(15));
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
await _fusionCache.SetAsync(CacheKeys.TrialStudyUidUploading(trialId, studyInstanceUid), _userInfo.Id, TimeSpan.FromSeconds(15));
|
||||
await _fusionCache.SetAsync(CacheKeys.TrialStudyUidUploading(trialId, studyInstanceUid), _userInfo.UserRoleId, TimeSpan.FromSeconds(15));
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
else
|
||||
{
|
||||
//在事务未完成前 防止前端重复提交
|
||||
await _fusionCache.SetAsync(CacheKeys.TrialStudyUidDBLock(incommand.TrialId, incommand.Study.StudyInstanceUid), _userInfo.Id, TimeSpan.FromMinutes(3));
|
||||
await _fusionCache.SetAsync(CacheKeys.TrialStudyUidDBLock(incommand.TrialId, incommand.Study.StudyInstanceUid), _userInfo.UserRoleId, TimeSpan.FromMinutes(3));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -357,7 +357,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
var svExpression = QCCommon.GetDicomStudySubjectVisitFilter(inQuery.VisitPlanArray);
|
||||
|
||||
var dicomStudyQuery = _dicomStudyRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo))
|
||||
|
|
@ -406,7 +406,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
|
||||
var nodeDicomStudyQuery = _noneDicomStudyRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression2)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo))
|
||||
|
|
@ -468,7 +468,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
{
|
||||
var svExpression = QCCommon.GetStudyMonitorSubjectVisitFilter(inQuery.VisitPlanArray);
|
||||
var StudyMonitorQuery = _studyMonitorRepository.Where(t => t.TrialId == inQuery.TrialId, ignoreQueryFilters: true)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.Subject.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
//.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
|
||||
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo))
|
||||
|
|
@ -615,7 +615,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
public async Task<IResponseOutput<List<VerifyStudyUploadResult>>> VerifyTaskStudyAllowUploadAsync(VerifyTaskUploadOrReupload verifyInfo)
|
||||
{
|
||||
|
||||
var queryStudy = _visitTaskRepository.Where(t => t.SubjectId == verifyInfo.SubjectId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.Id).Select(u => new
|
||||
var queryStudy = _visitTaskRepository.Where(t => t.SubjectId == verifyInfo.SubjectId && t.SourceSubjectVisitId != null && t.DoctorUserId == _userInfo.UserRoleId).Select(u => new
|
||||
{
|
||||
VisitTaskId = u.Id,
|
||||
SourceSubjectVisitId = u.SourceSubjectVisitId,
|
||||
|
|
@ -654,7 +654,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
var result = new VerifyStudyUploadResult();
|
||||
|
||||
if (_fusionCache.GetOrDefault<Guid>($"StudyUid_{trialId}_{studyInstanceUid}") != _userInfo.Id)
|
||||
if (_fusionCache.GetOrDefault<Guid>($"StudyUid_{trialId}_{studyInstanceUid}") != _userInfo.UserRoleId)
|
||||
{
|
||||
|
||||
result.AllowUpload = false;
|
||||
|
|
@ -704,7 +704,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
{
|
||||
if (result.AllowReUpload || result.AllowUpload)
|
||||
{
|
||||
await _fusionCache.SetAsync($"StudyUid_{trialId}_{studyInstanceUid}", _userInfo.Id, TimeSpan.FromSeconds(30));
|
||||
await _fusionCache.SetAsync($"StudyUid_{trialId}_{studyInstanceUid}", _userInfo.UserRoleId, TimeSpan.FromSeconds(30));
|
||||
|
||||
}
|
||||
else
|
||||
|
|
@ -800,7 +800,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
|
||||
var result = new VerifyStudyUploadResult();
|
||||
|
||||
if (cacheUserId.GetValueOrDefault() != _userInfo.Id && cacheUserId.HasValue)
|
||||
if (cacheUserId.GetValueOrDefault() != _userInfo.UserRoleId && cacheUserId.HasValue)
|
||||
{
|
||||
|
||||
result.AllowUpload = false;
|
||||
|
|
@ -869,7 +869,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
|||
{
|
||||
if (result.AllowReUpload || result.AllowUpload)
|
||||
{
|
||||
_fusionCache.Set(CacheKeys.TrialStudyUidUploading(trialId, studyInstanceUid), _userInfo.Id, TimeSpan.FromSeconds(30));
|
||||
_fusionCache.Set(CacheKeys.TrialStudyUidUploading(trialId, studyInstanceUid), _userInfo.UserRoleId, TimeSpan.FromSeconds(30));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -338,14 +338,6 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
|||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 用户 签名某个文档 Dto
|
||||
/// </summary>
|
||||
public class TrialDocumentConfirmDTO : InspectionBase, IInspectionDTO, ISignDTO
|
||||
{
|
||||
public UserConfirmCommand OptCommand { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class GetDataInspectionOutDto : DataInspection
|
||||
{
|
||||
|
|
|
|||
|
|
@ -1074,14 +1074,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
//IsConfig = lst.Select(x => x.IsConfig).FirstOrDefault(),
|
||||
IsShowParent = lst.Select(x => x.IsShowParent).FirstOrDefault(),
|
||||
ParentId = item.AddItemGuid,
|
||||
CreateUserId = _userInfo.Id,
|
||||
CreateUserId = _userInfo.UserRoleId,
|
||||
IsEnable = lst.Select(x => x.IsEnable).FirstOrDefault(),
|
||||
DictionaryKey = lst.Select(x => x.DictionaryKey).FirstOrDefault(),
|
||||
EnumType = lst.Select(x => x.EnumType).FirstOrDefault(),
|
||||
UpdateTime = DateTime.Now,
|
||||
ValueCN = lst.Select(x => x.ValueCN).FirstOrDefault(),
|
||||
Value = lst.Max(x => x.Value),
|
||||
UpdateUserId = _userInfo.Id,
|
||||
UpdateUserId = _userInfo.UserRoleId,
|
||||
ChildrenTypeId = additem?.ChildrenTypeId,
|
||||
ModuleTypeId = additem?.ModuleTypeId,
|
||||
ObjectTypeId = additem?.ObjectTypeId,
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
// 生成时间 2023-07-04 16:10:46
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Newtonsoft.Json;
|
||||
namespace IRaCIS.Core.Application.ViewModel
|
||||
|
|
@ -106,7 +107,22 @@ namespace IRaCIS.Core.Application.ViewModel
|
|||
}
|
||||
|
||||
|
||||
public class IRCLoginDto
|
||||
{
|
||||
public string UserName { get; set; }
|
||||
public string Password { get; set; }
|
||||
}
|
||||
|
||||
public class IRCLoginReturnDTO
|
||||
{
|
||||
public UserBasicInfo BasicInfo { get; set; } = new UserBasicInfo();
|
||||
public string JWTStr { get; set; } = string.Empty;
|
||||
|
||||
public bool IsMFA { get; set; } = false;
|
||||
|
||||
public SystemEmailSendConfigView CompanyInfo { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -64,6 +64,7 @@ namespace IRaCIS.Application.Contracts
|
|||
public class UserAccountInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid IdentityUserId { get; set; }
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
|
||||
|
|
@ -76,46 +77,42 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public string UserTypeShortName { get; set; }
|
||||
|
||||
public int Status { get; set; }
|
||||
public bool IsUserRoleDisabled { get; set; }
|
||||
}
|
||||
|
||||
public class UserBasicInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid IdentityUserId { get; set; }
|
||||
|
||||
public Guid UserRoleId { get; set; }
|
||||
|
||||
public bool IsMutiAccount => AccountList?.Count > 1;
|
||||
public List<UserAccountInfo> AccountList { get; set; }
|
||||
|
||||
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string RealName { get; set; } = string.Empty;
|
||||
public string FullName { get; set; } = string.Empty;
|
||||
public int? Sex { get; set; } // 1-男 2-女
|
||||
public string UserCode { get; set; }
|
||||
public string EMail { get; set; }
|
||||
|
||||
public int Status { get; set; }
|
||||
public bool IsTestUser { get; set; }
|
||||
public bool IsZhiZhun { get; set; }
|
||||
public bool IsFirstAdd { get; set; }
|
||||
|
||||
public bool NeedChangePassWord { get; set; } = false;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// LastLoginIP
|
||||
/// </summary>
|
||||
public bool PasswordChanged { get; set; }
|
||||
|
||||
public int LoginState { get; set; } = 0;
|
||||
public string LastLoginIP { get; set; } = string.Empty;
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
public DateTime? LastLoginTime { get; set; }
|
||||
/// <summary>
|
||||
/// 上一次修改密码的时间
|
||||
/// </summary>
|
||||
public DateTime? LastChangePassWordTime { get; set; }
|
||||
public bool IsTestUser { get; set; }
|
||||
public bool IsAdmin { get; set; } = false;
|
||||
public string UserTypeShortName { get; set; } = string.Empty;
|
||||
public bool PasswordChanged { get; set; }
|
||||
public int Status { get; set; }
|
||||
public Guid UserTypeId { get; set; }
|
||||
|
||||
public string Code { get; set; } = String.Empty;
|
||||
|
||||
public string PermissionStr { get; set; } = String.Empty;
|
||||
|
||||
public string EMail { get; set; } = string.Empty;
|
||||
public bool IsFirstAdd { get; set; }
|
||||
|
||||
public bool IsZhiZhun { get; set; }
|
||||
public bool IsReviewer { get; set; } = false;
|
||||
|
||||
public int LoginState { get; set; } = 0;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -163,23 +160,25 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
|
||||
|
||||
|
||||
public class UserDetailDTO : UserInfo
|
||||
{
|
||||
public bool CanEditUserType { get; set; }
|
||||
//public bool CanEditUserType { get; set; }
|
||||
|
||||
public string FullName { get; set; }
|
||||
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public bool IsMutiAccount => AccountList?.Count > 1;
|
||||
public List<UserAccountInfo> AccountList { get; set; }
|
||||
}
|
||||
|
||||
public class UserInfo
|
||||
{
|
||||
public string CheckCode { get; set; } = string.Empty;
|
||||
public Guid Id { get; set; }
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string Password { get; set; } = string.Empty;
|
||||
public string RealName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
|
|
@ -189,36 +188,22 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string EMail { get; set; } = string.Empty;
|
||||
public Guid UserTypeId { get; set; } = Guid.Empty;
|
||||
|
||||
public string UserCode { get; set; } = string.Empty;
|
||||
|
||||
public bool IsZhiZhun { get; set; }
|
||||
|
||||
public string UserType { get; set; } = string.Empty;
|
||||
|
||||
public string UserTypeShortName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
|
||||
|
||||
//public Guid OrganizationTypeId { get; set; } = Guid.Empty;
|
||||
//public string OrganizationType { get; set; } = String.Empty;
|
||||
//public Guid OrganizationId { get; set; }
|
||||
public string OrganizationName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
public string DepartmentName { get; set; } = String.Empty;
|
||||
public string PositionName { get; set; } = String.Empty;
|
||||
|
||||
public bool IsTestUser { get; set; }
|
||||
|
||||
public DateTime? LastLoginTime { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加用户是的返回模型
|
||||
/// </summary>
|
||||
|
|
@ -228,14 +213,40 @@ namespace IRaCIS.Application.Contracts
|
|||
public string UserCode { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class UserAddUserType
|
||||
{
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
public Guid UserTypeId { get; set; }
|
||||
|
||||
public bool IsUserRoleDisabled { get; set; }
|
||||
|
||||
|
||||
}
|
||||
public class UpdateUserRolesDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public List<UserAddUserType> UserRoleList { get; set; }
|
||||
}
|
||||
|
||||
public class UserBasicInfoCommand : UserInfo
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class UserCommand : UserInfo
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
public List<UserAddUserType> UserRoleList { get; set; }
|
||||
|
||||
public string BaseUrl { get; set; } = string.Empty;
|
||||
public string RouteUrl { get; set; } = string.Empty;
|
||||
|
||||
//public string FirstName { get; set; }
|
||||
//public string LastName { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class EditPasswordCommand
|
||||
|
|
@ -283,6 +294,10 @@ namespace IRaCIS.Application.Contracts
|
|||
public DateTime? BeginLastLoginTime { get; set; }
|
||||
|
||||
public DateTime? EndLastLoginTime { get; set; }
|
||||
|
||||
public DateTime? BeginLastChangePassWordTime { get; set; }
|
||||
|
||||
public DateTime? EndLastChangePassWordTime { get; set; }
|
||||
}
|
||||
|
||||
public class UserRoleInfoDTO
|
||||
|
|
@ -293,16 +308,42 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public class UserListDTO : UserInfo
|
||||
{
|
||||
[JsonIgnore]
|
||||
public Guid testGuid { get; set; }
|
||||
public bool CanEditUserType { get; set; }
|
||||
public bool IsFirstAdd { get; set; }
|
||||
|
||||
public DateTime? LastLoginTime { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public List<string> RoleNameArray { get; set; } = new List<string>();
|
||||
public IEnumerable<RoleDTO> RoleNameList { get; set; } = new List<RoleDTO>();
|
||||
}
|
||||
public Guid Id { get; set; }
|
||||
|
||||
public string FullName { get; set; }
|
||||
|
||||
public DateTime? LastChangePassWordTime { get; set; }
|
||||
|
||||
public List<IdentityUserTypeDTO> UserRoleList { get; set; }
|
||||
|
||||
#region 用户来源
|
||||
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
public string TrialCode { get; set; }
|
||||
|
||||
public string ResearchProgramNo { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
public int JoinedTrialCount { get; set; }
|
||||
}
|
||||
public class IdentityUserTypeDTO : UserAddUserType
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string UserTypeShortName { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
|
||||
public DateTime UpdateTime { get; set; }
|
||||
}
|
||||
|
||||
public class UserIdRoleName : RoleDTO
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,21 +6,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
public interface IUserService
|
||||
{
|
||||
Task<IResponseOutput<UserAddedReturnDTO>> AddUser(UserCommand userAddModel);
|
||||
Task<IResponseOutput> DeleteUser(Guid userId);
|
||||
Task<UserDetailDTO> GetUser(Guid id);
|
||||
Task<PageOutput<UserListDTO>> GetUserList(UserListQueryDTO param);
|
||||
|
||||
Task<IResponseOutput<LoginReturnDTO>> LoginSelectUserType(Guid userId, Guid userTypeId);
|
||||
Task<IResponseOutput<LoginReturnDTO>> Login(string userName, string password);
|
||||
Task<IResponseOutput> VerifyMFACodeAsync(Guid userId, string Code);
|
||||
|
||||
Task<IResponseOutput> SendMFAEmail(Guid userId, int mfaType = 0);
|
||||
Task<UserBasicInfo> GetUserBasicInfo(Guid userId, string pwd);
|
||||
Task<IResponseOutput> ModifyPassword(EditPasswordCommand editPwModel);
|
||||
Task<IResponseOutput> ResetPassword(Guid userId);
|
||||
|
||||
Task<IResponseOutput> UpdateUser(UserCommand model);
|
||||
Task<IResponseOutput> UpdateUserState(Guid userId, UserStateEnum state);
|
||||
|
||||
//Task<IResponseOutput> SendVerificationCode(string emailOrPhone, VerifyType verificationType, bool isReviewer = false);
|
||||
//Task<IResponseOutput> SetNewPassword(ResetPasswordCommand resetPwdModel);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
if (entity.NoticeStateEnum == Domain.Share.SystemNotice_NoticeStateEnum.HavePublished)
|
||||
{
|
||||
entity.PublishedUserId = _userInfo.Id;
|
||||
entity.PublishedUserId = _userInfo.UserRoleId;
|
||||
entity.PublishedTime = DateTime.Now;
|
||||
}
|
||||
await _systemNoticeRepository.SaveChangesAsync();
|
||||
|
|
@ -61,7 +61,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
if (addOrEditSystemNotice.NoticeStateEnum == Domain.Share.SystemNotice_NoticeStateEnum.HavePublished && systemNotice.NoticeStateEnum == Domain.Share.SystemNotice_NoticeStateEnum.NotPublish)
|
||||
{
|
||||
systemNotice.PublishedUserId = _userInfo.Id;
|
||||
systemNotice.PublishedUserId = _userInfo.UserRoleId;
|
||||
systemNotice.PublishedTime = DateTime.Now;
|
||||
}
|
||||
else if (addOrEditSystemNotice.NoticeStateEnum == Domain.Share.SystemNotice_NoticeStateEnum.NotPublish && systemNotice.NoticeStateEnum == Domain.Share.SystemNotice_NoticeStateEnum.HavePublished)
|
||||
|
|
@ -125,7 +125,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inQuery.NoticeTypeEnum != null, t => t.NoticeTypeEnum == inQuery.NoticeTypeEnum)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.FileName), t => t.FileName.Contains(inQuery.FileName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.NoticeContent), t => t.NoticeContent.Contains(inQuery.NoticeContent))
|
||||
.ProjectTo<SystemNoticeReadDTO>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
|
||||
.ProjectTo<SystemNoticeReadDTO>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.UserRoleId });
|
||||
|
||||
return await systemNoticeQueryable.ToPagedListAsync(inQuery);
|
||||
}
|
||||
|
|
@ -137,9 +137,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
var appDateTimeNow = DateTime.Now;
|
||||
|
||||
var query = _systemNoticeRepository
|
||||
.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.SystemNotice_NoticeStateEnum.HavePublished && !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.Id))
|
||||
.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.SystemNotice_NoticeStateEnum.HavePublished && !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > appDateTimeNow)
|
||||
.ProjectTo<SystemNoticeView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id });
|
||||
.ProjectTo<SystemNoticeView>(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.UserRoleId });
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var isCRCOrIR = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer;
|
||||
|
||||
var userFeedBackQueryable = _userFeedBackRepository
|
||||
.WhereIf(isCRCOrIR, t => t.CreateUserId == _userInfo.Id)
|
||||
.WhereIf(isCRCOrIR, t => t.CreateUserId == _userInfo.UserRoleId)
|
||||
.WhereIf(inQuery.State != null, t => t.State == inQuery.State)
|
||||
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.QuestionType != null, t => t.QuestionType == inQuery.QuestionType)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -73,18 +73,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<UserType, TrialUserType>()
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(t => t.UserTypeName));
|
||||
|
||||
CreateMap<UserRole, UserDetailDTO>()
|
||||
.ForMember(d => d.RealName, u => u.MapFrom(s => s.FullName))
|
||||
.ForMember(d => d.UserTypeId, u => u.MapFrom(s => s.UserTypeRole.Id))
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeName))
|
||||
.ForMember(d => d.UserTypeShortName, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName))
|
||||
.ForMember(d => d.CanEditUserType, u => u.MapFrom(s => !s.UserTrials.Any()));
|
||||
CreateMap<IdentityUser, UserDetailDTO>();
|
||||
|
||||
CreateMap<UserRole, UserListDTO>()
|
||||
.ForMember(d => d.RealName, u => u.MapFrom(s => s.FullName))
|
||||
.ForMember(d => d.UserTypeId, u => u.MapFrom(s => s.UserTypeRole.Id))
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName))
|
||||
.ForMember(d => d.CanEditUserType, u => u.MapFrom(s => !s.UserTrials.Any()));
|
||||
|
||||
CreateMap<IdentityUser, UserListDTO>()
|
||||
.ForMember(d => d.TrialCode, u => u.MapFrom(s => s.Trial.TrialCode))
|
||||
.ForMember(d => d.JoinedTrialCount, u => u.MapFrom(s => s.UserTrialList.Count()))
|
||||
.ForMember(d => d.ResearchProgramNo, u => u.MapFrom(s => s.Trial.ResearchProgramNo));
|
||||
|
||||
var token = string.Empty;
|
||||
var userId = Guid.Empty;
|
||||
|
|
@ -136,7 +131,18 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<UserRole, UserAccountInfo>()
|
||||
.ForMember(d => d.UserTypeShortName, c => c.MapFrom(t => t.UserTypeRole.UserTypeShortName));
|
||||
|
||||
CreateMap<UserRole, IdentityUser>();
|
||||
|
||||
|
||||
CreateMap<IdentityUser, UserRole>();
|
||||
|
||||
CreateMap<UserCommand, IdentityUser>();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
subjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
||||
}
|
||||
if (subjectVisit!.CurrentActionUserId != _userInfo.Id)
|
||||
if (subjectVisit!.CurrentActionUserId != _userInfo.UserRoleId)
|
||||
{
|
||||
//---您不是该质控任务当前领取人,没有操作权限!
|
||||
throw new BusinessValidationFailedException(_localizer["QCCommon_NoPermission"]);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
.WhereIf(inQuery.SubmitState != null, t => t.SubmitState == inQuery.SubmitState)
|
||||
.WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.ProjectTo<QCCRCVisitViewModel>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
|
|
@ -148,7 +148,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
.WhereIf(inQuery.IsOverTime != null && inQuery.IsOverTime == true, t => t.IsClosed ? t.ClosedTime > t.DeadlineTime : DateTime.Now > t.DeadlineTime)
|
||||
.WhereIf(inQuery.IsOverTime != null && inQuery.IsOverTime == false, t => t.IsClosed ? t.ClosedTime < t.DeadlineTime : DateTime.Now < t.DeadlineTime)
|
||||
.WhereIf(inQuery.IsUrgent != null, t => t.SubjectVisit.IsUrgent == inQuery.IsUrgent)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent) + " desc", nameof(QCCRCChallengeViewModel.CreateTime) });
|
||||
|
|
@ -207,7 +207,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
var result = await GetQCVisitList(new QCVisitSearchDTO()
|
||||
{
|
||||
TrialId = inDto.TrialId,
|
||||
CurrentActionUserId = _userInfo.Id,
|
||||
CurrentActionUserId = _userInfo.UserRoleId,
|
||||
VisitId = inDto.VisitId,
|
||||
PageIndex = 1,
|
||||
PageSize = 1,
|
||||
|
|
@ -289,7 +289,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectInfo), t => t.Subject.Code.Contains(inQuery.SubjectInfo))
|
||||
.WhereIf(inQuery.VisitPlanArray != null && inQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
//.WhereIf(!string.IsNullOrEmpty(checkQuery.VisitPlanInfo), checkQuery.VisitPlanInfo.Contains('.') ? t => t.InPlan == false : t => t.VisitNum == decimal.Parse(checkQuery.VisitPlanInfo))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))//CRC 过滤负责的site
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))//CRC 过滤负责的site
|
||||
.ProjectTo<QCCheckWithModalityView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await query.ToPagedListAsync(inQuery);
|
||||
|
|
@ -311,7 +311,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
var sv = (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId)
|
||||
.ProjectTo<CheckDialogDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
sv.DialogList.ForEach(t => t.IsCurrentUser = _userInfo.Id == t.CreateUserId);
|
||||
sv.DialogList.ForEach(t => t.IsCurrentUser = _userInfo.UserRoleId == t.CreateUserId);
|
||||
|
||||
return sv;
|
||||
}
|
||||
|
|
@ -369,7 +369,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study),
|
||||
StudyList = temp.StudyList,
|
||||
ExistsManual = (await _IReadingImageTaskService.GetManualList(new GetManualListInDto() { TrialId = sv.TrialId })).Count() > 0,
|
||||
ExistsManual =false,
|
||||
SeriesList = temp.SeriesList,
|
||||
RelationInfo = await GetVisitQCSubjectInfo(subjectVisitId),
|
||||
NoneDicomStudyList = await _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).ProjectTo<NoneDicomStudyView>(_mapper.ConfigurationProvider).ToListAsync(),
|
||||
|
|
@ -542,7 +542,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
{
|
||||
|
||||
var list = await _qcChallengeRepository.Where(t => t.Id == qaChallengeId)
|
||||
.ProjectTo<ChallengeAndDialog>(_mapper.ConfigurationProvider, new { currentUserId = _userInfo.Id }).ToListAsync();
|
||||
.ProjectTo<ChallengeAndDialog>(_mapper.ConfigurationProvider, new { currentUserId = _userInfo.UserRoleId }).ToListAsync();
|
||||
|
||||
//利用automapper 运行时映射
|
||||
//list.ForEach(t => t.IsCurrentUser = _userInfo.Id == t.CreateUserId);
|
||||
|
|
@ -564,7 +564,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
{
|
||||
|
||||
var qaChallengeQuery = _qcChallengeRepository.Where(t => t.SubjectVisitId == subjectVisitId && t.QCProcessEnum == trialQCProcess)
|
||||
.ProjectTo<ChallengeAndDialog>(_mapper.ConfigurationProvider, new { currentUserId = _userInfo.Id });
|
||||
.ProjectTo<ChallengeAndDialog>(_mapper.ConfigurationProvider, new { currentUserId = _userInfo.UserRoleId });
|
||||
|
||||
var list = await qaChallengeQuery.ToListAsync();
|
||||
|
||||
|
|
|
|||
|
|
@ -224,7 +224,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
dbQCChallenge.LatestMsgTime = DateTime.Now;
|
||||
|
||||
|
||||
dbQCChallenge.LatestReplyUserId = _userInfo.Id;
|
||||
dbQCChallenge.LatestReplyUserId = _userInfo.UserRoleId;
|
||||
|
||||
|
||||
var success = await _qCChallengeDialogrepository.SaveChangesAsync();
|
||||
|
|
@ -345,7 +345,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
ResponseOutput.NotOk(_localizer["QCOperation_PassAfterClose"]);
|
||||
}
|
||||
|
||||
sv.CheckUserId = _userInfo.Id;
|
||||
sv.CheckUserId = _userInfo.UserRoleId;
|
||||
sv.CheckState = CheckStateEnum.CVPassed;
|
||||
|
||||
sv.ReadingStatus = ReadingStatusEnum.TaskAllocate;
|
||||
|
|
@ -835,7 +835,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
subjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == sujectVisitId)).IfNullThrowException();
|
||||
}
|
||||
|
||||
if (subjectVisit!.CurrentActionUserId != _userInfo.Id)
|
||||
if (subjectVisit!.CurrentActionUserId != _userInfo.UserRoleId)
|
||||
{
|
||||
//---您不是该质控任务当前领取人,没有操作权限!
|
||||
throw new BusinessValidationFailedException(_localizer["QCOperation_NoRecipient"]);
|
||||
|
|
@ -863,7 +863,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
dbSubjectVisit.IsTake = true;
|
||||
|
||||
dbSubjectVisit.CurrentActionUserId = _userInfo.Id;
|
||||
dbSubjectVisit.CurrentActionUserId = _userInfo.UserRoleId;
|
||||
|
||||
dbSubjectVisit.CurrentActionUserExpireTime = DateTime.Now.AddHours(1);
|
||||
|
||||
|
|
@ -919,8 +919,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
break;
|
||||
case TrialQCProcess.SingleAudit:
|
||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted
|
||||
&& x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId != _userInfo.Id && (x.CurrentActionUserId == _userInfo.Id || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake)))
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.Id)
|
||||
&& x.TrialId == inDto.TrialId && x.PreliminaryAuditUserId != _userInfo.UserRoleId && (x.CurrentActionUserId == _userInfo.UserRoleId || (x.AuditState != AuditStateEnum.PrimaryQCPassed && !x.IsTake)))
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId)
|
||||
.Include(x => x.Subject).ToListAsync();
|
||||
|
||||
subjectVisit = visitList.Where(x => x.SubjectId == inDto.SubjectId)
|
||||
|
|
@ -953,9 +953,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
case TrialQCProcess.DoubleAudit:
|
||||
|
||||
visitList = await _subjectVisitRepository.Where(x => x.SubmitState == SubmitStateEnum.Submitted && x.TrialId == inDto.TrialId &&
|
||||
((x.CurrentActionUserId == _userInfo.Id) || (!x.IsTake && x.AuditState != AuditStateEnum.QCPassed && (x.PreliminaryAuditUserId != _userInfo.Id)))
|
||||
((x.CurrentActionUserId == _userInfo.UserRoleId) || (!x.IsTake && x.AuditState != AuditStateEnum.QCPassed && (x.PreliminaryAuditUserId != _userInfo.UserRoleId)))
|
||||
)
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.Id)
|
||||
.Where(x => x.QCChallengeList.Count() == 0 || x.QCChallengeList.Where(y => !y.IsClosed).OrderByDescending(x => x.CreateTime).FirstOrDefault().CreateUserId != _userInfo.UserRoleId)
|
||||
.Include(x => x.Subject).ToListAsync();
|
||||
if (subjectVisit != null)
|
||||
{
|
||||
|
|
@ -1046,7 +1046,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
}
|
||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit)
|
||||
{
|
||||
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id)
|
||||
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.UserRoleId)
|
||||
{
|
||||
//---初审已通过,不能继续领取
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_InitialAuditPassed"]);
|
||||
|
|
@ -1068,7 +1068,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
}
|
||||
else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit)
|
||||
{
|
||||
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id)
|
||||
if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.UserRoleId)
|
||||
{
|
||||
//---复审不能和初审是同一个人
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoSameReviewer"]);
|
||||
|
|
@ -1099,7 +1099,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
dbSubjectVisit.IsTake = true;
|
||||
|
||||
dbSubjectVisit.CurrentActionUserId = _userInfo.Id;
|
||||
dbSubjectVisit.CurrentActionUserId = _userInfo.UserRoleId;
|
||||
|
||||
dbSubjectVisit.CurrentActionUserExpireTime = DateTime.Now.AddHours(1);
|
||||
|
||||
|
|
@ -1109,7 +1109,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
}
|
||||
else
|
||||
{
|
||||
if (dbSubjectVisit!.CurrentActionUserId != _userInfo.Id)
|
||||
if (dbSubjectVisit!.CurrentActionUserId != _userInfo.UserRoleId)
|
||||
{
|
||||
//---您不是该质控任务当前领取人,没有操作权限!
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_NoRecipient"], ApiResponseCodeEnum.NeedTips);
|
||||
|
|
@ -1414,7 +1414,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
{
|
||||
dbSubjectVisit.SubmitState = SubmitStateEnum.Submitted;
|
||||
dbSubjectVisit.SubmitTime = DateTime.Now;
|
||||
dbSubjectVisit.SubmitUserId = _userInfo.Id;
|
||||
dbSubjectVisit.SubmitUserId = _userInfo.UserRoleId;
|
||||
|
||||
//维护统一状态
|
||||
dbSubjectVisit.ReadingStatus = ReadingStatusEnum.ImageQuality;
|
||||
|
|
@ -1513,7 +1513,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
public async Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState)
|
||||
{
|
||||
|
||||
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == _userInfo.Id))
|
||||
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == _userInfo.UserRoleId))
|
||||
{
|
||||
//---您已经被移出项目,没有操作权限。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_RemoveItem"]);
|
||||
|
|
@ -1574,7 +1574,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
dbSubjectVisit.AuditState = AuditStateEnum.QCPassed;
|
||||
dbSubjectVisit.CheckState = trialConfig.IsImageConsistencyVerification ? CheckStateEnum.ToCheck : CheckStateEnum.CVPassed;
|
||||
dbSubjectVisit.ForwardState = trialConfig.IsImageConsistencyVerification ? ForwardStateEnum.None : ForwardStateEnum.ToForward;
|
||||
dbSubjectVisit.PreliminaryAuditUserId = _userInfo.Id;
|
||||
dbSubjectVisit.PreliminaryAuditUserId = _userInfo.UserRoleId;
|
||||
dbSubjectVisit.PreliminaryAuditTime = DateTime.Now;
|
||||
|
||||
|
||||
|
|
@ -1618,7 +1618,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
}
|
||||
|
||||
dbSubjectVisit.AuditState = AuditStateEnum.PrimaryQCPassed;
|
||||
dbSubjectVisit.PreliminaryAuditUserId = _userInfo.Id;
|
||||
dbSubjectVisit.PreliminaryAuditUserId = _userInfo.UserRoleId;
|
||||
dbSubjectVisit.PreliminaryAuditTime = DateTime.Now;
|
||||
|
||||
|
||||
|
|
@ -1638,7 +1638,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
dbSubjectVisit.ForwardState = trialConfig.IsImageConsistencyVerification ? ForwardStateEnum.None : ForwardStateEnum.ToForward;
|
||||
|
||||
dbSubjectVisit.ReviewAuditUserId = _userInfo.Id;
|
||||
dbSubjectVisit.ReviewAuditUserId = _userInfo.UserRoleId;
|
||||
|
||||
dbSubjectVisit.ReviewAuditTime = DateTime.Now;
|
||||
|
||||
|
|
@ -1682,7 +1682,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
if (dbSubjectVisit.AuditState == AuditStateEnum.InPrimaryQC)
|
||||
{
|
||||
dbSubjectVisit.AuditState = AuditStateEnum.QCFailed;
|
||||
dbSubjectVisit.PreliminaryAuditUserId = _userInfo.Id;
|
||||
dbSubjectVisit.PreliminaryAuditUserId = _userInfo.UserRoleId;
|
||||
|
||||
}
|
||||
else
|
||||
|
|
@ -1697,12 +1697,12 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
if (dbSubjectVisit.AuditState == AuditStateEnum.InPrimaryQC)
|
||||
{
|
||||
dbSubjectVisit.AuditState = AuditStateEnum.QCFailed;
|
||||
dbSubjectVisit.PreliminaryAuditUserId = _userInfo.Id;
|
||||
dbSubjectVisit.PreliminaryAuditUserId = _userInfo.UserRoleId;
|
||||
}
|
||||
else if (dbSubjectVisit.AuditState == AuditStateEnum.InSecondaryQC)
|
||||
{
|
||||
dbSubjectVisit.AuditState = AuditStateEnum.QCFailed;
|
||||
dbSubjectVisit.ReviewAuditUserId = _userInfo.Id;
|
||||
dbSubjectVisit.ReviewAuditUserId = _userInfo.UserRoleId;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -1717,7 +1717,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
|
||||
}
|
||||
dbSubjectVisit.Auditor = _userInfo.Id;
|
||||
dbSubjectVisit.Auditor = _userInfo.UserRoleId;
|
||||
dbSubjectVisit.IsTake = false;
|
||||
dbSubjectVisit.CurrentActionUserId = null;
|
||||
dbSubjectVisit.CurrentActionUserExpireTime = null;
|
||||
|
|
@ -1818,7 +1818,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
qcChallenge.ReuploadEnum = QCChanllengeReuploadEnum.QCAgreeUpload;
|
||||
qcChallenge.LatestMsgTime = DateTime.Now;
|
||||
qcChallenge.LatestReplyUserId = _userInfo.Id;
|
||||
qcChallenge.LatestReplyUserId = _userInfo.UserRoleId;
|
||||
|
||||
await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == qcChallenge.SubjectVisitId, c => new SubjectVisit() { IsQCConfirmedReupload = true });
|
||||
|
||||
|
|
@ -1845,7 +1845,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
sv.AuditState = AuditStateEnum.InPrimaryQC;
|
||||
|
||||
sv.CurrentActionUserExpireTime = DateTime.Now.AddHours(1);
|
||||
sv.CurrentActionUserId = _userInfo.Id;
|
||||
sv.CurrentActionUserId = _userInfo.UserRoleId;
|
||||
|
||||
//BackgroundJob.Schedule<IObtainTaskAutoCancelJob>(t => t.CancelQCObtaion(qcChallenge.SubjectVisitId, DateTime.Now), TimeSpan.FromHours(1));
|
||||
sv.IsTake = true;
|
||||
|
|
@ -1936,13 +1936,13 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
|
||||
qcChallenge.ReUploadedTime = DateTime.Now;
|
||||
|
||||
qcChallenge.ReUploadUserId = _userInfo.Id;
|
||||
qcChallenge.ReUploadUserId = _userInfo.UserRoleId;
|
||||
|
||||
qcChallenge.ReUploader = _userInfo.RealName;
|
||||
qcChallenge.ReUploader = _userInfo.FullName;
|
||||
|
||||
qcChallenge.LatestMsgTime = DateTime.Now;
|
||||
|
||||
qcChallenge.LatestReplyUserId = _userInfo.Id;
|
||||
qcChallenge.LatestReplyUserId = _userInfo.UserRoleId;
|
||||
|
||||
var dbSubjectVisit = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == qcChallenge.SubjectVisitId).IfNullThrowException();
|
||||
|
||||
|
|
@ -2013,7 +2013,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
}
|
||||
|
||||
qcChallenge.LatestMsgTime = DateTime.Now;
|
||||
qcChallenge.LatestReplyUserId = _userInfo.Id;
|
||||
qcChallenge.LatestReplyUserId = _userInfo.UserRoleId;
|
||||
qcChallenge.ReuploadEnum = QCChanllengeReuploadEnum.CRCRequestReupload;
|
||||
|
||||
qcChallenge.DialogList.Add(new QCChallengeDialog()
|
||||
|
|
|
|||
|
|
@ -35,7 +35,6 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
Task AddOncologyTask(Guid oncologModuleId);
|
||||
|
||||
Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto);
|
||||
|
||||
Task<bool> ResetReadingRestTime(Guid? userId);
|
||||
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||
{
|
||||
|
||||
LatestReplyUserId = (inDto.IsSendDialog && !medicalReview.IsSendMessage && inDto.IsHaveQuestion) ? _userInfo.Id : null,
|
||||
LatestReplyUserId = (inDto.IsSendDialog && !medicalReview.IsSendMessage && inDto.IsHaveQuestion) ? _userInfo.UserRoleId : null,
|
||||
IsHaveQuestion = inDto.IsHaveQuestion,
|
||||
Questioning = inDto.Questioning,
|
||||
IsSendMessage = inDto.IsSendDialog && inDto.IsHaveQuestion,
|
||||
|
|
@ -472,7 +472,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||
{
|
||||
LatestReplyUserId = _userInfo.Id,
|
||||
LatestReplyUserId = _userInfo.UserRoleId,
|
||||
IsClosedDialog = inDto.IsClosedDialog,
|
||||
MedicalDialogCloseEnum = inDto.MedicalDialogCloseEnum,
|
||||
DialogCloseReason = inDto.DialogCloseReason,
|
||||
|
|
@ -511,7 +511,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||
{
|
||||
LatestReplyUserId = _userInfo.Id,
|
||||
LatestReplyUserId = _userInfo.UserRoleId,
|
||||
});
|
||||
|
||||
var visitTaskId = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).Select(x => x.VisitTaskId).FirstOrDefaultAsync();
|
||||
|
|
@ -567,7 +567,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(x => !x.IsClosedDialog && x.Id == inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||
{
|
||||
LatestReplyUserId = _userInfo.Id,
|
||||
LatestReplyUserId = _userInfo.UserRoleId,
|
||||
IsClosedDialog = true,
|
||||
MedicalDialogCloseEnum = MedicalDialogClose.IRApplyReReading,
|
||||
|
||||
|
|
@ -581,7 +581,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||
{
|
||||
LatestReplyUserId = _userInfo.Id,
|
||||
LatestReplyUserId = _userInfo.UserRoleId,
|
||||
DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum,
|
||||
});
|
||||
ReadingMedicalReviewDialog dialog = new ReadingMedicalReviewDialog()
|
||||
|
|
@ -618,7 +618,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.OrderBy(x => x.CreateTime).ToListAsync();
|
||||
result.ForEach(x =>
|
||||
{
|
||||
x.IsCurrentUser = x.CreateUserId == _userInfo.Id;
|
||||
x.IsCurrentUser = x.CreateUserId == _userInfo.UserRoleId;
|
||||
});
|
||||
return (result, new
|
||||
{
|
||||
|
|
@ -711,7 +711,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview()
|
||||
{
|
||||
LatestReplyUserId = _userInfo.Id,
|
||||
LatestReplyUserId = _userInfo.UserRoleId,
|
||||
DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum,
|
||||
DisagreeReason = inDto.DisagreeReason,
|
||||
IsApplyHeavyReading = inDto.IsApplyHeavyReading,
|
||||
|
|
@ -785,7 +785,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<PageOutput<GetIRMedicalFeedbackListOutDto>> GetIRMedicalFeedbackList(GetIRMedicalFeedbackListInDto inDto)
|
||||
{
|
||||
var taskMedicalReviewquery = _taskMedicalReviewRepository.Where(x => x.TrialId == inDto.TrialId).Include(x => x.VisitTask)
|
||||
.Where(x => x.VisitTask.DoctorUserId == _userInfo.Id)
|
||||
.Where(x => x.VisitTask.DoctorUserId == _userInfo.UserRoleId)
|
||||
.Where(x => x.IsHaveQuestion)
|
||||
.WhereIf(!inDto.TaskBlindName.IsNullOrEmpty(), x => x.VisitTask.TaskBlindName == inDto.TaskBlindName)
|
||||
.WhereIf(inDto.SubjectId != null, x => x.VisitTask.SubjectId == inDto.SubjectId!)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
IRepository<ReadModule> _readModuleRepository,
|
||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||
IRepository<OrganInfo> _organInfoRepository,
|
||||
IRepository<TrialDocument> _trialDocumentRepository,
|
||||
ILuganoCalculateService _luganoCalculateService,
|
||||
IRepository<ReadingCustomTag> _readingCustomTagRepository,
|
||||
IRepository<ReadingTaskQuestionMark> _readingTaskQuestionMarkRepository,
|
||||
|
|
@ -214,39 +213,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取手册
|
||||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<List<GetManualListOutDto>> GetManualList(GetManualListInDto inDto)
|
||||
{
|
||||
UserTypeEnum userType = (UserTypeEnum)_userInfo.UserTypeEnumInt;
|
||||
|
||||
|
||||
List<UserTypeEnum> canViewUserType = new List<UserTypeEnum>()
|
||||
{
|
||||
UserTypeEnum.IndependentReviewer,
|
||||
UserTypeEnum.IQC,
|
||||
|
||||
};
|
||||
|
||||
return await _trialDocumentRepository.Where(x => x.TrialId == inDto.TrialId
|
||||
&& x.TrialDocConfirmedUserList.Any(y => y.ConfirmUserId == _userInfo.Id && y.ConfirmTime != null)
|
||||
&& x.NeedConfirmedUserTypeList.Any(y => y.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.WhereIf(userType == UserTypeEnum.IndependentReviewer, t => t.FileType.Code == "2" || t.FileType.Code == "6")
|
||||
.WhereIf(userType == UserTypeEnum.IQC, t => t.FileType.Code == "4" || t.FileType.Code == "5")
|
||||
.WhereIf(!canViewUserType.Contains(userType), t => false)
|
||||
.IgnoreQueryFilters()
|
||||
.Select(x => new GetManualListOutDto()
|
||||
{
|
||||
Id = x.Id,
|
||||
Name = x.Name,
|
||||
Path = x.Path
|
||||
}).ToListAsync();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取任务附加问题
|
||||
/// </summary>
|
||||
|
|
@ -383,7 +351,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task ChangeCalculationAnswer(ChangeCalculationAnswerInDto inDto)
|
||||
{
|
||||
var visitTask = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync();
|
||||
|
|
@ -459,7 +427,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task ReadClinicalData(ReadClinicalDataInDto inDto)
|
||||
{
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask
|
||||
|
|
@ -836,7 +804,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var criterionIdInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == trialReadingCriterionId).FirstNotNullAsync();
|
||||
|
||||
|
||||
var groupIds = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId &&( x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.BasicTable)).Select(x => x.GroupId).Distinct().ToListAsync();
|
||||
var groupIds = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && (x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.BasicTable)).Select(x => x.GroupId).Distinct().ToListAsync();
|
||||
|
||||
var questionIds = await _readingQuestionTrialRepository
|
||||
.Where(x => x.IsShowInDicom)
|
||||
|
|
@ -1364,7 +1332,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
item.TableQuestions.Questions = tableQuestionLists.Where(x => x.ReadingQuestionId == item.Id).OrderBy(x => x.ShowOrder).ToList();
|
||||
item.TableQuestions.Questions.ForEach(x =>
|
||||
{
|
||||
x.RelationQuestions= _mapper.Map<List<GetTrialReadingQuestionOutDto>>(tableQuestionLists.Where(z => (z.DependParentId ?? default(Guid)) == x.Id));
|
||||
x.RelationQuestions = _mapper.Map<List<GetTrialReadingQuestionOutDto>>(tableQuestionLists.Where(z => (z.DependParentId ?? default(Guid)) == x.Id));
|
||||
x.RelationQuestions.ForEach(y =>
|
||||
{
|
||||
y.Childrens = new List<GetTrialReadingQuestionOutDto>();
|
||||
|
|
@ -1374,7 +1342,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
y.LesionType = item.LesionType;
|
||||
y.RelationQuestions = new List<GetTrialReadingQuestionOutDto>();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
var thisAnswer = tableAnswers.Where(x => x.QuestionId == item.Id).ToList();
|
||||
|
|
@ -1528,7 +1496,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task SplitLesion(SplitLesionInDto inDto)
|
||||
{
|
||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||
|
|
@ -1766,7 +1734,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> SaveImageQuality(ChangeDicomReadingQuestionAnswerInDto inDto)
|
||||
{
|
||||
inDto.UpdateMark = true;
|
||||
|
|
@ -1825,7 +1793,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> ChangeDicomReadingQuestionAnswer(ChangeDicomReadingQuestionAnswerInDto inDto)
|
||||
{
|
||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||
|
|
@ -1942,7 +1910,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> DeleteReadingRowAnswer(DeleteReadingRowAnswerInDto inDto)
|
||||
{
|
||||
await VerifyTaskIsSign(inDto.VisitTaskId);
|
||||
|
|
@ -2129,7 +2097,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<SubmitTableQuestionOutDto> SubmitTableQuestion(SubmitTableQuestionInDto inDto)
|
||||
{
|
||||
SubmitTableQuestionOutDto result = new SubmitTableQuestionOutDto();
|
||||
|
|
@ -2316,7 +2284,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
&& x.QuestionId == inDto.QuestionId
|
||||
).CountAsync()) + 1))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_MaxQuestion", _userInfo.IsEn_Us? questionInfo.QuestionEnName:questionInfo.QuestionName, questionInfo.MaxQuestionCount]);
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_MaxQuestion", _userInfo.IsEn_Us ? questionInfo.QuestionEnName : questionInfo.QuestionName, questionInfo.MaxQuestionCount]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2528,7 +2496,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <param name="inDto"></param>
|
||||
/// <returns></returns>
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> SubmitDicomVisitTask(SubmitDicomVisitTaskInDto inDto)
|
||||
{
|
||||
|
||||
|
|
@ -2613,7 +2581,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var criterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskInfo.TrialReadingCriterionId).FirstNotNullAsync();
|
||||
|
||||
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId&&x.Type != "group")
|
||||
var readingQuestionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId && x.Type != "group")
|
||||
.WhereIf(taskInfo.SourceSubjectVisit.IsBaseLine, x => ((x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show) && (x.LimitEdit == LimitEdit.None || x.LimitEdit == LimitEdit.OnlyBaseLine)))
|
||||
.WhereIf(!taskInfo.SourceSubjectVisit.IsBaseLine, x => ((x.IsRequired == IsRequired.Required && x.ShowQuestion == ShowQuestion.Show) && (x.LimitEdit == LimitEdit.None || x.LimitEdit == LimitEdit.OnlyVisit)))
|
||||
.WhereIf(taskInfo.TrialReadingCriterion.CriterionType == CriterionType.PCWG3, x => x.QuestionType != QuestionType.SiteVisitForTumorEvaluation)
|
||||
|
|
@ -2729,7 +2697,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<bool> ClearSkipReadingCache()
|
||||
{
|
||||
|
||||
await _fusionCache.RemoveAsync(CacheKeys.SkipReadingCacheKey(_userInfo.Id));
|
||||
await _fusionCache.RemoveAsync(CacheKeys.SkipReadingCacheKey(_userInfo.UserRoleId));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -2742,18 +2710,18 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<bool> SetSkipReadingCache(SetSkipReadingCacheInDto inDto)
|
||||
{
|
||||
var clearSkipReadingCache = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.SkipReadingCacheKey(_userInfo.Id));
|
||||
var clearSkipReadingCache = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.SkipReadingCacheKey(_userInfo.UserRoleId));
|
||||
if (clearSkipReadingCache == null || clearSkipReadingCache == string.Empty)
|
||||
{
|
||||
List<Guid> cacheIds = new List<Guid>();
|
||||
cacheIds.Add(inDto.VisitTaskId);
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.SkipReadingCacheKey(_userInfo.Id), JsonConvert.SerializeObject(cacheIds), TimeSpan.FromHours(24));
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.SkipReadingCacheKey(_userInfo.UserRoleId), JsonConvert.SerializeObject(cacheIds), TimeSpan.FromHours(24));
|
||||
}
|
||||
else
|
||||
{
|
||||
List<Guid>? cacheIds = JsonConvert.DeserializeObject<List<Guid>>(clearSkipReadingCache);
|
||||
cacheIds.Add(inDto.VisitTaskId);
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.SkipReadingCacheKey(_userInfo.Id), JsonConvert.SerializeObject(cacheIds), TimeSpan.FromHours(24));
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.SkipReadingCacheKey(_userInfo.UserRoleId), JsonConvert.SerializeObject(cacheIds), TimeSpan.FromHours(24));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -2784,7 +2752,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
#region 跳过阅片
|
||||
var clearSkipReadingCache = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.SkipReadingCacheKey(_userInfo.Id));
|
||||
var clearSkipReadingCache = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.SkipReadingCacheKey(_userInfo.UserRoleId));
|
||||
|
||||
|
||||
List<Guid> cacheSkipIds = new List<Guid>();
|
||||
|
|
@ -2892,7 +2860,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
List<Guid> remainingItems = taskList.Select(x => x.Id).Except(cacheSkipIds).ToList();
|
||||
|
||||
//受试者随机固定排序
|
||||
taskList = taskList.Where(x => remainingItems.Contains(x.Id)).OrderBy(t=>t.TaskBlindName).ToList();
|
||||
taskList = taskList.Where(x => remainingItems.Contains(x.Id)).OrderBy(t => t.TaskBlindName).ToList();
|
||||
|
||||
// 当前受试者没有就找其他受试者
|
||||
if (taskList.Count() == 0)
|
||||
|
|
@ -2949,10 +2917,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
else
|
||||
{
|
||||
var query = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == trialReadingCriterionId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.DoctorUserId == _userInfo.Id
|
||||
var query = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == trialReadingCriterionId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.DoctorUserId == _userInfo.UserRoleId
|
||||
&& x.TrialReadingCriterionId == trialReadingCriterionId
|
||||
&& x.TaskState == TaskState.Effect)
|
||||
.Where(x=> !cacheSkipIds.Contains(x.Id));
|
||||
.Where(x => !cacheSkipIds.Contains(x.Id));
|
||||
var count = await query.CountAsync();
|
||||
if (count == 0)
|
||||
{
|
||||
|
|
@ -3066,7 +3034,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
task.IsConvertedTask = visitTaskInfo.IsConvertedTask;
|
||||
var blindSubjectCode = await _visitTaskRepository.Where(x => x.Id == task.VisitTaskId).Select(x => x.BlindSubjectCode).FirstNotNullAsync();
|
||||
task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode;
|
||||
task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count > 0;
|
||||
task.ExistsManual = false;
|
||||
task.ReadingTaskState = visitTaskInfo.ReadingTaskState;
|
||||
// 添加默认答案
|
||||
if (inDto.VisitTaskId == null && visitTaskInfo.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||
|
|
@ -3124,17 +3092,17 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
return true;
|
||||
}
|
||||
var startReadingTimeKey = _userInfo.Id.ToString() + "StartReadingTime";
|
||||
var startRestTimeKey = _userInfo.Id.ToString() + "StartRestTime";
|
||||
var startReadingTimeKey = _userInfo.UserRoleId.ToString() + "StartReadingTime";
|
||||
var startRestTimeKey = _userInfo.UserRoleId.ToString() + "StartRestTime";
|
||||
|
||||
int readingMinute = _verifyConfig.CurrentValue.ContinuousReadingTimeMin; // 为60整数
|
||||
int restMinute = _verifyConfig.CurrentValue.ReadingRestTimeMin; //
|
||||
var startReadingTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.Id));
|
||||
var startRestTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.StartRestTime(_userInfo.Id));
|
||||
var startReadingTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.UserRoleId));
|
||||
var startRestTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.StartRestTime(_userInfo.UserRoleId));
|
||||
|
||||
if (startReadingTime == null && startRestTime == null)
|
||||
{
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.UserRoleId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
||||
}
|
||||
else if (startRestTime != null)
|
||||
{
|
||||
|
|
@ -3147,8 +3115,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
else
|
||||
{
|
||||
// 休息时间>10分钟 删除休息时间的缓存 记录开始阅片时间
|
||||
await _fusionCache.RemoveAsync(CacheKeys.StartRestTime(_userInfo.Id));
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
||||
await _fusionCache.RemoveAsync(CacheKeys.StartRestTime(_userInfo.UserRoleId));
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.UserRoleId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -3160,8 +3128,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
int timespanMin = (DateTime.Now - cacheDate).Minutes;
|
||||
if (timespanMin > readingMinute)
|
||||
{
|
||||
await _fusionCache.RemoveAsync(CacheKeys.StartReadingTimeKey(_userInfo.Id));
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.StartRestTime(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
||||
await _fusionCache.RemoveAsync(CacheKeys.StartReadingTimeKey(_userInfo.UserRoleId));
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.StartRestTime(_userInfo.UserRoleId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
||||
|
||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_NeedRest", readingMinute / 60m, restMinute]);
|
||||
}
|
||||
|
|
@ -3181,26 +3149,26 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
if (userID == null)
|
||||
{
|
||||
userID = _userInfo.Id;
|
||||
userID = _userInfo.UserRoleId;
|
||||
}
|
||||
|
||||
//int readingMinute = 120; // 为60整数
|
||||
int restMinute = 10; //
|
||||
|
||||
var startReadingTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.Id));
|
||||
var startRestTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.StartRestTime(_userInfo.Id));
|
||||
var startReadingTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.UserRoleId));
|
||||
var startRestTime = await _fusionCache.GetOrDefaultAsync<string>(CacheKeys.StartRestTime(_userInfo.UserRoleId));
|
||||
if (startRestTime != null)
|
||||
{
|
||||
var cacheStartRestTime = DateTime.Parse(startRestTime!.ToString());
|
||||
int timespanMin = (DateTime.Now - cacheStartRestTime).Minutes;
|
||||
if (timespanMin > restMinute)
|
||||
{
|
||||
await _fusionCache.RemoveAsync(CacheKeys.StartRestTime(_userInfo.Id));
|
||||
await _fusionCache.RemoveAsync(CacheKeys.StartRestTime(_userInfo.UserRoleId));
|
||||
}
|
||||
}
|
||||
else if (startReadingTime != null)
|
||||
{
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.Id), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
||||
await _fusionCache.SetAsync<string>(CacheKeys.StartReadingTimeKey(_userInfo.UserRoleId), DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), TimeSpan.FromHours(48));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -3215,7 +3183,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
await VerifyTaskIsSign(visitTaskId);
|
||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(visitTaskId, x => new VisitTask()
|
||||
{
|
||||
DoctorUserId = _userInfo.Id,
|
||||
DoctorUserId = _userInfo.UserRoleId,
|
||||
ReadingTaskState = ReadingTaskState.HaveSigned,
|
||||
SignTime = DateTime.Now,
|
||||
});
|
||||
|
|
@ -3430,7 +3398,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task AddReadingTask(Guid visitTaskId, Guid? trialId = null)
|
||||
{
|
||||
// ****** 先生成阅片期 阅片期任务阅片完成之后生成肿瘤学的 如果没有阅片期 直接生成肿瘤学 *********////
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<List<DefaultShortcutKeyView>> GetDoctorShortcutKey(DefaultShortcutKeyQuery inQuery)
|
||||
{
|
||||
var shortcutKeyList = await _shortcutKeyRepository.Where(x => x.ImageToolType == inQuery.ImageToolType)
|
||||
.Where(x => x.UserId == _userInfo.Id)
|
||||
.Where(x => x.UserId == _userInfo.UserRoleId)
|
||||
.ToListAsync();
|
||||
|
||||
var defaultshortcutKeyList = this.GetDefaultShortcutKey();
|
||||
|
|
@ -302,17 +302,17 @@ namespace IRaCIS.Core.Application.Service
|
|||
var shortcutKeys = GetDefaultShortcutKey();
|
||||
shortcutKeys.ForEach(x =>
|
||||
{
|
||||
x.UserId = _userInfo.Id;
|
||||
x.UserId = _userInfo.UserRoleId;
|
||||
});
|
||||
|
||||
await _shortcutKeyRepository.BatchDeleteNoTrackingAsync(x => x.ImageToolType == inDto.ImageToolType && x.UserId == _userInfo.Id);
|
||||
await _shortcutKeyRepository.BatchDeleteNoTrackingAsync(x => x.ImageToolType == inDto.ImageToolType && x.UserId == _userInfo.UserRoleId);
|
||||
|
||||
await _shortcutKeyRepository.AddRangeAsync(shortcutKeys.Select(x => new ShortcutKey()
|
||||
{
|
||||
ImageToolType = inDto.ImageToolType,
|
||||
Keyboardkey = x.Keyboardkey,
|
||||
ShortcutKeyEnum = x.ShortcutKeyEnum,
|
||||
UserId = _userInfo.Id,
|
||||
UserId = _userInfo.UserRoleId,
|
||||
AltKey = x.AltKey,
|
||||
CtrlKey = x.CtrlKey,
|
||||
MetaKey = x.MetaKey,
|
||||
|
|
@ -332,14 +332,14 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<bool> SetShortcutKey(SetDefaultShortcutKey inDto)
|
||||
{
|
||||
await _shortcutKeyRepository.BatchDeleteNoTrackingAsync(x => x.ImageToolType == inDto.ImageToolType && x.UserId == _userInfo.Id);
|
||||
await _shortcutKeyRepository.BatchDeleteNoTrackingAsync(x => x.ImageToolType == inDto.ImageToolType && x.UserId == _userInfo.UserRoleId);
|
||||
|
||||
await _shortcutKeyRepository.AddRangeAsync(inDto.ShortcutKeyList.Select(x => new ShortcutKey()
|
||||
{
|
||||
ImageToolType = inDto.ImageToolType,
|
||||
Keyboardkey = x.Keyboardkey,
|
||||
ShortcutKeyEnum = x.ShortcutKeyEnum,
|
||||
UserId = _userInfo.Id,
|
||||
UserId = _userInfo.UserRoleId,
|
||||
AltKey = x.AltKey,
|
||||
CtrlKey = x.CtrlKey,
|
||||
MetaKey = x.MetaKey,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<List<UserWLTemplateView>> GetUserWLTemplateList(UserWLTemplateQuery inQuery)
|
||||
{
|
||||
var userWLTemplateQueryable = _userWLTemplateRepository
|
||||
.Where(x => x.UserId == _userInfo.Id)
|
||||
.Where(x => x.UserId == _userInfo.UserRoleId)
|
||||
.ProjectTo<UserWLTemplateView>(_mapper.ConfigurationProvider);
|
||||
return await userWLTemplateQueryable.ToListAsync();
|
||||
}
|
||||
|
|
@ -40,10 +40,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// <returns></returns>
|
||||
public async Task<IResponseOutput> AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate)
|
||||
{
|
||||
addOrEditUserWLTemplate.UserId = _userInfo.Id;
|
||||
addOrEditUserWLTemplate.UserId = _userInfo.UserRoleId;
|
||||
if (addOrEditUserWLTemplate.Id == null)
|
||||
{
|
||||
var count = await _userWLTemplateRepository.Where(x => x.UserId == _userInfo.Id).CountAsync();
|
||||
var count = await _userWLTemplateRepository.Where(x => x.UserId == _userInfo.UserRoleId).CountAsync();
|
||||
if (count >= 10)
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["UserWLTS_MaxTemplate"]);
|
||||
|
|
@ -51,12 +51,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
}
|
||||
|
||||
if (await _userWLTemplateRepository.AnyAsync(x => x.UserId == _userInfo.Id && x.TemplateName == addOrEditUserWLTemplate.TemplateName && x.Id != addOrEditUserWLTemplate.Id))
|
||||
if (await _userWLTemplateRepository.AnyAsync(x => x.UserId == _userInfo.UserRoleId && x.TemplateName == addOrEditUserWLTemplate.TemplateName && x.Id != addOrEditUserWLTemplate.Id))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["UserWLTS_NameRepeated"]);
|
||||
}
|
||||
|
||||
if (await _userWLTemplateRepository.AnyAsync(x => x.UserId == _userInfo.Id && x.WW == addOrEditUserWLTemplate.WW && x.WL == addOrEditUserWLTemplate.WL && x.Id != addOrEditUserWLTemplate.Id))
|
||||
if (await _userWLTemplateRepository.AnyAsync(x => x.UserId == _userInfo.UserRoleId && x.WW == addOrEditUserWLTemplate.WW && x.WL == addOrEditUserWLTemplate.WL && x.Id != addOrEditUserWLTemplate.Id))
|
||||
{
|
||||
throw new BusinessValidationFailedException(_localizer["UserWLTS_ContentRepeated"]);
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<object> GetAutoCutNextTask()
|
||||
{
|
||||
|
||||
return await _userRoleRepository.Where(x => x.Id == _userInfo.Id).Select(x => new
|
||||
return await _userRoleRepository.Where(x => x.Id == _userInfo.UserRoleId).Select(x => new
|
||||
{
|
||||
AutoCutNextTask = x.AutoCutNextTask
|
||||
}).FirstNotNullAsync();
|
||||
|
|
@ -100,7 +100,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> SetAutoCutNextTask(SetAutoCutNextTaskInDto inDto)
|
||||
{
|
||||
await _userRoleRepository.UpdatePartialFromQueryAsync(_userInfo.Id, x => new UserRole()
|
||||
await _userRoleRepository.UpdatePartialFromQueryAsync(_userInfo.UserRoleId, x => new UserRole()
|
||||
{
|
||||
|
||||
AutoCutNextTask = inDto.AutoCutNextTask
|
||||
|
|
|
|||
|
|
@ -1,64 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2021-12-23 13:21:04
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
/// <summary> TrialSiteEquipmentSurveyView 列表视图模型 </summary>
|
||||
public class TrialSiteEquipmentSurveyView
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
public string EquipmentType { get; set; } = string.Empty;
|
||||
public Guid? EquipmentTypeId { get; set; }
|
||||
|
||||
public string Parameters { get; set; } = string.Empty;
|
||||
public string ManufacturerName { get; set; } = string.Empty;
|
||||
public string ScannerType { get; set; } = string.Empty;
|
||||
public string Note { get; set; } = string.Empty;
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
}
|
||||
|
||||
///<summary>TrialSiteEquipmentSurveyQuery 列表查询参数模型</summary>
|
||||
public class TrialSiteEquipmentSurveyQuery
|
||||
{
|
||||
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
|
||||
public string ScannerType { get; set; } = string.Empty;
|
||||
|
||||
/////<summary> Parameters</summary>
|
||||
//public string Parameters { get; set; }
|
||||
|
||||
/////<summary> ManufacturerName</summary>
|
||||
//public string ManufacturerName { get; set; }
|
||||
|
||||
/////<summary> ScannerType</summary>
|
||||
//public string ScannerType { get; set; }
|
||||
|
||||
/////<summary> Note</summary>
|
||||
//public string Note { get; set; }
|
||||
|
||||
}
|
||||
|
||||
///<summary> TrialSiteEquipmentSurveyAddOrEdit 列表查询参数模型</summary>
|
||||
public class TrialSiteEquipmentSurveyAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
|
||||
public Guid? EquipmentTypeId { get; set; }
|
||||
public string Parameters { get; set; } = string.Empty;
|
||||
public string ManufacturerName { get; set; } = string.Empty;
|
||||
public string ScannerType { get; set; } = string.Empty;
|
||||
public string Note { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,397 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2021-12-23 13:21:04
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
|
||||
public class TrialSurveyInitInfo
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
public string Sponsor { get; set; } = string.Empty;
|
||||
|
||||
//研究方案号
|
||||
public string ResearchProgramNo { get; set; } = string.Empty;
|
||||
|
||||
//实验名称
|
||||
public string ExperimentName { get; set; } = string.Empty;
|
||||
|
||||
public string TrialCode { get; set; } = string.Empty;
|
||||
|
||||
public Guid IndicationTypeId { get; set; }
|
||||
|
||||
public string IndicationType { get; set; } = string.Empty;
|
||||
|
||||
public string TrialSiteSurveyUserRoles { get; set; } = string.Empty;
|
||||
|
||||
public string TrialSiteSurveyEquipmentType { get; set; } = string.Empty;
|
||||
|
||||
public string Modalitys { get; set; }
|
||||
|
||||
public List<TrialSiteForSelect> TrialSiteSelectList { get; set; } = new List<TrialSiteForSelect>();
|
||||
|
||||
}
|
||||
|
||||
public class TrialSiteForSelect
|
||||
{
|
||||
public Guid TrialSiteId => Id;
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? SiteId { get; set; }
|
||||
|
||||
public string TrialSiteCode { get; set; } = string.Empty;
|
||||
|
||||
public string TrialSiteAliasName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public bool IsHaveSiteSurveyRecord { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class TrialSiteSimpleSelect
|
||||
{
|
||||
|
||||
public string TrialSiteCode { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
public class LoginReturnDTO
|
||||
{
|
||||
public TrialSurveyInitInfo TrialInfo { get; set; } = new TrialSurveyInitInfo();
|
||||
|
||||
public TrialSiteSurveyView TrialSiteSurvey { get; set; } = new TrialSiteSurveyView();
|
||||
|
||||
public List<TrialSiteEquipmentSurveyView> TrialSiteEquipmentSurveyList { get; set; } = new List<TrialSiteEquipmentSurveyView>();
|
||||
|
||||
public List<TrialSiteUserSurveyView> TrialSiteUserSurveyList { get; set; } = new List<TrialSiteUserSurveyView>();
|
||||
|
||||
|
||||
public TrialExtraConfig SiteSurveyFiledConfig { get; set; }
|
||||
}
|
||||
|
||||
public class TrialSiteUserSurveyAllDTO : TrialSiteUserSurveyView
|
||||
{
|
||||
public TrialSiteSurveyView TrialSiteSurvey { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class TrialSiteUserSurveyExportQueryDto
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? UserTypeId { get; set; }
|
||||
|
||||
|
||||
public bool? IsGenerateAccount { get; set; }
|
||||
|
||||
public TrialSiteUserStateEnum? State { get; set; }
|
||||
|
||||
public string FormWriterKeyInfo { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
|
||||
public string OrganizationName { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class TrialSiteUserSurveyAllQuery : PageInput
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public Guid? UserTypeId { get; set; }
|
||||
|
||||
|
||||
public bool? IsGenerateAccount { get; set; }
|
||||
public int? TrialRoleCode { get; set; }
|
||||
|
||||
public TrialSiteUserStateEnum? State { get; set; }
|
||||
|
||||
public string FormWriterKeyInfo { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
|
||||
public string OrganizationName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary> TrialSiteSurveyView 列表视图模型 </summary>
|
||||
public class TrialSiteSurveyView
|
||||
{
|
||||
|
||||
public string TrialSiteCode { get; set; } = String.Empty;
|
||||
public string TrialSiteAliasName { get; set; } = String.Empty;
|
||||
|
||||
public string SiteName { get; set; } = string.Empty;
|
||||
public bool IsDeleted { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public int AverageEngravingCycle { get; set; }
|
||||
public bool IsConfirmImagingTechnologist { get; set; }
|
||||
public string NotConfirmReson { get; set; } = string.Empty;
|
||||
public int EfficacyEvaluatorType { get; set; }
|
||||
public bool IsFollowStudyParameters { get; set; }
|
||||
public string NotFollowReson { get; set; } = string.Empty;
|
||||
|
||||
public TrialSiteSurveyEnum State { get; set; }
|
||||
|
||||
public string LatestBackReason { get; set; } = string.Empty;
|
||||
|
||||
public UserInfoBasic ReviewerUser { get; set; }
|
||||
public UserInfoBasic PreliminaryUser { get; set; }
|
||||
|
||||
public Guid? PreliminaryUserId { get; set; }
|
||||
|
||||
public Guid? ReviewerUserId { get; set; }
|
||||
|
||||
|
||||
public DateTime? PreliminaryTime { get; set; }
|
||||
|
||||
public DateTime? ReviewerTime { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public class TrialSiteSurveySelectView
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public TrialSiteSurveyEnum State { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public bool IsDeleted { get; set; }
|
||||
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
public class TrialSiteSurveySelectquery
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
}
|
||||
|
||||
///<summary>TrialSiteSurveyQuery 列表查询参数模型</summary>
|
||||
public class TrialSiteSurveyQuery
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
/////<summary> UserName</summary>
|
||||
//public string UserName { get; set; }
|
||||
|
||||
/////<summary> Phone</summary>
|
||||
//public string Phone { get; set; }
|
||||
|
||||
/////<summary> Email</summary>
|
||||
//public string Email { get; set; }
|
||||
|
||||
/////<summary> NotConfirmReson</summary>
|
||||
//public string NotConfirmReson { get; set; }
|
||||
|
||||
/////<summary> NotFollowReson</summary>
|
||||
//public string NotFollowReson { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class VerifyEmialGetDoctorInfoInDto
|
||||
{
|
||||
public string VerificationCode { get; set; }
|
||||
|
||||
public string EmailOrPhone { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public class UseUserIDGetDoctorIDOutDto
|
||||
{
|
||||
public Guid? DoctorID { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class UseUserIDGetDoctorIDInDto
|
||||
{
|
||||
public Guid UserID { get; set; }
|
||||
}
|
||||
|
||||
public class VerifyEmialGetDoctorInfoOutDto
|
||||
{
|
||||
public Guid? DoctorId { get; set; }
|
||||
|
||||
public ReviewerInformationConfirmStatus? ReviewStatus { get; set; }
|
||||
|
||||
public string Token { get; set; }
|
||||
}
|
||||
|
||||
public class SendEmialVerifyCodeInDto
|
||||
{
|
||||
public string Email { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class SiteSurveySendVerifyCode
|
||||
{
|
||||
//public VerifyType verificationType { get; set; }
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class LoginDto
|
||||
{
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
|
||||
public bool IsUpdate { get; set; }
|
||||
|
||||
|
||||
public string ReplaceUserEmailOrPhone { get; set; } = string.Empty;
|
||||
|
||||
public VerifyType verificationType { get; set; }
|
||||
public string EmailOrPhone { get; set; } = string.Empty;
|
||||
|
||||
public string verificationCode { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
///<summary> TrialSiteSurveyAddOrEdit 列表查询参数模型</summary>
|
||||
public class TrialSiteSurveyAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
public Guid TrialId { get; set; }
|
||||
public Guid TrialSiteId { get; set; }
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public int AverageEngravingCycle { get; set; }
|
||||
public bool IsConfirmImagingTechnologist { get; set; }
|
||||
public string NotConfirmReson { get; set; } = string.Empty;
|
||||
public int EfficacyEvaluatorType { get; set; }
|
||||
public bool IsFollowStudyParameters { get; set; }
|
||||
public string NotFollowReson { get; set; } = string.Empty;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class TrialSiteSubmitBackCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
|
||||
public string LatestBackReason { get; set; } = string.Empty;
|
||||
|
||||
public string RouteUrl { get; set; }
|
||||
}
|
||||
|
||||
public class InviteEmailCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
|
||||
public string RouteUrl { get; set; } = string.Empty;
|
||||
|
||||
public List<TrialSiteUserSurveyView> UserList { get; set; } = new List<TrialSiteUserSurveyView>();
|
||||
}
|
||||
|
||||
|
||||
public class TrialSiteUserSurveyJoinCommand
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
|
||||
public string BaseUrl { get; set; } = string.Empty;
|
||||
|
||||
public string RouteUrl { get; set; } = string.Empty;
|
||||
|
||||
public List<TrialSiteUserSurveyView> UserList { get; set; } = new List<TrialSiteUserSurveyView>();
|
||||
}
|
||||
|
||||
|
||||
public class TrialSiteSurvyeSubmitDTO
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
[NotDefault]
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
|
||||
|
||||
public string BaseUrl { get; set; } = string.Empty;
|
||||
public string RouteUrl { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public class TrialSiteSurveyQueryDTO : PageInput
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public Guid? TrialSiteId { get; set; }
|
||||
|
||||
public string UserKeyInfo { get; set; } = string.Empty;
|
||||
|
||||
|
||||
|
||||
public TrialSiteSurveyEnum? State { get; set; }
|
||||
|
||||
public bool? IsDeleted { get; set; }
|
||||
|
||||
public DateTime? UpdateTimeBegin { get; set; }
|
||||
|
||||
public DateTime? UpdateTimeEnd { get; set; }
|
||||
|
||||
public string? PreliminaryUserName { get; set; }
|
||||
|
||||
public string? ReviewerUserName { get; set; }
|
||||
|
||||
}
|
||||
|
||||
public class CopyTrialSiteSurveyDTO
|
||||
{
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
public string UserName { get; set; } = string.Empty;
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2021-12-23 13:21:04
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using MiniExcelLibs.Attributes;
|
||||
using Newtonsoft.Json;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
/// <summary> TrialSiteUserSurveyView 列表视图模型 </summary>
|
||||
public class TrialSiteUserSurveyView : TrialSiteUserSurveyAddOrEdit
|
||||
{
|
||||
public bool IsGenerateSuccess { get; set; }
|
||||
public DateTime CreateTime { get; set; }
|
||||
public Guid CreateUserId { get; set; }
|
||||
public DateTime UpdateTime { get; set; }
|
||||
public Guid UpdateUserId { get; set; }
|
||||
|
||||
public string UserType { get; set; } = string.Empty;
|
||||
|
||||
[JsonIgnore]
|
||||
public TrialSiteUserStateEnum InviteState { get; set; }
|
||||
|
||||
public DateTime? ExpireTime { get; set; }
|
||||
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool? IsJoin { get; set; }
|
||||
|
||||
public DateTime? ConfirmTime { get; set; }
|
||||
|
||||
public string RejectReason { get; set; } = string.Empty;
|
||||
|
||||
[DictionaryTranslateAttribute("researchUserState")]
|
||||
public TrialSiteUserStateEnum State
|
||||
{
|
||||
get
|
||||
{
|
||||
if (InviteState == TrialSiteUserStateEnum.HasSend && ExpireTime != null && ExpireTime < DateTime.Now)
|
||||
{
|
||||
return TrialSiteUserStateEnum.OverTime;
|
||||
}
|
||||
else
|
||||
{
|
||||
return InviteState;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public UserTypeEnum? UserTypeEnum { get; set; }
|
||||
|
||||
public Guid? SystemUserId { get; set; }
|
||||
|
||||
|
||||
|
||||
|
||||
public bool? IsHistoryUserOriginDeleted { 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
|
||||
{
|
||||
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
|
||||
/////<summary> UserName</summary>
|
||||
//public string Name { get; set; }
|
||||
|
||||
/////<summary> Phone</summary>
|
||||
//public string Phone { get; set; }
|
||||
|
||||
/////<summary> Email</summary>
|
||||
//public string Email { get; set; }
|
||||
|
||||
}
|
||||
|
||||
///<summary> TrialSiteUserSurveyAddOrEdit 列表查询参数模型</summary>
|
||||
public class TrialSiteUserSurveyAddOrEdit
|
||||
{
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
public Guid? UserTypeId { get; set; }
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool IsGenerateAccount { get; set; }
|
||||
|
||||
[DictionaryTranslateAttribute("SiteSurvey_UserRoles")]
|
||||
public int TrialRoleCode { get; set; }
|
||||
|
||||
public string OrganizationName { get; set; } = string.Empty;
|
||||
|
||||
public bool IsHistoryUser { get; set; }
|
||||
public bool? IsHistoryUserDeleted { get; set; }
|
||||
}
|
||||
|
||||
public class TrialSiteUserSurverQuery
|
||||
{
|
||||
public Guid TrialSiteSurveyId { get; set; }
|
||||
|
||||
public bool? IsHistoryUser { get; set; }
|
||||
}
|
||||
|
||||
public class TrialSiteUserSurveyVerfyResult
|
||||
{
|
||||
public Guid TrialSiteUserSurveyId { get; set; }
|
||||
|
||||
public List<string> ErroMsgList { get; set; } = new List<string>();
|
||||
}
|
||||
|
||||
public class SiteSurveyUserImportUploadDto
|
||||
{
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public string BaseUrl { get; set; }
|
||||
public string RouteUrl { get; set; }
|
||||
}
|
||||
|
||||
public class SiteSurveyUserImportDto
|
||||
{
|
||||
public string TrialSiteCode { get; set; } = string.Empty;
|
||||
public string FirstName { get; set; } = string.Empty;
|
||||
public string LastName { get; set; } = string.Empty;
|
||||
public string Email { get; set; } = string.Empty;
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public string OrganizationName { get; set; } = string.Empty;
|
||||
|
||||
[ExcelColumnName("UserType")]
|
||||
public string UserTypeStr { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Guid TrialSiteId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public UserTypeEnum UserTypeEnum { get; set; } = UserTypeEnum.Undefined;
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public Guid UserTypeId { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public bool IsGeneratedAccount { get; set; }
|
||||
[JsonIgnore]
|
||||
public bool IsJoinedTrial { get; set; }
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2021-12-23 13:20:59
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface ITrialSiteEquipmentSurveyService
|
||||
{
|
||||
Task<IResponseOutput> AddOrUpdateTrialSiteEquipmentSurvey(TrialSiteEquipmentSurveyAddOrEdit addOrEditTrialSiteEquipmentSurvey);
|
||||
Task<IResponseOutput> DeleteTrialSiteEquipmentSurvey(Guid trialSiteEquipmentSurveyId);
|
||||
Task<List<TrialSiteEquipmentSurveyView>> GetTrialSiteEquipmentSurveyList(Guid trialSiteSurveyId, string? scannerType);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2021-12-23 13:20:59
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Application.Auth;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface ITrialSiteSurveyService
|
||||
{
|
||||
Task<IResponseOutput> AddOrUpdateTrialSiteSurvey(TrialSiteSurveyAddOrEdit addOrEditTrialSiteSurvey);
|
||||
Task<IResponseOutput> DeleteTrialSiteSurvey(Guid trialSiteSurveyId);
|
||||
Task<LoginReturnDTO> GetSiteSurveyInfo(Guid trialSiteSurveyId, Guid trialId);
|
||||
Task<PageOutput<TrialSiteSurveyView>> GetTrialSiteSurveyList(TrialSiteSurveyQueryDTO surveyQueryDTO);
|
||||
Task<TrialSurveyInitInfo> GetTrialSurveyInitInfo(Guid trialId);
|
||||
Task<IResponseOutput> SendVerifyCode(SiteSurveySendVerifyCode userInfo);
|
||||
//Task<IResponseOutput> TrialSurveyLock(Guid trialSiteSurveyId, bool isLock);
|
||||
//IResponseOutput TrialSurveySubmmit(Guid trialId, Guid trialSiteSurveyId);
|
||||
Task<IResponseOutput> VerifySendCode(LoginDto userInfo, [FromServices] ITokenService _tokenService);
|
||||
|
||||
Task ImportGenerateAccountAndJoinTrialAsync(Guid trialId, string baseUrl, string routeUrl, List<SiteSurveyUserImportDto> list);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2021-12-23 13:20:59
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
public interface ITrialSiteUserSurveyService
|
||||
{
|
||||
Task<IResponseOutput> AddOrUpdateTrialSiteUserSurvey(TrialSiteUserSurveyAddOrEdit addOrEditTrialSiteUserSurvey);
|
||||
Task<IResponseOutput> DeleteTrialSiteUserSurvey(Guid trialSiteUserSurveyId);
|
||||
Task<List<TrialSiteUserSurveyView>> GetTrialSiteUserSurveyList(TrialSiteUserSurverQuery inquery);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2021-12-23 13:20:59
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// TrialSiteEquipmentSurveyService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TrialSiteEquipmentSurveyService(IRepository<TrialSiteEquipmentSurvey> _trialSiteEquipmentSurveyRepository,
|
||||
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialSiteEquipmentSurveyService
|
||||
{
|
||||
|
||||
|
||||
|
||||
[HttpGet("{trialSiteSurveyId:guid}")]
|
||||
public async Task<List<TrialSiteEquipmentSurveyView>> GetTrialSiteEquipmentSurveyList(Guid trialSiteSurveyId, string? scannerType)
|
||||
{
|
||||
var trialSiteEquipmentSurveyQueryable = _trialSiteEquipmentSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId)
|
||||
.WhereIf(!string.IsNullOrEmpty(scannerType), t => t.ScannerType.Contains(scannerType!))
|
||||
.ProjectTo<TrialSiteEquipmentSurveyView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
return await trialSiteEquipmentSurveyQueryable.ToListAsync();
|
||||
}
|
||||
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[HttpPost("{trialId:guid}")]
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialSiteEquipmentSurvey(TrialSiteEquipmentSurveyAddOrEdit addOrEditTrialSiteEquipmentSurvey)
|
||||
{
|
||||
|
||||
if (await _trialSiteSurveyRepository.AnyAsync(t => t.Id == addOrEditTrialSiteEquipmentSurvey.TrialSiteSurveyId && (t.IsDeleted == true || t.State == TrialSiteSurveyEnum.PMCreatedAndLock), true))
|
||||
{
|
||||
return ResponseOutput.NotOk(_localizer["TrialSiteEquipment_Invalid"]);
|
||||
}
|
||||
|
||||
var entity = await _trialSiteEquipmentSurveyRepository.InsertOrUpdateAsync(addOrEditTrialSiteEquipmentSurvey, true);
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[HttpDelete("{trialSiteEquipmentSurveyId:guid}/{trialId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteTrialSiteEquipmentSurvey(Guid trialSiteEquipmentSurveyId)
|
||||
{
|
||||
if (await _trialSiteEquipmentSurveyRepository.Where(t => t.Id == trialSiteEquipmentSurveyId).AnyAsync(t => t.TrialSiteSurvey.State == TrialSiteSurveyEnum.PMCreatedAndLock))
|
||||
{
|
||||
//---已锁定,不允许操作
|
||||
return ResponseOutput.NotOk(_localizer["TrialSiteEquipment_Locked"]);
|
||||
}
|
||||
await _trialSiteEquipmentSurveyRepository.DeleteFromQueryAsync(t => t.Id == trialSiteEquipmentSurveyId);
|
||||
var success = await _trialSiteEquipmentSurveyRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,152 +0,0 @@
|
|||
//--------------------------------------------------------------------
|
||||
// 此代码由T4模板自动生成 byzhouhang 20210918
|
||||
// 生成时间 2021-12-23 13:20:59
|
||||
// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。
|
||||
//--------------------------------------------------------------------
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace IRaCIS.Core.Application.Contracts
|
||||
{
|
||||
/// <summary>
|
||||
/// TrialSiteUserSurveyService
|
||||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TrialSiteUserSurveyService(IRepository<TrialSiteUserSurvey> _trialSiteUserSurveyRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<UserRole> _userRoleRepository,
|
||||
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialSiteUserSurveyService
|
||||
{
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<List<TrialSiteUserSurveyView>> GetTrialSiteUserSurveyList(TrialSiteUserSurverQuery inquery)
|
||||
{
|
||||
|
||||
var trialSiteUserSurveyQueryable = _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == inquery.TrialSiteSurveyId)
|
||||
.WhereIf(inquery.IsHistoryUser != null, t => t.IsHistoryUser == inquery.IsHistoryUser)
|
||||
.ProjectTo<TrialSiteUserSurveyView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
return await trialSiteUserSurveyQueryable.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[HttpPost("{trialId:guid}")]
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialSiteUserSurvey(TrialSiteUserSurveyAddOrEdit addOrEditTrialSiteUserSurvey)
|
||||
{
|
||||
|
||||
|
||||
|
||||
if (await _trialSiteSurveyRepository.AnyAsync(t => t.Id == addOrEditTrialSiteUserSurvey.TrialSiteSurveyId && (t.IsDeleted == true || t.State == TrialSiteSurveyEnum.PMCreatedAndLock), true))
|
||||
{
|
||||
//当前调研表已废除,或者调研表状态已锁定,不允许操作
|
||||
return ResponseOutput.NotOk(_localizer["TrialSiteUserSurvey_Invalid"]);
|
||||
}
|
||||
|
||||
|
||||
if (addOrEditTrialSiteUserSurvey.IsGenerateAccount)
|
||||
{
|
||||
var trialId = _trialSiteSurveyRepository.Where(t => t.Id == addOrEditTrialSiteUserSurvey.TrialSiteSurveyId, false, true).Select(t => t.TrialId).FirstOrDefault();
|
||||
|
||||
var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault();
|
||||
|
||||
var item = addOrEditTrialSiteUserSurvey;
|
||||
|
||||
//找下系统中是否存在该用户类型的 并且邮箱 或者手机的账户
|
||||
var sysUserInfo = await _userRoleRepository.Where(t => t.UserTypeId == item.UserTypeId && t.EMail == item.Email).Include(t => t.UserTypeRole).FirstOrDefaultAsync();
|
||||
|
||||
if (sysUserInfo != null)
|
||||
{
|
||||
|
||||
if (trialType == TrialType.OfficialTrial || trialType == TrialType.Training)
|
||||
{
|
||||
|
||||
if (sysUserInfo.IsTestUser)
|
||||
{
|
||||
//---正式类型 、培训类型的项目 不允许加入测试用户
|
||||
throw new BusinessValidationFailedException(_localizer["TrialSiteUser_NoTestUserForFormal"]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (trialType == TrialType.NoneOfficial)
|
||||
{
|
||||
|
||||
if (sysUserInfo.IsTestUser == false)
|
||||
{
|
||||
//---测试项目 不允许加入正式用户
|
||||
throw new BusinessValidationFailedException(_localizer["TrialSiteUser_NoFormalUserForTest"]);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
var verifyExp1 = new EntityVerifyExp<TrialSiteUserSurvey>()
|
||||
{
|
||||
VerifyExp = u => u.UserTypeId == addOrEditTrialSiteUserSurvey.UserTypeId && u.Email == addOrEditTrialSiteUserSurvey.Email && u.TrialSiteSurveyId == addOrEditTrialSiteUserSurvey.TrialSiteSurveyId,
|
||||
VerifyMsg = _localizer["TrialSiteUser_SingleAccountPerEmailAndUserType"],// "同一邮箱同一用户类型,生成账号的数据只允许存在一条!",
|
||||
IsVerify = addOrEditTrialSiteUserSurvey.IsGenerateAccount
|
||||
|
||||
};
|
||||
|
||||
if (addOrEditTrialSiteUserSurvey.UserTypeId != null)
|
||||
{
|
||||
var existSysUser = await _userRoleRepository.Where(t => t.EMail == addOrEditTrialSiteUserSurvey.Email && t.UserTypeId == addOrEditTrialSiteUserSurvey.UserTypeId).Include(d => d.UserTypeRole).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
if (existSysUser != null)
|
||||
{
|
||||
if (existSysUser.LastName != addOrEditTrialSiteUserSurvey.LastName || existSysUser.FirstName != addOrEditTrialSiteUserSurvey.FirstName)
|
||||
{
|
||||
|
||||
|
||||
var optEntity = await _trialSiteUserSurveyRepository.InsertOrUpdateAsync(addOrEditTrialSiteUserSurvey, true, verifyExp1);
|
||||
|
||||
//$"该用户在系统中账户名为:{existSysUser.LastName + " / " + existSysUser.FirstName} ,与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存"
|
||||
return ResponseOutput.NotOk(_localizer["TrialSiteUser_InconsistentInfo", existSysUser.UserTypeRole.UserTypeShortName, existSysUser.EMail, existSysUser.LastName + " / " + existSysUser.FirstName, existSysUser.Phone],
|
||||
new { Id = optEntity.Id, existSysUser.LastName, existSysUser.FirstName, existSysUser.Phone, existSysUser.IsTestUser, existSysUser.IsZhiZhun }, ApiResponseCodeEnum.NeedTips);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var entity = await _trialSiteUserSurveyRepository.InsertOrUpdateAsync(addOrEditTrialSiteUserSurvey, true, verifyExp1);
|
||||
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok(entity.Id.ToString());
|
||||
|
||||
}
|
||||
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[HttpDelete("{trialSiteUserSurveyId:guid}/{trialId:guid}")]
|
||||
public async Task<IResponseOutput> DeleteTrialSiteUserSurvey(Guid trialSiteUserSurveyId)
|
||||
{
|
||||
|
||||
if (await _trialSiteUserSurveyRepository.Where(t => t.Id == trialSiteUserSurveyId).AnyAsync(t => t.TrialSiteSurvey.State == TrialSiteSurveyEnum.PMCreatedAndLock))
|
||||
{
|
||||
//---已锁定,不允许操作
|
||||
return ResponseOutput.NotOk(_localizer["TrialSiteUser_Locked"]);
|
||||
}
|
||||
|
||||
await _trialSiteUserSurveyRepository.DeleteFromQueryAsync(t => t.Id == trialSiteUserSurveyId);
|
||||
var success = await _trialSiteUserSurveyRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
using AutoMapper;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
|
||||
namespace IRaCIS.Core.Application.AutoMapper
|
||||
{
|
||||
/// <summary>
|
||||
/// 映射配置
|
||||
/// </summary>
|
||||
public partial class SiteSurveyConfig : Profile
|
||||
{
|
||||
public SiteSurveyConfig()
|
||||
{
|
||||
var isEn_Us = false;
|
||||
//编辑
|
||||
CreateMap<TrialSiteSurvey, TrialSiteSurveyAddOrEdit>().ReverseMap();
|
||||
|
||||
CreateMap<TrialSiteEquipmentSurveyAddOrEdit, TrialSiteEquipmentSurvey>().ReverseMap();
|
||||
|
||||
CreateMap<TrialSiteUserSurveyAddOrEdit, TrialSiteUserSurvey>().ReverseMap();
|
||||
|
||||
CreateMap<LoginDto, TrialSiteSurvey>().ForMember(d => d.Email, t => t.MapFrom(t => t.EmailOrPhone));
|
||||
|
||||
CreateMap<TrialSiteUser, TrialSiteUserSurvey>()
|
||||
.ForMember(d => d.Id, u => u.Ignore())
|
||||
.ForMember(d => d.Phone, u => u.MapFrom(c => c.User.Phone))
|
||||
.ForMember(d => d.Email, u => u.MapFrom(c => c.User.EMail))
|
||||
.ForMember(d => d.OrganizationName, u => u.MapFrom(c => c.User.OrganizationName))
|
||||
.ForMember(d => d.UserTypeId, u => u.MapFrom(c => c.User.UserTypeId))
|
||||
.ForMember(d => d.IsHistoryUser, u => u.MapFrom(c => true))
|
||||
.ForMember(d => d.IsHistoryUserOriginDeleted, u => u.MapFrom(c => c.IsDeleted))
|
||||
.ForMember(d => d.IsHistoryUserDeleted, u => u.MapFrom(c => c.IsDeleted))
|
||||
.ForMember(d => d.FirstName, u => u.MapFrom(c => c.User.FirstName))
|
||||
.ForMember(d => d.LastName, u => u.MapFrom(c => c.User.LastName))
|
||||
.ForMember(d => d.IsGenerateAccount, u => u.MapFrom(c => true))
|
||||
.ForMember(d => d.IsGenerateSuccess, u => u.MapFrom(c => true))
|
||||
.ForMember(d => d.SystemUserId, u => u.MapFrom(c => c.UserId))
|
||||
.ForMember(d => d.IsJoin, u => u.MapFrom(c => !c.IsDeleted))
|
||||
.ForMember(d => d.CreateUserRole, u => u.Ignore());
|
||||
|
||||
|
||||
//列表
|
||||
CreateMap<TrialSiteEquipmentSurvey, TrialSiteEquipmentSurveyView>()
|
||||
.ForMember(t => t.EquipmentType, u => u.MapFrom(d => isEn_Us ? d.EquipmentType.Value : d.EquipmentType.ValueCN));
|
||||
|
||||
|
||||
|
||||
CreateMap<TrialSiteSurvey, TrialSiteSurveyView>()
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode));
|
||||
|
||||
CreateMap<TrialSiteSurvey, TrialSiteSurveySelectView>();
|
||||
|
||||
|
||||
CreateMap<TrialSiteUserSurvey, TrialSiteUserSurveyView>()
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName))
|
||||
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.UserTypeRole.UserTypeEnum));
|
||||
|
||||
|
||||
CreateMap<Trial, TrialSurveyInitInfo>()
|
||||
.ForMember(d => d.Sponsor, u => u.MapFrom(s => s.Sponsor))
|
||||
.ForMember(d => d.IndicationType, u => u.MapFrom(s => s.IndicationType.Value))
|
||||
.ForMember(d => d.TrialSiteSelectList, u => u.MapFrom(s => s.TrialSiteList))
|
||||
.ForMember(d => d.TrialId, u => u.MapFrom(s => s.Id));
|
||||
|
||||
CreateMap<TrialSite, TrialSiteForSelect>()
|
||||
.ForMember(t => t.IsHaveSiteSurveyRecord, u => u.MapFrom(t => t.TrialSiteSurveyList.Any()));
|
||||
|
||||
CreateMap<TrialSiteSurvey, LoginReturnDTO>()
|
||||
.ForMember(d => d.TrialSiteSurvey, u => u.MapFrom(s => s))
|
||||
.ForMember(d => d.TrialInfo, u => u.MapFrom(s => s.Trial))
|
||||
.ForMember(d => d.TrialSiteUserSurveyList, u => u.MapFrom(s => s.TrialSiteUserSurveyList));
|
||||
|
||||
|
||||
|
||||
|
||||
CreateMap<TrialSiteUserSurvey, UserRole>();
|
||||
|
||||
CreateMap<SiteSurveyUserImportDto, UserRole>()
|
||||
.ForMember(d => d.EMail, u => u.MapFrom(s => s.Email));
|
||||
|
||||
|
||||
CreateMap<TrialSiteUserSurveyView, UserRole>();
|
||||
|
||||
|
||||
CreateMap<UserRole, UserInfoBasic>().ForMember(d => d.RealName, u => u.MapFrom(s => s.LastName + " / " + s.FirstName));
|
||||
|
||||
|
||||
|
||||
CreateMap<TrialSiteUserSurvey, TrialSiteUserSurveyAllDTO>()
|
||||
.ForMember(t => t.TrialSiteSurvey, u => u.MapFrom(c => c.TrialSiteSurvey))
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName))
|
||||
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.UserTypeRole.UserTypeEnum));
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
else //不管是精鼎的pm还是我们的pm 还是运维人员 只能看到自己参与项目的统计
|
||||
{
|
||||
List<Guid> trialIdList = _userTrialRepository.Where(u => u.UserId == _userInfo.Id).Select(u => u.TrialId).ToList();
|
||||
List<Guid> trialIdList = _userTrialRepository.Where(u => u.UserId == _userInfo.UserRoleId).Select(u => u.TrialId).ToList();
|
||||
trialLambda = trialLambda.And(u => trialIdList.Contains(u.Id));
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(inQuery.TrialCode))
|
||||
|
|
@ -385,7 +385,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
var userTypeEnumStr = _userInfo.UserTypeEnumStr;
|
||||
var userId = _userInfo.Id;
|
||||
var userId = _userInfo.UserRoleId;
|
||||
|
||||
|
||||
//PM 进来只能看到他负责的项目下的参与人员列表
|
||||
|
|
@ -441,7 +441,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
Expression<Func<TrialUserRole, bool>> userTrialLambda = x => x.UserId == userId;
|
||||
|
||||
var userTypeEnum = _userInfo.UserTypeEnumStr;
|
||||
var loginUserId = _userInfo.Id;
|
||||
var loginUserId = _userInfo.UserRoleId;
|
||||
|
||||
|
||||
//PM 进来只能看到他负责的项目下的参与人员列表
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
|||
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.Select(t => new TrialListDTO_UltrasonicDicom()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
|
|||
|
|
@ -216,29 +216,6 @@ namespace IRaCIS.Application.Contracts
|
|||
public string TrialSiteAliasName { get; set; } = String.Empty;
|
||||
}
|
||||
|
||||
public class TrialSiteUserSummaryExportDto : ExcelExportInfo
|
||||
{
|
||||
|
||||
public List<TrialSiteUserSummaryDto> TrialSiteUserList { get; set; } = new List<TrialSiteUserSummaryDto>();
|
||||
|
||||
}
|
||||
|
||||
public class TrialSiteUserSummaryDto : TrialSiteUserSurveyView
|
||||
{
|
||||
|
||||
|
||||
public string TrialSiteCode { get; set; } = String.Empty;
|
||||
public string TrialSiteAliasName { get; set; } = String.Empty;
|
||||
|
||||
public string UserRealName => LastName + " / " + FirstName;
|
||||
|
||||
|
||||
//public string IsGenerateAccountStr => IsGenerateAccount ? "是" : "否";
|
||||
|
||||
|
||||
//public string StateStr => State.GetDescription();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Interfaces
|
|||
|
||||
Task<List<TrialExternalUserView>> GetTrialExternalUserList(TrialExternalUserQuery queryTrialExternalUser);
|
||||
|
||||
Task<IResponseOutput> AddOrUpdateTrialExternalUser(TrialExternalUserAddAndSendEmail addOrEditTrialExternalUser);
|
||||
|
||||
|
||||
Task<IResponseOutput> DeleteTrialExternalUser(Guid trialExternalUserId, bool isSystemUser,
|
||||
Guid systemUserId);
|
||||
|
|
|
|||
|
|
@ -13,6 +13,5 @@ namespace IRaCIS.Core.Application.Interfaces
|
|||
Task<PageOutput<SiteStatDTO>> GetSiteCRCList(SiteCrcQueryDTO param);
|
||||
Task<PageOutput<SiteStatSimpleDTO>> GetSiteCRCSimpleList(SiteCrcQueryDTO param);
|
||||
Task<PageOutput<TrialSiteScreeningDTO>> GetTrialSiteScreeningList(TrialSiteQuery trialSiteQuery);
|
||||
Task<IEnumerable<TrialSiteForSelect>> GetTrialSiteSelect(Guid trialId);
|
||||
}
|
||||
}
|
||||
|
|
@ -12,8 +12,6 @@ namespace IRaCIS.Core.Application
|
|||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class PersonalWorkstation(
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialDocument> _trialDocumentRepository,
|
||||
IRepository<SystemDocument> _systemDocumentRepository,
|
||||
IClinicalAnswerService _clinicalAnswerService,
|
||||
IRepository<SystemNotice> _systemNoticeRepository,
|
||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
||||
|
|
@ -39,10 +37,10 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
return await _trialRepository
|
||||
.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() > 0)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count() > 0)
|
||||
.ProjectTo<TrialSiteSurveyStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id })
|
||||
.ProjectTo<TrialSiteSurveyStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.UserRoleId })
|
||||
.OrderByDescending(t => t.ApprovalRequiredCount).ToPagedListAsync(inQuery);
|
||||
}
|
||||
|
||||
|
|
@ -55,34 +53,8 @@ namespace IRaCIS.Core.Application
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 待签署的项目文件 需要签署文件数量 系统级别的在第一行
|
||||
/// </summary>
|
||||
/// <param name="inQuery"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<PageOutput<DocSignStat>> GetTrialDocStatList(TrialSiteSurveyStatQuery inQuery)
|
||||
{
|
||||
if (_userInfo.IsAdmin)
|
||||
{
|
||||
return new PageOutput<DocSignStat>(inQuery.PageIndex, inQuery.PageSize, 0, new List<DocSignStat>());
|
||||
}
|
||||
else
|
||||
{
|
||||
var trialDocStat = await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(!_userInfo.IsAdmin, c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null))
|
||||
.Count() > 0)
|
||||
.ProjectTo<DocSignStat>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id, userTypeId = _userInfo.UserTypeId })
|
||||
.OrderByDescending(t => t.WaitSignCount)
|
||||
.ToPagedListAsync(inQuery);
|
||||
|
||||
|
||||
return trialDocStat;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
#region PM APM 待办
|
||||
|
||||
|
|
@ -101,7 +73,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
var query = _trialRepository
|
||||
.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new CheckToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
@ -122,11 +94,11 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var totalToBeCheckedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CheckState == CheckStateEnum.ToCheck).CountAsync();
|
||||
|
||||
var totalToBeRepliedCount = await _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng &&
|
||||
u.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).CountAsync();
|
||||
|
||||
|
|
@ -148,7 +120,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed)
|
||||
.GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId })
|
||||
.Select(g => new ReReadingApplyToBeDoneDto()
|
||||
|
|
@ -169,7 +141,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeApprovalCount = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed).Count();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount });
|
||||
|
|
@ -190,7 +162,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new ReviewerSelectToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
@ -208,7 +180,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
|
||||
|
||||
return ResponseOutput.Ok(result, new { ToBeApprovalCount = toBeApprovalCount }); ;
|
||||
|
|
@ -226,7 +198,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new GetPMClinicalDataToBeDoneListOutDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
@ -246,7 +218,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var all = await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new GetPMClinicalDataToBeDoneListOutDto()
|
||||
{
|
||||
|
||||
|
|
@ -275,7 +247,7 @@ namespace IRaCIS.Core.Application
|
|||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new ReviewerSelectToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
@ -294,7 +266,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount }); ;
|
||||
|
|
@ -315,7 +287,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
{
|
||||
var query = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||
.GroupBy(t => new { t.OriginalReReadingTask.Trial.ExperimentName, t.OriginalReReadingTask.Trial.ResearchProgramNo, t.OriginalReReadingTask.Trial.TrialCode, t.OriginalReReadingTask.TrialId })
|
||||
.Select(g => new ReReadingApprovalToBeDoneDto()
|
||||
|
|
@ -336,7 +308,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeApprovalCount = _visitTaskReReadingRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed).Count();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount });
|
||||
|
|
@ -363,7 +335,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
//.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||
.Select(t => new ImageClinicalDataToBeDoneDto()
|
||||
{
|
||||
|
|
@ -405,7 +377,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
//.Where(t => t.clinicalDataTrialSets.Any(t => t.ClinicalDataLevel == ClinicalLevel.Subject && t.IsConfirm))
|
||||
.Select(t => new ImageClinicalDataToBeDoneDto()
|
||||
{
|
||||
|
|
@ -466,7 +438,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new ImageQuestionToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
@ -474,11 +446,11 @@ namespace IRaCIS.Core.Application
|
|||
ExperimentName = t.ExperimentName,
|
||||
TrialCode = t.TrialCode,
|
||||
|
||||
UrgentCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
UrgentCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC && u.SubjectVisit.IsUrgent).Count(),
|
||||
|
||||
ToBeDealedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
ToBeDealedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.SelectMany(c => c.QCChallengeList)
|
||||
|
||||
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count(),
|
||||
|
|
@ -491,8 +463,8 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC).Count();
|
||||
|
||||
|
|
@ -514,7 +486,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new ImageCheckQuestionToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
@ -522,10 +494,10 @@ namespace IRaCIS.Core.Application
|
|||
ExperimentName = t.ExperimentName,
|
||||
TrialCode = t.TrialCode,
|
||||
|
||||
UrgentCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
UrgentCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply && u.IsUrgent).Count(),
|
||||
|
||||
ToBeReplyedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
ToBeReplyedCount = t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count()
|
||||
|
||||
}).Where(x => x.ToBeReplyedCount > 0);
|
||||
|
|
@ -537,8 +509,8 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeReplyedCount = toBeDealedCount });
|
||||
|
|
@ -560,7 +532,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new ImageReUploadToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
@ -568,11 +540,11 @@ namespace IRaCIS.Core.Application
|
|||
ExperimentName = t.ExperimentName,
|
||||
TrialCode = t.TrialCode,
|
||||
UrgentCount = t.SubjectVisitList
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.IsUrgent && ((u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || u.IsQCConfirmedReupload)).Count(),
|
||||
|
||||
ToBeReUploadCount = t.SubjectVisitList
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || (u.IsQCConfirmedReupload)).Count(),
|
||||
|
||||
}).Where(x => x.ToBeReUploadCount > 0);
|
||||
|
|
@ -583,7 +555,7 @@ namespace IRaCIS.Core.Application
|
|||
var result = await query.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || (u.IsQCConfirmedReupload)).Count();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeReUploadCount = toBeDealedCount });
|
||||
|
|
@ -607,7 +579,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && (t.IsUrgent || t.IsSubjectExpeditedView || t.IsEnrollementQualificationConfirm || t.IsPDProgressView))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId) && (t.IsUrgent || t.IsSubjectExpeditedView || t.IsEnrollementQualificationConfirm || t.IsPDProgressView))
|
||||
.Select(t => new ImageSubmittedToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
@ -615,12 +587,12 @@ namespace IRaCIS.Core.Application
|
|||
ExperimentName = t.ExperimentName,
|
||||
TrialCode = t.TrialCode,
|
||||
UrgentCount = t.SubjectVisitList
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit && (u.IsEnrollmentConfirm || u.PDState == PDStateEnum.PDProgress || u.Trial.IsUrgent || u.Subject.IsUrgent)/*u.IsUrgent*/).Count(),
|
||||
|
||||
|
||||
ToBeDealedCount = t.SubjectVisitList
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(),
|
||||
|
||||
}).Where(x => x.ToBeDealedCount > 0);
|
||||
|
|
@ -633,8 +605,8 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeDealedCount = toBeDealedCount });
|
||||
|
|
@ -663,7 +635,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit)
|
||||
.Select(t => new ImageQualityToBeDoneDto()
|
||||
{
|
||||
|
|
@ -673,15 +645,15 @@ namespace IRaCIS.Core.Application
|
|||
TrialCode = t.TrialCode,
|
||||
|
||||
// 待审核 加急的(待领取 已领取)-- 领取了 还没做完 就是待审核
|
||||
UrgentCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && u.IsUrgent).Count(),
|
||||
UrgentCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId && u.IsUrgent).Count(),
|
||||
|
||||
|
||||
//待领取量
|
||||
ToBeClaimedCount = t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed && t.AuditState != AuditStateEnum.QCFailed)
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count(),
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.UserRoleId && u.ReviewAuditUserId == null))).Count(),
|
||||
|
||||
//待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
|
||||
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
|
||||
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId).Count()
|
||||
|
||||
}).Where(x => x.ToBeClaimedCount + x.ToBeReviewedCount > 0);
|
||||
|
||||
|
|
@ -693,13 +665,13 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeClaimedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed && t.AuditState != AuditStateEnum.QCFailed)
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count();
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId) && t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed && t.AuditState != AuditStateEnum.QCFailed)
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.UserRoleId && u.ReviewAuditUserId == null))).Count();
|
||||
|
||||
|
||||
var toBeReviwedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(u => u.CurrentActionUserId == _userInfo.Id).Count();
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId).Count();
|
||||
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeClaimedCount = toBeClaimedCount, TotalToBeReviewedCount = toBeReviwedCount });
|
||||
|
|
@ -721,7 +693,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new ImageQuestionToBeDoneDto()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
@ -729,10 +701,10 @@ namespace IRaCIS.Core.Application
|
|||
ExperimentName = t.ExperimentName,
|
||||
TrialCode = t.TrialCode,
|
||||
UrgentCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(),
|
||||
.Where(u => u.CreateUserId == _userInfo.UserRoleId && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator && u.SubjectVisit.IsUrgent).Count(),
|
||||
|
||||
ToBeDealedCount = t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
|
||||
.Where(u => u.CreateUserId == _userInfo.UserRoleId && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count(),
|
||||
|
||||
}).Where(x => x.ToBeDealedCount > 0); ;
|
||||
|
||||
|
|
@ -742,9 +714,9 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _subjectVisitRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count();
|
||||
.Where(u => u.CreateUserId == _userInfo.UserRoleId && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count();
|
||||
|
||||
return ResponseOutput.Ok(result, new { TotalToBeDealedCount = toBeDealedCount });
|
||||
|
||||
|
|
@ -775,7 +747,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
|
||||
var newQuery = _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
var newQuery = _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(c => new IRImageReadingToBeDoneDto()
|
||||
{
|
||||
TrialId = c.TrialId,
|
||||
|
|
@ -785,7 +757,7 @@ namespace IRaCIS.Core.Application
|
|||
CriterionName = c.CriterionName,
|
||||
TrialReadingCriterionId = c.Id,
|
||||
|
||||
UrgentCount = c.VisitTaskList.AsQueryable().Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
||||
UrgentCount = c.VisitTaskList.AsQueryable().Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||
//前序 不存在 未生成任务的访视
|
||||
|
|
@ -795,7 +767,7 @@ namespace IRaCIS.Core.Application
|
|||
.Count(t => t.IsUrgent),
|
||||
|
||||
|
||||
UnReadCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
||||
UnReadCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||
//前序 不存在 未生成任务的访视
|
||||
|
|
@ -807,7 +779,7 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
|
||||
HaveSignedCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||
HaveSignedCount = c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||
&& t.ReadingTaskState == ReadingTaskState.HaveSigned).Count(),
|
||||
}).Where(x => x.UnReadCount > 0);
|
||||
|
||||
|
|
@ -885,9 +857,9 @@ namespace IRaCIS.Core.Application
|
|||
var result = await newQuery.ToPagedListAsync(inQuery, defalutSortArray);
|
||||
|
||||
var toBeDealedCount = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.SelectMany(t => t.VisitTaskList)
|
||||
.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect && t.TrialReadingCriterion.IsSigned == true && t.TrialReadingCriterion.IsConfirm == true)
|
||||
.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect && t.TrialReadingCriterion.IsSigned == true && t.TrialReadingCriterion.IsConfirm == true)
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||
//前序 不存在 未生成任务的访视
|
||||
|
|
@ -913,8 +885,8 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
|
||||
var query = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.VisitTask.DoctorUserId == _userInfo.Id)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.VisitTask.DoctorUserId == _userInfo.UserRoleId)
|
||||
.GroupBy(t => new
|
||||
{
|
||||
t.TrialId,
|
||||
|
|
@ -957,8 +929,8 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeDealedCount = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.DoctorUserId == _userInfo.Id)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.DoctorUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM)
|
||||
//.Where(u => u.ReadingMedicalReviewDialogList.OrderByDescending(l => l.CreateTime).First().UserTypeEnumInt == (int)UserTypeEnum.MIM)
|
||||
.Count();
|
||||
|
|
@ -990,8 +962,8 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
#region 废弃不能对包含聚合或子查询的表达式执行聚合函数
|
||||
var query = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.GroupBy(t => new
|
||||
{
|
||||
t.TrialId,
|
||||
|
|
@ -1028,16 +1000,16 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
var toBeReplyedQuery = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing);
|
||||
|
||||
|
||||
var toBeReplyedCount = toBeReplyedQuery.Count();
|
||||
|
||||
var tobeReviewedCount = _taskMedicalReviewRepository.Where(t => t.Trial.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count();
|
||||
|
||||
|
||||
|
|
@ -1084,282 +1056,6 @@ namespace IRaCIS.Core.Application
|
|||
#region 项目列表查询 + 待办详情
|
||||
|
||||
|
||||
public async Task<List<Guid>> GetNeedSignTrialDocTrialIdList()
|
||||
{
|
||||
if (!_userInfo.IsAdmin)
|
||||
{
|
||||
var list = await _trialRepository.Where(t => t.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(!_userInfo.IsAdmin, c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) &&
|
||||
!t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null)).Count() > 0)
|
||||
.Select(t => t.Id).ToListAsync();
|
||||
|
||||
return list;
|
||||
|
||||
}
|
||||
return new List<Guid>();
|
||||
}
|
||||
|
||||
public async Task<UserToBeDoneRecord> GetUserTobeDoneRecord([FromServices] IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
[FromServices] IRepository<VisitTaskReReading> _visitTaskReReadingRepository,
|
||||
[FromServices] IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||
[FromServices] IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository)
|
||||
{
|
||||
var isPM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM;
|
||||
var isCRC = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator;
|
||||
var isIQC = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC;
|
||||
var isMIM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.MIM;
|
||||
var isSPMOrCPM = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM;
|
||||
var isIR = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer;
|
||||
|
||||
var isInternal = _userInfo.IsZhiZhun;
|
||||
|
||||
var needSignTrialCount = await _trialRepository.Where(t => t.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)
|
||||
&& !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null)).Count() > 0).CountAsync();
|
||||
|
||||
var needSignSysDocCont = await _systemDocumentRepository
|
||||
.Where(t => t.IsDeleted == false && !t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null))
|
||||
//外部人员 只签署 文档类型枚举值有值的
|
||||
.WhereIf(isInternal == false, t => t.DocUserSignType == DocUserSignType.InnerAndOuter)
|
||||
.SelectMany(t => t.NeedConfirmedUserTypeList)
|
||||
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId);
|
||||
|
||||
var signedTrialCount = await _trialDocumentRepository.AsQueryable(true)
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.Where(t => t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null)).CountAsync();
|
||||
|
||||
var signedSysDocCont = await _systemDocumentRepository
|
||||
.Where(t => t.IsDeleted == false && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null))
|
||||
.SelectMany(t => t.NeedConfirmedUserTypeList)
|
||||
.CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId);
|
||||
|
||||
|
||||
var siteSurveyCount = await _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.SPMApproved).Count() > 0)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM, c => c.TrialSiteSurveyList.Where(t => t.State == TrialSiteSurveyEnum.CRCSubmitted).Count() > 0)
|
||||
.CountAsync();
|
||||
|
||||
//var trialNeedSignList = new List<TrialDocNeedSign>();
|
||||
|
||||
//if (!_userInfo.IsAdmin)
|
||||
//{
|
||||
// trialNeedSignList = await _trialRepository.Where(t => t.TrialStatusStr != StaticData.TrialState.TrialStopped)
|
||||
// .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
// .WhereIf(!_userInfo.IsAdmin, c => c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId) &&
|
||||
// !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null)).Count() > 0)
|
||||
// .Select(t=>new TrialDocNeedSign()
|
||||
// {
|
||||
// TrialId=t.Id,
|
||||
// TrialCode=t.TrialCode,
|
||||
// ExperimentName=t.ExperimentName,
|
||||
// ResearchProgramNo=t.ResearchProgramNo,
|
||||
// IsHaveTrialDocNeedSign=true
|
||||
// }).ToListAsync();
|
||||
|
||||
//}
|
||||
|
||||
//防止生成sql生成GETDATE() 时区导致的问题
|
||||
var appDateTimeNow = DateTime.Now;
|
||||
|
||||
var record = new UserToBeDoneRecord()
|
||||
{
|
||||
|
||||
IsHaveSysDocNeedNeedSign = needSignSysDocCont > 0,
|
||||
//TrialNeedSignList= trialNeedSignList,
|
||||
|
||||
SysWaitSignDocCount = needSignSysDocCont,
|
||||
TrialWaitSignDocCount = needSignTrialCount,
|
||||
|
||||
TrialSignedDocCount = signedTrialCount,
|
||||
SysSignedDocCount = signedSysDocCont,
|
||||
|
||||
SysNoticeUnReadCount = await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.SystemNotice_NoticeStateEnum.HavePublished
|
||||
&& !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.Id))
|
||||
.Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > appDateTimeNow)
|
||||
.CountAsync(),
|
||||
|
||||
#region PM
|
||||
|
||||
PM_SiteSurveryCount = isPM ? siteSurveyCount : 0,
|
||||
|
||||
PM_CheckCount = isPM ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(u => u.SubjectVisitList.Any(t => t.CheckState == CheckStateEnum.ToCheck || (t.CheckState == CheckStateEnum.CVIng &&
|
||||
t.CheckChallengeDialogList.OrderByDescending(t => t.CreateTime).First().UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator))).CountAsync() : 0,
|
||||
|
||||
PM_ReviewerSelectCount = isPM ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count() > 0).CountAsync() : 0,
|
||||
|
||||
PM_ReReadingApprovalCount = isPM ? await _visitTaskReReadingRepository
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed)
|
||||
.GroupBy(t => t.OriginalReReadingTask.TrialId)
|
||||
.Select(g => new ReReadingApplyToBeDoneDto()
|
||||
{
|
||||
TrialId = g.Key,
|
||||
ToBeApprovalCount = g.Count(),
|
||||
|
||||
}).Where(x => x.ToBeApprovalCount > 0).CountAsync() : 0,
|
||||
|
||||
PM_ClinicalDataCount = isPM ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.ReadModuleList.Where(u => u.IsCRCConfirm && !u.IsPMConfirm).Count() > 0).CountAsync() : 0,
|
||||
|
||||
#endregion
|
||||
|
||||
#region CRC
|
||||
|
||||
CRC_ImageSubmitCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && (t.IsUrgent || t.IsSubjectExpeditedView || t.IsEnrollementQualificationConfirm || t.IsPDProgressView))
|
||||
.Where(t => t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)).Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count() > 0).CountAsync() : 0,
|
||||
|
||||
|
||||
CRC_ImageQuestionCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)).SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count() > 0).CountAsync() : 0,
|
||||
|
||||
|
||||
|
||||
CRC_CheckQuestionCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() > 0).CountAsync() : 0,
|
||||
|
||||
CRC_ImageReUploadCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.SubjectVisitList
|
||||
.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
.Where(u => (u.SubmitState == SubmitStateEnum.ToSubmit && u.IsPMBackOrReReading) || (u.IsQCConfirmedReupload)).Count() > 0).CountAsync() : 0,
|
||||
|
||||
CRC_ClinicalDataTobeDoneCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.ReadingClinicalDataList.Where(x => !x.IsSign && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC).Count() > 0).CountAsync() : 0,
|
||||
|
||||
CRC_ClinialDataTobeConfirmCount = isCRC ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.ReadModuleList.Where(x => !x.IsCRCConfirm).Count() > 0).CountAsync() : 0,
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region SPM
|
||||
|
||||
|
||||
SPM_SiteSurveryCount = isSPMOrCPM ? siteSurveyCount : 0,
|
||||
|
||||
SPM_ReviewerApprovalCount = isSPMOrCPM ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count() > 0).CountAsync() : 0,
|
||||
|
||||
SPM_ReReadingApprovalCount = isSPMOrCPM ? await _visitTaskReReadingRepository
|
||||
.Where(t => t.OriginalReReadingTask.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.OriginalReReadingTask.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||
.GroupBy(t => t.OriginalReReadingTask.TrialId)
|
||||
.Select(g => new ReReadingApplyToBeDoneDto()
|
||||
{
|
||||
TrialId = g.Key,
|
||||
ToBeApprovalCount = g.Count(),
|
||||
|
||||
}).Where(x => x.ToBeApprovalCount > 0).CountAsync() : 0,
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region IQC
|
||||
|
||||
|
||||
IQC_IamgeQCCount = isIQC ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.QCProcessEnum != TrialQCProcess.NotAudit)
|
||||
.Select(t => new
|
||||
{
|
||||
//待领取量
|
||||
ToBeClaimedCount = t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed)
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count(),
|
||||
|
||||
//待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了)
|
||||
ToBeReviewedCount = t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id).Count()
|
||||
|
||||
}).Where(x => x.ToBeClaimedCount + x.ToBeReviewedCount > 0).CountAsync() : 0,
|
||||
|
||||
IQC_QCQuestionCount = isIQC ? await _trialRepository
|
||||
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() > 0).CountAsync() : 0,
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region IR
|
||||
|
||||
IR_IamgeWaitReadingCount = isIR ?
|
||||
|
||||
// await _trialRepository
|
||||
//.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
//.Where(c=>c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect && t.TrialReadingCriterion.IsSigned && t.TrialReadingCriterion.IsConfirm )
|
||||
// // 前序 不存在 未一致性核查未通过的
|
||||
// .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||
// //前序 不存在 未生成任务的访视
|
||||
// .Where(t => t.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
|
||||
|
||||
// .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count()>0).CountAsync() : 0,
|
||||
|
||||
|
||||
await _trialReadingCriterionRepository.Where(t => t.IsSigned == true && t.IsConfirm == true && t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(c => c.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect)
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||
//前序 不存在 未生成任务的访视
|
||||
//.WhereIf(g.Key.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
||||
.Where(t => c.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true)
|
||||
|
||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count() > 0).CountAsync()
|
||||
|
||||
: 0,
|
||||
|
||||
|
||||
IR_MedicalReviewCount = isIR ? await _taskMedicalReviewRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.VisitTask.DoctorUserId == _userInfo.Id)
|
||||
.GroupBy(t => new { t.TrialId, t.VisitTask.TrialReadingCriterionId })
|
||||
.Where(g => g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM && u.AuditState == MedicalReviewAuditState.Auditing).Count() > 0).CountAsync() : 0,
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region MIM
|
||||
|
||||
MIM_MedicalReviewCount = isMIM ? await _taskMedicalReviewRepository
|
||||
.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
.GroupBy(t => new { t.TrialId, t.VisitTask.TrialReadingCriterionId })
|
||||
.Select(g => new
|
||||
{
|
||||
TrialId = g.Key,
|
||||
|
||||
ToBeReplyedCount = g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing).Count(),
|
||||
|
||||
ToBeReviewedCount = g.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count()
|
||||
|
||||
}).Where(t => t.ToBeReviewedCount + t.ToBeReplyedCount > 0).CountAsync() : 0,
|
||||
|
||||
#endregion
|
||||
|
||||
};
|
||||
|
||||
return record;
|
||||
}
|
||||
|
||||
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<PageOutput<TrialToBeDoneDto>>> GetTrialToBeDoneList(TrialToBeDoneQuery inQuery,
|
||||
[FromServices] IRepository<TaskMedicalReview> _taskMedicalReviewRepository)
|
||||
|
|
@ -1379,7 +1075,7 @@ namespace IRaCIS.Core.Application
|
|||
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm))
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserList.Any(t => t.UserRole.EMail.Contains(inQuery.PM_EMail) && (t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)))
|
||||
.Select(t => new TrialToBeDoneDto()
|
||||
|
|
@ -1406,49 +1102,49 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
SPM_ReviewerSelectApprovalCount = isSPMOrCPM ? t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count() : 0,
|
||||
|
||||
MIM_UrgentCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
MIM_UrgentCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.VisitTask.IsUrgent &&
|
||||
u.AuditState != MedicalReviewAuditState.HaveSigned).Count() : 0,
|
||||
|
||||
MIM_PendingResponseCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
MIM_PendingResponseCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing).Count() : 0,
|
||||
|
||||
MIM_PendingReviewCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id)
|
||||
MIM_PendingReviewCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.UserRoleId)
|
||||
.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count() : 0,
|
||||
|
||||
CRC_UrgentCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id) && t.IsUrgent).Count() : 0,
|
||||
CRC_UrgentCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId) && t.IsUrgent).Count() : 0,
|
||||
|
||||
CRC_CheckQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id))
|
||||
CRC_CheckQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId))
|
||||
.Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() : 0,
|
||||
|
||||
CRC_QCQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)).SelectMany(c => c.QCChallengeList)
|
||||
CRC_QCQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.UserRoleId)).SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count() : 0,
|
||||
|
||||
|
||||
//待审核 审核中 加急的数量
|
||||
IQC_UrgentCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit && t.IsUrgent).Count() : 0,
|
||||
IQC_UrgentCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId && t.QCProcessEnum != TrialQCProcess.NotAudit && t.IsUrgent).Count() : 0,
|
||||
|
||||
//审核未完成
|
||||
IQC_AuditToBeDealedCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit).Count() : 0,
|
||||
IQC_AuditToBeDealedCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.UserRoleId && t.QCProcessEnum != TrialQCProcess.NotAudit).Count() : 0,
|
||||
|
||||
//质疑待处理
|
||||
IQC_QuestionToBeDealedCount = isIQC ? t.SubjectVisitList.SelectMany(c => c.QCChallengeList)
|
||||
.Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
|
||||
.Where(u => u.CreateUserId == _userInfo.UserRoleId && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0,
|
||||
|
||||
//待领取
|
||||
IQC_ToBeClaimedCount = isIQC ? t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed)
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count() : 0,
|
||||
.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.UserRoleId && u.ReviewAuditUserId == null))).Count() : 0,
|
||||
|
||||
|
||||
IR_ReadingCriterionList = isIR ? t.TrialReadingCriterionList.Where(t => t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t => t.CriterionName).ToList() : null,
|
||||
|
||||
IR_PMEmailList = isIR ? t.TrialUserList.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.UserRole.EMail).Select(t => t.UserRole.EMail).ToList() : null,
|
||||
|
||||
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
|
||||
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
|
||||
|
||||
|
||||
IR_UnReadCount = isIR ? t.VisitTaskList
|
||||
.Where(c => c.DoctorUserId == _userInfo.Id && c.ReadingTaskState != ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterion.IsSigned)
|
||||
.Where(c => c.DoctorUserId == _userInfo.UserRoleId && c.ReadingTaskState != ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterion.IsSigned)
|
||||
// 前序 不存在 未一致性核查未通过的
|
||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum))
|
||||
//前序 不存在 未生成任务的访视
|
||||
|
|
@ -1511,7 +1207,7 @@ namespace IRaCIS.Core.Application
|
|||
// QC IQC 待领取
|
||||
QC_IQC_ToBeClaimedCount =
|
||||
(t.UserRole.UserTypeEnum == UserTypeEnum.IQC) ?
|
||||
t.Trial.SubjectVisitList.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count() : 0,
|
||||
t.Trial.SubjectVisitList.Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.UserRoleId && u.ReviewAuditUserId == null))).Count() : 0,
|
||||
|
||||
|
||||
// CRC 质疑待回复 --区分人
|
||||
|
|
|
|||
|
|
@ -804,7 +804,7 @@ namespace IRaCIS.Core.Application
|
|||
throw new BusinessValidationFailedException(_localizer["TrialConfig_InvalidParentQuestionId"]);
|
||||
}
|
||||
|
||||
if (await _trialRepository.AnyAsync(t => t.Id == signConfirmDTO.TrialId && t.QCQuestionConfirmedUserId != null && t.QCQuestionConfirmedUserId != _userInfo.Id))
|
||||
if (await _trialRepository.AnyAsync(t => t.Id == signConfirmDTO.TrialId && t.QCQuestionConfirmedUserId != null && t.QCQuestionConfirmedUserId != _userInfo.UserRoleId))
|
||||
{
|
||||
//---影像质控审核问题已被其他人员确认,不允许再次确认。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_AuditQuestionConfirmed"]);
|
||||
|
|
@ -874,7 +874,7 @@ namespace IRaCIS.Core.Application
|
|||
throw new BusinessValidationFailedException(_localizer["TrialConfig_InvalidParentQuestionId"]);
|
||||
}
|
||||
|
||||
if (await _trialRepository.AnyAsync(t => t.Id == signConfirmDTO.TrialId && t.QCQuestionConfirmedUserId != null && t.QCQuestionConfirmedUserId != _userInfo.Id))
|
||||
if (await _trialRepository.AnyAsync(t => t.Id == signConfirmDTO.TrialId && t.QCQuestionConfirmedUserId != null && t.QCQuestionConfirmedUserId != _userInfo.UserRoleId))
|
||||
{
|
||||
//---影像质控审核问题已被其他人员确认,不允许再次确认。
|
||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_AuditQuestionConfirmed"]);
|
||||
|
|
@ -884,7 +884,7 @@ namespace IRaCIS.Core.Application
|
|||
{
|
||||
IsConfirm = true
|
||||
});
|
||||
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.Id, IsQCQuestionConfirmed = true });
|
||||
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.UserRoleId, IsQCQuestionConfirmed = true });
|
||||
await _trialRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,162 +47,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加和更新接口 已验证邮箱和账户类型不允许添加重复项
|
||||
/// </summary>
|
||||
/// <param name="addOrEditTrialExternalUser"></param>
|
||||
/// <returns></returns>
|
||||
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||
[UnitOfWork]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialExternalUser(TrialExternalUserAddAndSendEmail addOrEditTrialExternalUser)
|
||||
{
|
||||
|
||||
if (addOrEditTrialExternalUser.Id == null)
|
||||
{
|
||||
var @lock = _distributedLockProvider.CreateLock($"UserCode");
|
||||
|
||||
using (await @lock.AcquireAsync())
|
||||
{
|
||||
var existSysUser = await _userRoleRepository.FirstOrDefaultAsync(t => t.EMail == addOrEditTrialExternalUser.Email && t.UserTypeId == addOrEditTrialExternalUser.UserTypeId);
|
||||
|
||||
if (existSysUser != null)
|
||||
{
|
||||
if (existSysUser.LastName != addOrEditTrialExternalUser.LastName || existSysUser.FirstName != addOrEditTrialExternalUser.FirstName)
|
||||
{
|
||||
//$"该用户在系统中的用户名为:{existSysUser.LastName + " / " + existSysUser.FirstName} 电话:{existSysUser.Phone},与填写信息存在不一致项, 请将界面信息修改为与系统一致,再进行保存",
|
||||
return ResponseOutput.NotOk(_localizer["TrialExternalUser_Inconsistency", existSysUser.LastName + " / " + existSysUser.FirstName, existSysUser.Phone], new { existSysUser.LastName, existSysUser.FirstName, existSysUser.Phone, existSysUser.IsZhiZhun, existSysUser.IsTestUser }, ApiResponseCodeEnum.NeedTips);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//处理 生成账户
|
||||
|
||||
if (await _trialExternalUseRepository.AnyAsync(t =>
|
||||
t.Email == addOrEditTrialExternalUser.Email &&
|
||||
t.UserTypeId == addOrEditTrialExternalUser.UserTypeId && t.TrialId == addOrEditTrialExternalUser.TrialId))
|
||||
{
|
||||
//---系统已经存在与列表中填写的邮箱和用户类型相同的账户,请确认。
|
||||
return ResponseOutput.NotOk(_localizer["TrialExternalUser_EmailTypeDuplicate"]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
var addEntity = _mapper.Map<TrialExternalUser>(addOrEditTrialExternalUser);
|
||||
|
||||
await _trialExternalUseRepository.AddAsync(addEntity);
|
||||
|
||||
|
||||
var existUser = await _userRoleRepository.FirstOrDefaultAsync(t => t.EMail == addOrEditTrialExternalUser.Email && t.UserTypeId == addOrEditTrialExternalUser.UserTypeId);
|
||||
var trialType = await _trialRepository.Where(t => t.Id == addOrEditTrialExternalUser.TrialId).Select(t => t.TrialType).FirstOrDefaultAsync();
|
||||
|
||||
if (existUser != null)
|
||||
{
|
||||
addEntity.IsSystemUser = true;
|
||||
addEntity.SystemUserId = existUser.Id;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
//生成账户 并插入
|
||||
|
||||
var generateUser = _mapper.Map<UserRole>(addOrEditTrialExternalUser);
|
||||
|
||||
if (trialType == TrialType.NoneOfficial)
|
||||
{
|
||||
generateUser.IsTestUser = true;
|
||||
}
|
||||
|
||||
// 外部人员生成账号 都是外部的
|
||||
generateUser.IsZhiZhun = false;
|
||||
|
||||
generateUser.Code = _userRoleRepository.Select(t => t.Code).DefaultIfEmpty().Max() + 1;
|
||||
|
||||
|
||||
generateUser.UserCode = AppSettings.GetCodeStr(generateUser.Code, nameof(UserRole));
|
||||
|
||||
generateUser.UserName = generateUser.UserCode;
|
||||
|
||||
generateUser.UserTypeEnum = _userTypeRepository.Where(t => t.Id == generateUser.UserTypeId).Select(t => t.UserTypeEnum).First();
|
||||
|
||||
generateUser.Password = MD5Helper.Md5(IRCEmailPasswordHelper.GenerateRandomPassword(10));
|
||||
|
||||
generateUser.Status = UserStateEnum.Disable;
|
||||
|
||||
var newAddUser = await _userRoleRepository.AddAsync(generateUser);
|
||||
|
||||
|
||||
addEntity.IsSystemUser = false;
|
||||
addEntity.SystemUserId = newAddUser.Id;
|
||||
|
||||
|
||||
existUser = newAddUser;
|
||||
|
||||
}
|
||||
|
||||
#region 验证用户 能否加入
|
||||
|
||||
if (trialType == TrialType.OfficialTrial || trialType == TrialType.Training)
|
||||
{
|
||||
|
||||
if (existUser.IsTestUser)
|
||||
{
|
||||
//---正式类型 、培训类型的项目 不允许加入测试用户
|
||||
throw new BusinessValidationFailedException(_localizer["TrialExternalUser_TestUserNotAllowed"]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (trialType == TrialType.NoneOfficial)
|
||||
{
|
||||
|
||||
if (existUser.IsTestUser == false)
|
||||
{
|
||||
//---测试项目 不允许加入正式用户
|
||||
throw new BusinessValidationFailedException(_localizer["TrialExternalUser_FormalUserNotAllowed"]);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
await _trialExternalUseRepository.SaveChangesAsync();
|
||||
|
||||
|
||||
//添加的时候就发邮件 现在省略
|
||||
if (addOrEditTrialExternalUser.IsSendEmail)
|
||||
{
|
||||
await SendExternalUserJoinEmail(new TrialExternalUserSendEmail()
|
||||
{
|
||||
BaseUrl = addOrEditTrialExternalUser.BaseUrl,
|
||||
RouteUrl = addOrEditTrialExternalUser.RouteUrl,
|
||||
TrialId = addOrEditTrialExternalUser.TrialId,
|
||||
SendUsers = new List<UserEmail>()
|
||||
{
|
||||
new UserEmail()
|
||||
{
|
||||
Id = addEntity.Id,
|
||||
Email=addEntity.Email,
|
||||
IsSystemUser=addEntity.IsSystemUser,
|
||||
SystemUserId=addEntity.SystemUserId
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return ResponseOutput.Ok(addEntity.Id.ToString());
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//---人员信息不支持编辑,请删除后重新添加。
|
||||
return ResponseOutput.NotOk(_localizer["TrialExternalUser_NotEditable"]);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -231,43 +75,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
}
|
||||
|
||||
|
||||
//New 省掉邀请流程
|
||||
[HttpPost]
|
||||
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> SendExternalUserJoinEmail(TrialExternalUserSendEmail sendEmail)
|
||||
{
|
||||
var trialId = sendEmail.TrialId;
|
||||
|
||||
foreach (var userInfo in sendEmail.SendUsers)
|
||||
{
|
||||
var userId = userInfo.SystemUserId;
|
||||
|
||||
|
||||
|
||||
|
||||
//判断TrialUser中是否存在 不存在就插入 注意退出了,也不能再加进来
|
||||
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId, true))
|
||||
{
|
||||
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
|
||||
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new UserRole() { Status = UserStateEnum.Enable });
|
||||
|
||||
await _trialExternalUseRepository.BatchUpdateNoTrackingAsync(t => t.Id == userInfo.Id, u => new TrialExternalUser() { IsJoin = true });
|
||||
|
||||
|
||||
await _userRoleRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
await _mailVerificationService.ExternalUserJoinEmail(trialId, userId, sendEmail.BaseUrl, sendEmail.RouteUrl);
|
||||
|
||||
}
|
||||
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -90,8 +90,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(multiModalityIdSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.Modality) == multiModalityIdSelectCount)
|
||||
.WhereIf(multiCriteriaSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.Criterion) == multiCriteriaSelectCount)
|
||||
.WhereIf(multiReviewTypeSelectCount > 0, t => t.TrialDicList.Count(t => t.KeyName == StaticData.ReviewType) == multiReviewTypeSelectCount)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id, isEn_Us = _userInfo.IsEn_Us });
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.UserRoleId, isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
return await query.ToPagedListAsync(inQuery);
|
||||
|
||||
|
|
@ -102,7 +102,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<List<TrialSelectDTO>> GetTrialSelect()
|
||||
{
|
||||
return await _trialRepository.AsQueryable()
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id) && t.IsDeleted == false)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId) && t.IsDeleted == false)
|
||||
|
||||
.ProjectTo<TrialSelectDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
//如果是PM, 则需要将该人员添加到 运维人员表
|
||||
//添加运维人员PM
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trial.Id, UserId = _userInfo.Id, JoinTime = DateTime.Now });
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trial.Id, UserId = _userInfo.UserRoleId, JoinTime = DateTime.Now });
|
||||
|
||||
// 添加扩展信息表记录
|
||||
await _trialPaymentPriceRepository.AddAsync(new TrialPaymentPrice() { TrialId = trial.Id });
|
||||
|
|
@ -510,10 +510,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
await _repository.BatchDeleteNoTrackingAsync<TrialCriterionDictionaryCode>(t => t.TrialReadingCriterion.TrialId == trialId);
|
||||
await _repository.BatchDeleteNoTrackingAsync<ReadingQuestionCriterionTrial>(t => t.TrialId == trialId);
|
||||
await _trialDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.TrialId == trialId);
|
||||
await _repository.BatchDeleteNoTrackingAsync<TrialDocConfirmedUser>(t => t.TrialDocument.TrialId == trialId);
|
||||
|
||||
await _repository.BatchDeleteNoTrackingAsync<TrialDocument>(t => t.TrialId == trialId);
|
||||
await _repository.BatchDeleteNoTrackingAsync<TrialDocNeedConfirmedUserType>(t => t.TrialDocument.TrialId == trialId);
|
||||
|
||||
await _repository.BatchDeleteNoTrackingAsync<TrialEmailNoticeUser>(t => t.TrialEmailNoticeConfig.TrialId == trialId);
|
||||
|
||||
|
|
@ -577,7 +574,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
.WhereIf(inQuery.Status == 8, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup))
|
||||
.WhereIf(inQuery.Status == 10, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.DoctorReading))
|
||||
.WhereIf(inQuery.Status == 14, t => t.EnrollList.Any(u => u.EnrollStatus == EnrollStatus.Finished))
|
||||
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id, isEn_Us = _userInfo.IsEn_Us });
|
||||
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.UserRoleId, isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
return await query.ToPagedListAsync(inQuery, nameof(TrialDetailDTO.CreateTime));
|
||||
|
||||
|
|
@ -606,13 +603,13 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
var query = _trialRepository
|
||||
.WhereIf(inQuery.EnrollStatus != null, o => (int)inQuery.EnrollStatus! == 10 ?
|
||||
o.EnrollList.Any(o => o.EnrollStatus >= EnrollStatus.ConfirmIntoGroup && o.EnrollStatus <= EnrollStatus.DoctorReading && o.DoctorId == _userInfo.Id) :
|
||||
o.EnrollList.Any(o => o.EnrollStatus == inQuery.EnrollStatus && o.DoctorId == _userInfo.Id))
|
||||
o.EnrollList.Any(o => o.EnrollStatus >= EnrollStatus.ConfirmIntoGroup && o.EnrollStatus <= EnrollStatus.DoctorReading && o.DoctorId == _userInfo.UserRoleId) :
|
||||
o.EnrollList.Any(o => o.EnrollStatus == inQuery.EnrollStatus && o.DoctorId == _userInfo.UserRoleId))
|
||||
.WhereIf(inQuery.Expedited != null, o => o.Expedited == inQuery.Expedited)
|
||||
.WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Indication), o => o.Indication.Contains(inQuery.Indication))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id, isEn_Us = _userInfo.IsEn_Us });
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.ProjectTo<TrialDetailDTO>(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.UserRoleId, isEn_Us = _userInfo.IsEn_Us });
|
||||
|
||||
|
||||
return await query.ToPagedListAsync(inQuery, nameof(TrialDetailDTO.CreateTime));
|
||||
|
|
@ -635,12 +632,12 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
await _enrollDetailRepository.AddAsync(new EnrollDetail()
|
||||
{
|
||||
DoctorId = _userInfo.Id,
|
||||
DoctorId = _userInfo.UserRoleId,
|
||||
TrialId = trialId,
|
||||
EnrollStatus = status,
|
||||
OptUserType = (int)SystemUserType.DoctorUser,
|
||||
});
|
||||
return ResponseOutput.Result(await _enrollRepository.BatchUpdateNoTrackingAsync(u => u.TrialId == trialId && u.DoctorId == _userInfo.Id, e => new Enroll
|
||||
return ResponseOutput.Result(await _enrollRepository.BatchUpdateNoTrackingAsync(u => u.TrialId == trialId && u.DoctorId == _userInfo.UserRoleId, e => new Enroll
|
||||
{
|
||||
EnrollStatus = status
|
||||
}));
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SiteName), t => t.TrialSiteName.Contains(inQuery.SiteName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteAliasName), t => t.TrialSiteAliasName.Contains(inQuery.TrialSiteAliasName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSiteCode.Contains(inQuery.TrialSiteCode))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.UserRoleId))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.CRCUserList.Any(k => (k.User.FullName).Contains(inQuery.UserKeyInfo)
|
||||
|| k.User.UserName.Contains(inQuery.UserKeyInfo) || k.User.EMail.Contains(inQuery.UserKeyInfo)))
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.SiteName), t => t.TrialSiteName.Contains(inQuery.SiteName) || t.TrialSiteAliasName.Contains(inQuery.TrialSiteAliasName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteAliasName), t => t.TrialSiteAliasName.Contains(inQuery.TrialSiteAliasName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSiteCode.Contains(inQuery.TrialSiteCode))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.UserRoleId))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.CRCUserList.Any(k => (k.User.FullName).Contains(inQuery.UserKeyInfo)
|
||||
|| k.User.UserName.Contains(inQuery.UserKeyInfo) || k.User.EMail.Contains(inQuery.UserKeyInfo)))
|
||||
|
||||
|
|
@ -244,23 +244,6 @@ namespace IRaCIS.Core.Application.Services
|
|||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取项目下的 site 下拉框数据 CRC只看到他负责的
|
||||
/// </summary>
|
||||
/// <param name="trialId"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<IEnumerable<TrialSiteForSelect>> GetTrialSiteSelect(Guid trialId)
|
||||
{
|
||||
//CRC只看到他负责的
|
||||
|
||||
var list = await _trialSiteRepository.Where(t => t.TrialId == trialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.ProjectTo<TrialSiteForSelect>(_mapper.ConfigurationProvider).OrderBy(t => t.TrialSiteCode).ToListAsync();
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -269,7 +252,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
//CRC只看到他负责的
|
||||
|
||||
var list = await _trialSiteRepository.Where(t => t.TrialId == trialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => t.TrialSiteCode).ToListAsync();
|
||||
|
||||
var virtualList = await _visitTaskRepository.Where(t => t.IsSelfAnalysis == true && t.TrialId == trialId).Select(t => t.BlindTrialSiteCode).Distinct().ToListAsync();
|
||||
|
|
|
|||
|
|
@ -275,15 +275,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
|
||||
CreateMap<Trial, TrialSiteUserSummaryExportDto>()
|
||||
.ForMember(t => t.TrialSiteUserList, u => u.Ignore());
|
||||
|
||||
CreateMap<TrialSiteUserSurvey, TrialSiteUserSummaryDto>()
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserTypeRole.UserTypeShortName))
|
||||
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.UserTypeRole.UserTypeEnum))
|
||||
.ForMember(t => t.TrialSiteCode, u => u.MapFrom(d => d.TrialSiteSurvey.TrialSite.TrialSiteCode))
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSiteSurvey.TrialSite.TrialSiteAliasName));
|
||||
|
||||
|
||||
CreateMap<Trial, TrialSiteSurveyStat>()
|
||||
.ForMember(t => t.ApprovalRequiredCount, u =>
|
||||
|
|
@ -300,12 +291,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
;
|
||||
|
||||
var userTypeId = Guid.Empty;
|
||||
CreateMap<Trial, DocSignStat>()
|
||||
.ForMember(t => t.WaitSignCount, u =>
|
||||
u.MapFrom(c => userTypeEnumInt == (int)UserTypeEnum.SuperAdmin ? 0
|
||||
|
||||
: c.TrialDocumentList.Where(t => t.IsDeleted == false && t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == userTypeId) && !t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == userId && t.ConfirmTime != null)).Count())
|
||||
);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -202,7 +202,7 @@ namespace IRaCIS.Application.Services
|
|||
.WhereIf(inQuery.TrialType != null, t => t.TrialType == inQuery.TrialType)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialCode), t => t.TrialCode.Contains(inQuery.TrialCode))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OA
|
||||
, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.ProjectTo<NewTrialView>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
|
|
@ -309,7 +309,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
//如果是PM, 则需要将该人员添加到 运维人员表
|
||||
//添加运维人员PM
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trial.Id, UserId = _userInfo.Id, JoinTime = DateTime.Now });
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trial.Id, UserId = _userInfo.UserRoleId, JoinTime = DateTime.Now });
|
||||
|
||||
|
||||
//默认采用系统邮件
|
||||
|
|
@ -639,7 +639,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
StudyCount = patient.SCPStudyList.Count(),
|
||||
|
||||
TrialList = patient.SubjectPatientList.Where(t => isAdminOrOA ? true : t.Subject.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)).Select(c => new PatientTrialStatInfo()
|
||||
TrialList = patient.SubjectPatientList.Where(t => isAdminOrOA ? true : t.Subject.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId)).Select(c => new PatientTrialStatInfo()
|
||||
{
|
||||
ExperimentName = c.Subject.Trial.ExperimentName,
|
||||
VisitCount = c.Subject.SubjectVisitList.Count()
|
||||
|
|
@ -693,7 +693,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
var trialQuery = _trialRepository.Where(t => t.TrialStatusStr == StaticData.TrialState.TrialOngoing)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Filter), t => t.ResearchProgramNo.Contains(inQuery.Filter) || t.ExperimentName.Contains(inQuery.Filter))
|
||||
.Where(t => t.TrialUserList.Any(c => c.UserId == _userInfo.Id))
|
||||
.Where(t => t.TrialUserList.Any(c => c.UserId == _userInfo.UserRoleId))
|
||||
.Where(t => !exceptQuery.Any(c => c == t.Id)).ProjectTo<PatientJoinTrialSelectView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var list = trialQuery.ToList();
|
||||
|
|
@ -714,7 +714,7 @@ namespace IRaCIS.Application.Services
|
|||
var isAdminOrOA = _userInfo.UserTypeEnumInt == (int)UserTypeEnum.Admin || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.OA || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin;
|
||||
|
||||
var trialQuery = _subjectPatientRepository.Where(t => t.PatientId == inQuery.PatientId)
|
||||
.Where(t => isAdminOrOA ? true : t.Subject.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.Where(t => isAdminOrOA ? true : t.Subject.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.ProjectTo<PatientJoinedTrialView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var pageList = await trialQuery.ToPagedListAsync(inQuery);
|
||||
|
|
@ -835,7 +835,7 @@ namespace IRaCIS.Application.Services
|
|||
[FromServices] IOSSService oSSService)
|
||||
{
|
||||
//清理自己管理的项目的数据
|
||||
var subjectPatientList = await _subjectPatientRepository.Where(t => t.PatientId == patientId && t.Subject.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
var subjectPatientList = await _subjectPatientRepository.Where(t => t.PatientId == patientId && t.Subject.Trial.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.Select(t => new { t.SubjectId, StudyInstanceUidList = t.Patient.SCPStudyList.Select(t => t.StudyInstanceUid).ToList() }).ToListAsync();
|
||||
|
||||
if (_studyRepository.Any(t => t.IsUploadFinished == false && t.PatientId == patientId))
|
||||
|
|
@ -1844,7 +1844,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
dbSubjectVisit.SubmitState = SubmitStateEnum.Submitted;
|
||||
dbSubjectVisit.SubmitTime = DateTime.Now;
|
||||
dbSubjectVisit.SubmitUserId = _userInfo.Id;
|
||||
dbSubjectVisit.SubmitUserId = _userInfo.UserRoleId;
|
||||
|
||||
//维护统一状态
|
||||
//dbSubjectVisit.ReadingStatus = ReadingStatusEnum.TaskAllocate;
|
||||
|
|
@ -3283,7 +3283,7 @@ namespace IRaCIS.Application.Services
|
|||
{
|
||||
var trialQuery = _trialRepository
|
||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OA
|
||||
, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
||||
.Select(t => new NewTrialSelectDTO()
|
||||
{
|
||||
TrialId = t.Id,
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
.WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId)
|
||||
// CRC 只负责他管理site的受试者
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.UserRoleId))
|
||||
.ProjectTo<SubjectQueryView>(_mapper.ConfigurationProvider)
|
||||
.WhereIf(inQuery.IsMissingImages != null, t => t.IsMissingImages == inQuery.IsMissingImages);
|
||||
|
||||
|
|
|
|||
|
|
@ -343,181 +343,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 入组流程-后台确认医生入组[Confirm]
|
||||
/// </summary>
|
||||
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
//[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM_SMM_CMM)]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> ConfirmReviewer(ConfirmReviewerCommand confirmReviewerCommand,
|
||||
[FromServices] IRepository<TrialUserRole> _trialUserRepository,
|
||||
[FromServices] IRepository<TaskAllocationRule> _taskAllocationRuleRepository)
|
||||
{
|
||||
//var trial = _trialRepository.FirstOrDefault(t => t.Id == trialId);
|
||||
//var existItem = _trialRepository.FindSingleOrDefault(u => u.Id == trialId && u.TrialStatus >= (int)TrialEnrollStatus.HasConfirmedDoctorNames);
|
||||
|
||||
//trial.TrialStatusStr = "Reading";
|
||||
////trial.TrialStatus = (int)TrialStatus.HasConfirmedDoctorNames;
|
||||
//_trialRepository.Update(trial);
|
||||
|
||||
var trialId = confirmReviewerCommand.TrialId;
|
||||
|
||||
var trial = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
||||
|
||||
if (trial == null) return Null404NotFound(trial);
|
||||
|
||||
|
||||
//更新入组表
|
||||
var intoGroupList = await _enrollRepository.Where(t => t.TrialId == trialId, true).ToListAsync();
|
||||
|
||||
//验证邮件
|
||||
var emaiList = await _doctorRepository.Where(t => intoGroupList.Select(t => t.DoctorId).Contains(t.Id))
|
||||
.Select(t => new { t.EMail, t.FirstName, t.LastName }).ToListAsync();
|
||||
|
||||
|
||||
var errorList = emaiList.Where(t => !Regex.IsMatch(t.EMail, @"^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$"))
|
||||
.ToList();
|
||||
|
||||
if (errorList.Count() > 0)
|
||||
{
|
||||
// errorList.Select(c => c.LastName+" / "+c.FirstName)) +"邮箱格式存在问题"
|
||||
return ResponseOutput.NotOk(string.Join(',', _localizer["Enroll_EmailFormat"], errorList.Select(c => c.LastName + " / " + c.FirstName)));
|
||||
}
|
||||
|
||||
|
||||
|
||||
var readingQuestionCriterionTrial = await _ReadingQuestionCriterionTrialRepository.Where(x => x.TrialId == confirmReviewerCommand.TrialId && x.IsConfirm).ToListAsync();
|
||||
|
||||
|
||||
List<TrialExperience> trialExperienceList = new List<TrialExperience>();
|
||||
// 获取标准字典
|
||||
|
||||
var criterionTypeList = await _dictionaryRepository.Where(x => x.Parent.Code == "CriterionType").ToListAsync();
|
||||
|
||||
if (confirmReviewerCommand.ConfirmState == 1) //确认入组
|
||||
{
|
||||
foreach (var intoGroupItem in intoGroupList)
|
||||
{
|
||||
if (confirmReviewerCommand.DoctorIdArray.Contains(intoGroupItem.DoctorId))
|
||||
{
|
||||
|
||||
//当邮件发送没有问题的时候,才修改状态 如果有问题,就当前不做处理
|
||||
try
|
||||
{
|
||||
var userId = await _mailVerificationService.DoctorJoinTrialEmail(trialId, intoGroupItem.DoctorId, confirmReviewerCommand.BaseUrl, confirmReviewerCommand.RouteUrl);
|
||||
|
||||
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId, true))
|
||||
{
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
}
|
||||
|
||||
await _enrollRepository.BatchUpdateNoTrackingAsync(t => t.Id == intoGroupItem.Id, u => new Enroll() { DoctorUserId = userId });
|
||||
|
||||
if (!await _taskAllocationRuleRepository.AnyAsync(t => t.TrialId == trialId && t.DoctorUserId == userId && t.EnrollId == intoGroupItem.Id, true))
|
||||
{
|
||||
await _taskAllocationRuleRepository.AddAsync(new TaskAllocationRule() { TrialId = trialId, DoctorUserId = userId, EnrollId = intoGroupItem.Id });
|
||||
|
||||
}
|
||||
|
||||
await _enrollDetailRepository.AddAsync(new EnrollDetail()
|
||||
{
|
||||
DoctorId = intoGroupItem.DoctorId,
|
||||
TrialId = trialId,
|
||||
EnrollStatus = EnrollStatus.ConfirmIntoGroup,
|
||||
OptUserType = (int)SystemUserType.AdminUser, //后台用户
|
||||
});
|
||||
|
||||
intoGroupItem.EnrollStatus = EnrollStatus.ConfirmIntoGroup;
|
||||
intoGroupItem.EnrollTime = DateTime.Now;
|
||||
|
||||
|
||||
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
intoGroupItem.EnrollStatus = EnrollStatus.ConfirmIntoGroupFailed;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<ExperienceDataType> dataTypes = new List<ExperienceDataType>()
|
||||
{
|
||||
ExperienceDataType.TrialAuto,
|
||||
ExperienceDataType.SystemAuto,
|
||||
|
||||
|
||||
};
|
||||
|
||||
// 添加临床试验经历
|
||||
if (trial.TrialType == TrialType.OfficialTrial)
|
||||
{
|
||||
foreach (var doctorId in confirmReviewerCommand.DoctorIdArray)
|
||||
{
|
||||
foreach (var item in readingQuestionCriterionTrial)
|
||||
{
|
||||
foreach (var dataType in dataTypes)
|
||||
{
|
||||
trialExperienceList.Add(new TrialExperience()
|
||||
{
|
||||
CriterionType = item.CriterionType,
|
||||
DoctorId = doctorId,
|
||||
PhaseId = trial.PhaseId,
|
||||
StartTime = DateTime.Now,
|
||||
IndicationEnum = trial.IndicationEnum,
|
||||
IndicationTypeId= trial.IndicationTypeId,
|
||||
ExperienceDataType = dataType,
|
||||
TrialId = trial.Id,
|
||||
VisitReadingCount = 0,
|
||||
ExperienceCriteriaList = new List<TrialExperienceCriteria>() {
|
||||
|
||||
new TrialExperienceCriteria()
|
||||
{
|
||||
EvaluationCriteriaId=criterionTypeList.Where(x=>x.Code==item.CriterionType.GetEnumInt()).Select(x=>x.Id).FirstOrDefault()
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
await _trialExperienceRepository.AddRangeAsync(trialExperienceList);
|
||||
await _trialExperienceRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else if (confirmReviewerCommand.ConfirmState == 0)//回退上一步
|
||||
{
|
||||
foreach (var intoGroupItem in intoGroupList)
|
||||
{
|
||||
if (confirmReviewerCommand.DoctorIdArray.Contains(intoGroupItem.DoctorId))
|
||||
{
|
||||
intoGroupItem.EnrollStatus = EnrollStatus.InviteIntoGroup;
|
||||
intoGroupItem.EnrollTime = null;
|
||||
|
||||
|
||||
var deleteItem = await _enrollDetailRepository.FirstOrDefaultAsync(t =>
|
||||
t.TrialId == trialId && t.DoctorId == intoGroupItem.DoctorId &&
|
||||
t.EnrollStatus == EnrollStatus.ConfirmIntoGroup);
|
||||
|
||||
await _enrollDetailRepository.DeleteAsync(deleteItem);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
await _enrollRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@ using IRaCIS.Core.Application.Helper;
|
|||
using IRaCIS.Core.Application.Service.BusinessFilter;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain;
|
||||
using IRaCIS.Core.Domain.Management;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
|
|
@ -39,11 +38,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
IRepository<Trial> _trialRepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> _systemEmailConfig,
|
||||
IOptionsMonitor<ServiceVerifyConfigOption> _basicConfig,
|
||||
IRepository<SystemDocument> _systemDocumentRepository,
|
||||
IRepository<TrialClinicalDataSetCriterion> _trialClinicalDataSetCriterionRepository,
|
||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||
IRepository<Internationalization> _internationalizationRepository,
|
||||
IRepository<SystemDocConfirmedUser> _systemDocConfirmedUserRepository,
|
||||
IRepository<DicomStudy> _dicomStudyRepository,
|
||||
IRepository<ClinicalDataTrialSet> _clinicalDataTrialSetRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
|
|
@ -362,51 +359,11 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
var timeSpan = HolidayHelper.GetChinaWorkTimeSpan(startdate, endDate);
|
||||
|
||||
_userRoleRepository.Where(t => t.Id == _userInfo.Id).Select(t => t.FullName).FirstOrDefault();
|
||||
_userRoleRepository.Where(t => t.Id == _userInfo.UserRoleId).Select(t => t.FullName).FirstOrDefault();
|
||||
|
||||
return $"{timeSpan.Days}天,{timeSpan.Hours}小时{timeSpan.Minutes}分钟{timeSpan.Seconds}秒";
|
||||
}
|
||||
|
||||
public async Task<IResponseOutput> TestEFcore8()
|
||||
{
|
||||
var systemDocQuery = from sysDoc in _systemDocumentRepository.Where()
|
||||
|
||||
join confirm in _systemDocConfirmedUserRepository.Where().Where(t => t.ConfirmTime != null) on sysDoc.Id equals confirm.SystemDocumentId
|
||||
select new UnionDocumentWithConfirmInfoView()
|
||||
{
|
||||
IsSystemDoc = true,
|
||||
|
||||
Id = sysDoc.Id,
|
||||
CreateTime = sysDoc.CreateTime,
|
||||
IsDeleted = sysDoc.IsDeleted,
|
||||
SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes,
|
||||
Name = sysDoc.Name,
|
||||
Path = sysDoc.Path,
|
||||
FileType = _userInfo.IsEn_Us ? sysDoc.FileType.Value : sysDoc.FileType.ValueCN,
|
||||
FileTypeId = sysDoc.FileTypeId,
|
||||
UpdateTime = sysDoc.UpdateTime,
|
||||
|
||||
|
||||
ConfirmUserId = confirm.ConfirmUserId,
|
||||
ConfirmTime = confirm.ConfirmTime,
|
||||
RealName = confirm.ConfirmUser.FullName,
|
||||
UserName = confirm.ConfirmUser.UserName,
|
||||
UserTypeId = confirm.ConfirmUser.UserTypeId,
|
||||
UserTypeShortName = confirm.ConfirmUser.UserTypeRole.UserTypeShortName,
|
||||
|
||||
FullFilePath = sysDoc.Path
|
||||
};
|
||||
|
||||
var list = systemDocQuery.OrderBy(t => t.ConfirmUserId).ThenBy(t => t.ConfirmTime).ToList();
|
||||
|
||||
//var aa= _dicRepository._dbContext.Subject.Where(t => t.Id == Guid.Empty).ExecuteUpdate("FirstName","ddd");
|
||||
|
||||
//await _repository.BatchUpdateAsync<Subject>(t => t.Id == Guid.Empty, u => new Subject() { FirstName = "fddd", LastName = "sss", UpdateTime = DateTime.Now });
|
||||
|
||||
//await _subjectRepository.Where().ExecuteUpdateAsync(t => t.SetProperty(t => t.UpdateTime, u => DateTime.Now));
|
||||
|
||||
return ResponseOutput.Ok(list);
|
||||
}
|
||||
// 设置 Ne
|
||||
|
||||
[AllowAnonymous]
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace IRaCIS.Core.Application.Triggers
|
|||
|
||||
if (context.ChangeType == ChangeType.Added)
|
||||
{
|
||||
await _userLogReposiotry.AddAsync(new UserLog() { OptType = UserOptType.AddUser, OptUserId = user.Id, LoginUserId = _userInfo.Id, IP = _userInfo.IP });
|
||||
await _userLogReposiotry.AddAsync(new UserLog() { OptType = UserOptType.AddUser, OptUserId = user.Id, LoginUserId = _userInfo.UserRoleId, IP = _userInfo.IP });
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,13 +41,20 @@ public enum UserOptType
|
|||
|
||||
UpdateUser = 11,
|
||||
|
||||
MFALogin = 12,
|
||||
[Description("更新用户角色")]
|
||||
UpdateUserRole = 12,
|
||||
|
||||
MFALoginFail = 13,
|
||||
TempLockLogin = 13,
|
||||
|
||||
AddUser = 14,
|
||||
|
||||
|
||||
ModifyCheckCode = 15,
|
||||
|
||||
WebUnlock = 16,
|
||||
|
||||
[Description("选择登录角色")]
|
||||
LoginSelectRole = 18,
|
||||
}
|
||||
|
||||
[Description("影像下载打包状态")]
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
[Comment("后台 - 系统文档签署记录")]
|
||||
[Table("SystemDocConfirmedUser")]
|
||||
public class SystemDocConfirmedUser : BaseAddDeleteAuditEntity
|
||||
|
||||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public SystemDocument SystemDocument { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("ConfirmUserId")]
|
||||
public UserRole ConfirmUser { get; set; }
|
||||
#endregion
|
||||
public Guid SystemDocumentId { get; set; }
|
||||
|
||||
public DateTime? ConfirmTime { get; set; }
|
||||
public Guid ConfirmUserId { get; set; }
|
||||
|
||||
public DateTime? SignFirstViewTime { get; set; }
|
||||
|
||||
[StringLength(1000)]
|
||||
public string SignText { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
[Comment("后台 - 系统文档需要签署用户类型")]
|
||||
[Table("SystemDocNeedConfirmedUserType")]
|
||||
public class SystemDocNeedConfirmedUserType : Entity
|
||||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
[ForeignKey("NeedConfirmUserTypeId")]
|
||||
public UserType UserTypeRole { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public SystemDocument SystemDocument { get; set; }
|
||||
#endregion
|
||||
public Guid SystemDocumentId { get; set; }
|
||||
|
||||
public Guid NeedConfirmUserTypeId { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
[Comment("后台 - 系统签署文档")]
|
||||
[Table("SystemDocument")]
|
||||
public class SystemDocument : BaseFullDeleteAuditEntity
|
||||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public List<SystemDocConfirmedUser> SystemDocConfirmedUserList { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<SystemDocNeedConfirmedUserType> NeedConfirmedUserTypeList { get; set; }
|
||||
[JsonIgnore]
|
||||
[ForeignKey("FileTypeId")]
|
||||
public Dictionary FileType { get; set; }
|
||||
#endregion
|
||||
public Guid FileTypeId { get; set; }
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public int SignViewMinimumMinutes { get; set; }
|
||||
|
||||
[StringLength(1000)]
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
public DocUserSignType DocUserSignType { get; set; }
|
||||
}
|
||||
|
||||
public enum DocUserSignType
|
||||
{
|
||||
//默认 内部 外部都需要签署
|
||||
InnerAndOuter=0,
|
||||
|
||||
//仅仅内部需要签署
|
||||
OnlyInner=1,
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
[Comment("项目 - 项目文档签署记录")]
|
||||
[Table("TrialDocConfirmedUser")]
|
||||
public class TrialDocConfirmedUser : BaseAddDeleteAuditEntity
|
||||
{
|
||||
#region 导航属性
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("ConfirmUserId")]
|
||||
public UserRole User { get; set; }
|
||||
[JsonIgnore]
|
||||
public TrialDocument TrialDocument { get; set; }
|
||||
#endregion
|
||||
public Guid TrialDocumentId { get; set; }
|
||||
public DateTime? ConfirmTime { get; set; }
|
||||
public Guid ConfirmUserId { get; set; }
|
||||
public DateTime? SignFirstViewTime { get; set; }
|
||||
|
||||
[StringLength(1000)]
|
||||
public string SignText { get; set; } = string.Empty;
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
[Comment("项目 - 项目文档需要签署的用户类型")]
|
||||
[Table("TrialDocNeedConfirmedUserType")]
|
||||
public class TrialDocNeedConfirmedUserType : Entity
|
||||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
[ForeignKey("NeedConfirmUserTypeId")]
|
||||
public UserType UserTypeRole { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public TrialDocument TrialDocument { get; set; }
|
||||
#endregion
|
||||
|
||||
public Guid TrialDocumentId { get; set; }
|
||||
|
||||
public Guid NeedConfirmUserTypeId { get; set; }
|
||||
}
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
[Comment("项目 - 项目文档")]
|
||||
[Table("TrialDocument")]
|
||||
public class TrialDocument : BaseFullDeleteAuditEntity
|
||||
{
|
||||
#region 导航属性
|
||||
[JsonIgnore]
|
||||
public List<TrialDocConfirmedUser> TrialDocConfirmedUserList { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<TrialDocNeedConfirmedUserType> NeedConfirmedUserTypeList { get; set; }
|
||||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("FileTypeId")]
|
||||
public Dictionary FileType { get; set; }
|
||||
#endregion
|
||||
[Comment("需要确认的项目用户 通过TrialId 关联 用中间表过滤")]
|
||||
public Guid FileTypeId { get; set; }
|
||||
|
||||
public string Name { get; set; } = string.Empty;
|
||||
|
||||
public string Path { get; set; } = string.Empty;
|
||||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
public int SignViewMinimumMinutes { get; set; }
|
||||
}
|
||||
|
||||
|
|
@ -7,7 +7,7 @@ using System.Linq;
|
|||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Management
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
[Comment("课题组")]
|
||||
public class HospitalGroup : BaseFullAuditEntity
|
||||
|
|
@ -33,7 +33,7 @@ namespace IRaCIS.Core.Domain.Management
|
|||
|
||||
public Guid IdentityUserId { get; set; }
|
||||
|
||||
public bool IsManager { get; set; }
|
||||
public bool IsManager { get; set; }
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -53,6 +53,11 @@ namespace IRaCIS.Core.Domain.Management
|
|||
[Projectable]
|
||||
public string FullName => LastName + " / " + FirstName;
|
||||
|
||||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
public Guid? TrialId { get; set; }
|
||||
|
||||
#region 用户信息
|
||||
|
||||
public int Code { get; set; }
|
||||
|
|
|
|||
|
|
@ -9,11 +9,18 @@ public class UserRole : BaseFullAuditEntity
|
|||
{
|
||||
#region 导航属性
|
||||
|
||||
[JsonIgnore]
|
||||
public IdentityUser IdentityUser { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public List<TrialUserRole> UserRoleTrials { get; set; } = new List<TrialUserRole>();
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
[ForeignKey("UserTypeId")]
|
||||
public UserType UserTypeRole { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<SystemDocConfirmedUser> SystemDocConfirmedList { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<TrialUserRole> UserTrials { get; set; } = new List<TrialUserRole>();
|
||||
|
|
@ -26,21 +33,45 @@ public class UserRole : BaseFullAuditEntity
|
|||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ±£Áô
|
||||
|
||||
public string UserName { get; set; }
|
||||
public string EMail { get; set; }
|
||||
public string FirstName { get; set; }
|
||||
|
||||
public string LastName { get; set; }
|
||||
|
||||
|
||||
[Comment("自动切换下一个任务")]
|
||||
public bool AutoCutNextTask { get; set; }
|
||||
|
||||
public int Code { get; set; }
|
||||
public string DepartmentName { get; set; } = null!;
|
||||
|
||||
|
||||
[Comment("医生生成账号后,会有值")]
|
||||
public Guid? DoctorId { get; set; }
|
||||
|
||||
public string EMail { get; set; } = null!;
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
public Guid UserTypeId { get; set; }
|
||||
|
||||
|
||||
public Guid IdentityUserId { get; set; }
|
||||
|
||||
public bool IsUserRoleDisabled { get; set; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region ºóÐø·ÏÆú
|
||||
public int Code { get; set; }
|
||||
public string DepartmentName { get; set; } = null!;
|
||||
|
||||
|
||||
[StringLength(1000)]
|
||||
public string EmailToken { get; set; } = null!;
|
||||
|
||||
public string FirstName { get; set; } = null!;
|
||||
|
||||
|
||||
[Comment("首次登录需要修改密码")]
|
||||
public bool IsFirstAdd { get; set; } = true;
|
||||
|
|
@ -57,7 +88,7 @@ public class UserRole : BaseFullAuditEntity
|
|||
|
||||
public DateTime? LastLoginTime { get; set; }
|
||||
|
||||
public string LastName { get; set; } = null!;
|
||||
|
||||
|
||||
public string OrganizationName { get; set; } = null!;
|
||||
|
||||
|
|
@ -65,10 +96,10 @@ public class UserRole : BaseFullAuditEntity
|
|||
|
||||
public bool PasswordChanged { get; set; }
|
||||
|
||||
|
||||
|
||||
public string Phone { get; set; } = null!;
|
||||
|
||||
|
||||
|
||||
public string PositionName { get; set; } = null!;
|
||||
|
||||
public int? Sex { get; set; }
|
||||
|
|
@ -77,17 +108,10 @@ public class UserRole : BaseFullAuditEntity
|
|||
|
||||
public bool SuperAdmin { get; set; }
|
||||
|
||||
|
||||
|
||||
public string UserCode { get; set; } = null!;
|
||||
|
||||
public string UserName { get; set; } = null!;
|
||||
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
public Guid UserTypeId { get; set; }
|
||||
|
||||
|
||||
public Guid IdentityUserId { get; set; }
|
||||
|
||||
#region HIR
|
||||
|
||||
|
|
@ -97,4 +121,8 @@ public class UserRole : BaseFullAuditEntity
|
|||
public string ThirdUserCode { get; set; } = string.Empty;
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using IRaCIS.Core.Domain.Management;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,6 @@ public class UserType : Entity
|
|||
[JsonIgnore]
|
||||
public List<UserTypeGroup> UserTypeGroupList { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<SystemDocNeedConfirmedUserType> SystemDocNeedConfirmedUserTypeList { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<UserRole> UserList { get; set; }
|
||||
|
|
|
|||
|
|
@ -31,8 +31,7 @@ public partial class Trial : BaseFullDeleteAuditEntity
|
|||
[JsonIgnore]
|
||||
public List<TrialSiteSurvey> TrialSiteSurveyList { get; set; } = new List<TrialSiteSurvey>();
|
||||
|
||||
[JsonIgnore]
|
||||
public List<TrialDocument> TrialDocumentList { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public List<Enroll> EnrollList { get; set; } = new List<Enroll>();
|
||||
[JsonIgnore]
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
using IRaCIS.Core.Domain.Management;
|
||||
|
||||
namespace IRaCIS.Core.Domain.Models;
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
public interface IUserInfo
|
||||
{
|
||||
|
||||
Guid Id { get; }
|
||||
Guid UserRoleId { get; }
|
||||
|
||||
Guid IdentityUserId { get; }
|
||||
|
||||
string UserName { get; }
|
||||
|
||||
string RealName { get; }
|
||||
string ReviewerCode { get; }
|
||||
string FullName { get; }
|
||||
|
||||
bool IsAdmin { get; }
|
||||
|
||||
|
|
@ -42,6 +43,11 @@
|
|||
|
||||
Guid? BatchId { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 稽查额外字符串
|
||||
/// </summary>
|
||||
string AuditIdentification { get; set; }
|
||||
|
||||
bool IsNotNeedInspection { get; set; }
|
||||
|
||||
|
||||
|
|
@ -49,10 +55,5 @@
|
|||
/// 字符串形式 标识时区
|
||||
/// </summary>
|
||||
string TimeZoneId { get; }
|
||||
|
||||
/// <summary>
|
||||
/// 稽查额外字符串
|
||||
/// </summary>
|
||||
string AuditIdentification { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,13 +15,29 @@ namespace IRaCIS.Core.Domain.Share
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// 用户Id
|
||||
/// 用户角色Id
|
||||
/// </summary>
|
||||
public Guid Id
|
||||
public Guid UserRoleId
|
||||
{
|
||||
get
|
||||
{
|
||||
var id = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.Id);
|
||||
var id = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.UserRoleId);
|
||||
if (id != null && !string.IsNullOrEmpty(id.Value))
|
||||
{
|
||||
return Guid.Parse(id.Value);
|
||||
}
|
||||
return Guid.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 真实用户Id
|
||||
/// </summary>
|
||||
public Guid IdentityUserId
|
||||
{
|
||||
get
|
||||
{
|
||||
var id = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.IdentityUserId);
|
||||
if (id != null && !string.IsNullOrEmpty(id.Value))
|
||||
{
|
||||
return Guid.Parse(id.Value);
|
||||
|
|
@ -51,7 +67,7 @@ namespace IRaCIS.Core.Domain.Share
|
|||
{
|
||||
get
|
||||
{
|
||||
var name = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.Name);
|
||||
var name = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.UserName);
|
||||
|
||||
if (name != null && !string.IsNullOrEmpty(name.Value))
|
||||
{
|
||||
|
|
@ -63,11 +79,11 @@ namespace IRaCIS.Core.Domain.Share
|
|||
}
|
||||
|
||||
|
||||
public string RealName
|
||||
public string FullName
|
||||
{
|
||||
get
|
||||
{
|
||||
var name = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.RealName);
|
||||
var name = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.FullName);
|
||||
|
||||
if (name != null && !string.IsNullOrEmpty(name.Value))
|
||||
{
|
||||
|
|
@ -78,19 +94,7 @@ namespace IRaCIS.Core.Domain.Share
|
|||
}
|
||||
}
|
||||
|
||||
public string ReviewerCode
|
||||
{
|
||||
get
|
||||
{
|
||||
var reviewerCode = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.Code);
|
||||
|
||||
if (reviewerCode != null && !string.IsNullOrEmpty(reviewerCode.Value))
|
||||
{
|
||||
return reviewerCode.Value;
|
||||
}
|
||||
return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string UserTypeShortName
|
||||
|
|
@ -165,7 +169,7 @@ namespace IRaCIS.Core.Domain.Share
|
|||
}
|
||||
}
|
||||
|
||||
public bool IsTestUser
|
||||
public bool IsTestUser
|
||||
{
|
||||
get
|
||||
{
|
||||
|
|
@ -258,7 +262,7 @@ namespace IRaCIS.Core.Domain.Share
|
|||
|
||||
get
|
||||
{
|
||||
var url = _accessor?.HttpContext?.Request?.Path.ToString()??string.Empty;
|
||||
var url = _accessor?.HttpContext?.Request?.Path.ToString();
|
||||
|
||||
var list = url.Split('/').Where(t => !string.IsNullOrWhiteSpace(t)).ToList();
|
||||
|
||||
|
|
@ -310,6 +314,7 @@ namespace IRaCIS.Core.Domain.Share
|
|||
get; set;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 是否不需要记录稽查
|
||||
/// </summary>
|
||||
|
|
@ -318,7 +323,7 @@ namespace IRaCIS.Core.Domain.Share
|
|||
/// <summary>
|
||||
/// 稽查额外字符串
|
||||
/// </summary>
|
||||
public string AuditIdentification { get; set; }
|
||||
public string AuditIdentification { get; set; } = string.Empty;
|
||||
}
|
||||
|
||||
public static class ClaimAttributes
|
||||
|
|
@ -347,16 +352,16 @@ namespace IRaCIS.Core.Domain.Share
|
|||
|
||||
public struct JwtIRaCISClaimType
|
||||
{
|
||||
public const string Id = "id";
|
||||
public const string IdentityUserId = "identityUserId";
|
||||
public const string UserRoleId = "userRoleId";
|
||||
public const string Code = "code";
|
||||
public const string Name = "name";
|
||||
public const string RealName = "realName";
|
||||
public const string UserName = "name";
|
||||
public const string FullName = "fullName";
|
||||
public const string UserTypeId = "userTypeId";
|
||||
public const string UserTypeEnum = "userTypeEnum";
|
||||
public const string UserTypeEnumName = "userTypeEnumName";
|
||||
public const string UserTypeEnumInt = "userTypeEnumInt";
|
||||
public const string UserTypeShortName = "userTypeShortName";
|
||||
public const string IsAdmin = "isAdmin";
|
||||
|
||||
public const string IsTestUser = "isTestUser";
|
||||
|
||||
|
|
@ -390,7 +395,6 @@ namespace IRaCIS.Core.Domain.Share
|
|||
{
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static string IpReplace(string inip)
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
{
|
||||
return new List<Type>()
|
||||
{
|
||||
typeof(TrialDocument)
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -903,192 +903,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
#endregion
|
||||
|
||||
#region 文档相关
|
||||
|
||||
|
||||
|
||||
// 系统文件签署 父层级未记录稽查(系统文档初始数据)
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemDocConfirmedUser)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as SystemDocConfirmedUser;
|
||||
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
|
||||
if (type == AuditOpt.Update)
|
||||
{
|
||||
if (entity.IsDeleted == true)
|
||||
{
|
||||
extraIdentification = "/" + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
extraIdentification = "/" + 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var systemDocument = await _dbContext.SystemDocument.Where(x => x.Id == entity.SystemDocumentId).FirstOrDefaultAsync();
|
||||
await InsertInspection<SystemDocConfirmedUser>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
GeneralId = x.Id,
|
||||
ExtraIndentification = extraIdentification,
|
||||
ObjectRelationParentId = x.SystemDocumentId
|
||||
|
||||
}, new
|
||||
{
|
||||
|
||||
FileTypeId = systemDocument.FileTypeId,
|
||||
Name = systemDocument.Name,
|
||||
UploadTime = systemDocument.CreateTime,
|
||||
|
||||
CreateUserName = _userInfo.UserName,
|
||||
UserType = _userInfo.UserTypeShortName,
|
||||
IsSigned = entity.ConfirmTime != null, // 是否签署 添加了就是签署了
|
||||
});
|
||||
}
|
||||
|
||||
// 项目文件签署
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocConfirmedUser)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as TrialDocConfirmedUser;
|
||||
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
|
||||
if (type == AuditOpt.Update)
|
||||
{
|
||||
if (entity.IsDeleted == true)
|
||||
{
|
||||
extraIdentification = "/" + 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
extraIdentification = "/" + 1;
|
||||
}
|
||||
}
|
||||
|
||||
var trialDoc = await _dbContext.TrialDocument.Where(x => x.Id == entity.TrialDocumentId).FirstOrDefaultAsync();
|
||||
|
||||
await InsertInspection<TrialDocConfirmedUser>(entity as TrialDocConfirmedUser, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
TrialId = trialDoc.TrialId,
|
||||
ExtraIndentification = extraIdentification,
|
||||
|
||||
ObjectRelationParentId = x.TrialDocumentId
|
||||
}, new
|
||||
{
|
||||
|
||||
UploadTime = trialDoc.CreateTime,
|
||||
|
||||
CreateUserName = _userInfo.UserName,
|
||||
|
||||
UserType = _userInfo.UserTypeShortName,
|
||||
|
||||
IsSigned = entity.ConfirmTime != null
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
//系统文件
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SystemDocument)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as SystemDocument;
|
||||
|
||||
List<Guid> needConfirmedUserTypeIdList = new List<Guid>();
|
||||
|
||||
if (entity.NeedConfirmedUserTypeList == null)
|
||||
{
|
||||
needConfirmedUserTypeIdList = await _dbContext.SystemDocNeedConfirmedUserType.Where(x => x.SystemDocumentId == entity.Id).Select(t => t.NeedConfirmUserTypeId).ToListAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
needConfirmedUserTypeIdList = entity.NeedConfirmedUserTypeList.Select(t => t.NeedConfirmUserTypeId).ToList();
|
||||
}
|
||||
|
||||
|
||||
var userTypeNameList = await _dbContext.UserType.Where(x => needConfirmedUserTypeIdList.Contains(x.Id)).Select(x => x.UserTypeShortName).ToListAsync();
|
||||
var userTypeName = string.Join(",", userTypeNameList);
|
||||
await InsertInspection<SystemDocument>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false
|
||||
}, new
|
||||
{
|
||||
NeedConfirmedUserType = userTypeName,
|
||||
});
|
||||
}
|
||||
|
||||
// 项目文档
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocument)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as TrialDocument;
|
||||
|
||||
List<Guid> needConfirmedUserTypeIdList = new List<Guid>();
|
||||
|
||||
if (entity.NeedConfirmedUserTypeList == null)
|
||||
{
|
||||
needConfirmedUserTypeIdList = await _dbContext.TrialDocNeedConfirmedUserType.Where(x => x.TrialDocumentId == entity.Id).Select(t => t.NeedConfirmUserTypeId).ToListAsync();
|
||||
}
|
||||
else
|
||||
{
|
||||
needConfirmedUserTypeIdList = entity.NeedConfirmedUserTypeList.Select(t => t.NeedConfirmUserTypeId).ToList();
|
||||
}
|
||||
|
||||
var usertypeNames = await _dbContext.UserType.Where(x => needConfirmedUserTypeIdList.Contains(x.Id)).Select(x => x.UserTypeShortName).ToListAsync();
|
||||
var usertypeName = string.Join(",", usertypeNames);
|
||||
await InsertInspection<TrialDocument>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
ObjectRelationParentId = x.TrialId
|
||||
},
|
||||
new
|
||||
{
|
||||
NeedConfirmedUserType = usertypeName,
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
//项目标准自动发送邮件配置
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialEmailNoticeConfig)))
|
||||
{
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
var entity = item.Entity as TrialEmailNoticeConfig;
|
||||
|
||||
//找到配置的用户
|
||||
var configUserTypeList = entitys.Where(x => x.Entity.GetType() == typeof(TrialEmailNoticeUser)).Select(t => t.Entity as TrialEmailNoticeUser)
|
||||
.Where(t => t.TrialEmailNoticeConfigId == entity.Id).Select(t =>
|
||||
new { t.TrialEmailNoticeConfigId, t.EmailUserType, t.UserType }).ToList();
|
||||
|
||||
|
||||
|
||||
await InsertInspection<TrialEmailNoticeConfig>(entity, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
IsDistinctionInterface = false,
|
||||
ObjectRelationParentId = x.TrialReadingCriterionId,
|
||||
ExtraIndentification = extraIdentification
|
||||
},
|
||||
new
|
||||
{
|
||||
ToUserTypes = configUserTypeList.Where(t => t.EmailUserType == EmailUserType.To).Select(t => t.UserType).ToList(),
|
||||
CopyUserTypes = configUserTypeList.Where(t => t.EmailUserType == EmailUserType.Copy).Select(t => t.UserType).ToList(),
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 热键 模板 个性化配置
|
||||
|
|
@ -3594,9 +3408,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
|
||||
inspection.CreateUserName = _userInfo.UserName;
|
||||
inspection.CreateUserRealName = _userInfo.RealName;
|
||||
inspection.CreateUserRealName = _userInfo.FullName;
|
||||
inspection.RoleName = _userInfo.UserTypeShortName;
|
||||
inspection.CreateUserId = _userInfo.Id;
|
||||
inspection.CreateUserId = _userInfo.UserRoleId;
|
||||
inspection.IP = _userInfo.IP;
|
||||
inspection.CreateTime = inspection.CreateTime == default(DateTime) ? DateTime.Now : inspection.CreateTime;
|
||||
|
||||
|
|
@ -3779,11 +3593,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
{
|
||||
var entityTypeName = entityObj.GetType().Name;
|
||||
|
||||
//文档签署这块,不区分系统和项目的 需要处理为同一个标识
|
||||
if (typeof(T) == typeof(TrialDocConfirmedUser) || typeof(T) == typeof(SystemDocConfirmedUser))
|
||||
{
|
||||
entityTypeName = "New/" + "UserSigned";
|
||||
}
|
||||
|
||||
|
||||
//默认规则
|
||||
if (IsDistinctionInterface)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
using IRaCIS.Core.Domain.BaseModel;
|
||||
using IRaCIS.Core.Domain.Management;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using IRaCIS.Core.Infrastructure.Encryption;
|
||||
|
|
@ -471,17 +470,7 @@ public class IRaCISDBContext : DbContext
|
|||
#endregion
|
||||
|
||||
|
||||
#region Document
|
||||
public virtual DbSet<SystemDocument> SystemDocument { get; set; }
|
||||
public virtual DbSet<TrialDocument> TrialDocument { get; set; }
|
||||
public virtual DbSet<TrialDocNeedConfirmedUserType> TrialDocUserTypeConfirm { get; set; }
|
||||
public virtual DbSet<SystemDocConfirmedUser> SystemDocConfirmedUser { get; set; }
|
||||
public virtual DbSet<SystemDocNeedConfirmedUserType> SystemDocNeedConfirmedUserType { get; set; }
|
||||
|
||||
public virtual DbSet<TrialDocNeedConfirmedUserType> TrialDocNeedConfirmedUserType { get; set; }
|
||||
|
||||
public virtual DbSet<TrialDocConfirmedUser> TrialDocConfirmedUser { get; set; }
|
||||
#endregion
|
||||
|
||||
#region 未分类
|
||||
|
||||
|
|
|
|||
|
|
@ -55,25 +55,7 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
}
|
||||
}
|
||||
|
||||
public class SystemDocConfirmedUserConfigration : IEntityTypeConfiguration<SystemDocConfirmedUser>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<SystemDocConfirmedUser> builder)
|
||||
{
|
||||
#region 不用显示配置
|
||||
//// 配置 CreateUser 关系
|
||||
//builder.HasOne(s => s.CreateUser)
|
||||
// .WithMany() // 假设 User 表没有对应的反向导航属性,如果有,填入属性名
|
||||
// .HasForeignKey(s => s.CreateUserId);
|
||||
////.OnDelete(DeleteBehavior.Restrict); // 可根据业务需求调整删除行为
|
||||
#endregion
|
||||
|
||||
// 配置 ConfirmUser 关系 (一个用户可以签名多个文档)
|
||||
builder.HasOne(s => s.ConfirmUser) // ConfirmUser
|
||||
.WithMany(t => t.SystemDocConfirmedList)
|
||||
.HasForeignKey(s => s.ConfirmUserId);
|
||||
//.OnDelete(DeleteBehavior.Restrict);
|
||||
}
|
||||
}
|
||||
|
||||
public class TrialUserConfigration : IEntityTypeConfiguration<TrialUserRole>
|
||||
{
|
||||
|
|
@ -82,11 +64,38 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration
|
|||
{
|
||||
//TrialUser 和User 之间 一对多 (一个用户可以参与多个项目)
|
||||
builder.HasOne(s => s.UserRole)
|
||||
.WithMany(t => t.UserTrials)
|
||||
.WithMany(t => t.UserRoleTrials)
|
||||
.HasForeignKey(s => s.UserId);
|
||||
|
||||
//TrialUser User 一对一 创建人
|
||||
}
|
||||
}
|
||||
|
||||
public class IdentityUserConfigration : IEntityTypeConfiguration<IdentityUser>
|
||||
{
|
||||
//当一个实体,针对同一个类,有两个一对一导航属性,但是是不同的外键,一个外键是一对一,一个是一对多,那么需要显示配置一对多的关系
|
||||
public void Configure(EntityTypeBuilder<IdentityUser> builder)
|
||||
{
|
||||
builder.HasMany(s => s.UserRoleList)
|
||||
.WithOne(t => t.IdentityUser)
|
||||
.HasForeignKey(s => s.IdentityUserId);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public class TrialIdentityUserConfigration : IEntityTypeConfiguration<TrialIdentityUser>
|
||||
{
|
||||
//当一个实体,针对同一个类,有两个一对一导航属性,但是是不同的外键,一个外键是一对一,一个是一对多,那么需要显示配置一对多的关系
|
||||
public void Configure(EntityTypeBuilder<TrialIdentityUser> builder)
|
||||
{
|
||||
builder.HasMany(s => s.TrialUserRoleList)
|
||||
.WithOne(t => t.TrialUser)
|
||||
.HasForeignKey(s => s.TrialUserId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,14 +104,14 @@ public class AuditEntityInterceptor(IUserInfo _userInfo,
|
|||
if (entry.Entity is IAuditUpdate updateEntity1)
|
||||
{
|
||||
updateEntity1.UpdateTime = DateTime.Now;
|
||||
updateEntity1.UpdateUserId = _userInfo.Id;
|
||||
updateEntity1.UpdateUserId = _userInfo.UserRoleId;
|
||||
}
|
||||
|
||||
if (entry.Entity is ISoftDelete softDelete)
|
||||
{
|
||||
if (softDelete.IsDeleted)
|
||||
{
|
||||
softDelete.DeleteUserId = _userInfo.Id;
|
||||
softDelete.DeleteUserId = _userInfo.UserRoleId;
|
||||
softDelete.DeletedTime = DateTime.Now;
|
||||
}
|
||||
else
|
||||
|
|
@ -133,7 +133,7 @@ public class AuditEntityInterceptor(IUserInfo _userInfo,
|
|||
}
|
||||
if (addEntity.CreateUserId == default(Guid))
|
||||
{
|
||||
addEntity.CreateUserId = _userInfo.Id;
|
||||
addEntity.CreateUserId = _userInfo.UserRoleId;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -141,7 +141,7 @@ public class AuditEntityInterceptor(IUserInfo _userInfo,
|
|||
if (entry.Entity is IAuditUpdate updateEntity)
|
||||
{
|
||||
updateEntity.UpdateTime = DateTime.Now;
|
||||
updateEntity.UpdateUserId = _userInfo.Id;
|
||||
updateEntity.UpdateUserId = _userInfo.UserRoleId;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
18753
IRaCIS.Core.Infra.EFCore/Migrations/20250815014752_secondUserModify.Designer.cs
generated
Normal file
18753
IRaCIS.Core.Infra.EFCore/Migrations/20250815014752_secondUserModify.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,364 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class secondUserModify : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "SystemDocConfirmedUser");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SystemDocNeedConfirmedUserType");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TrialDocConfirmedUser");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TrialDocNeedConfirmedUserType");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "SystemDocument");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "TrialDocument");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "IsUserRoleDisabled",
|
||||
table: "User",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "TrialId",
|
||||
table: "IdentityUser",
|
||||
type: "uniqueidentifier",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_IdentityUser_TrialId",
|
||||
table: "IdentityUser",
|
||||
column: "TrialId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUser_Trial_TrialId",
|
||||
table: "IdentityUser",
|
||||
column: "TrialId",
|
||||
principalTable: "Trial",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_IdentityUser_Trial_TrialId",
|
||||
table: "IdentityUser");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_IdentityUser_TrialId",
|
||||
table: "IdentityUser");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "IsUserRoleDisabled",
|
||||
table: "User");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TrialId",
|
||||
table: "IdentityUser");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SystemDocument",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FileTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DeleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
DocUserSignType = table.Column<int>(type: "int", nullable: false),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
Path = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false),
|
||||
SignViewMinimumMinutes = table.Column<int>(type: "int", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SystemDocument", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SystemDocument_Dictionary_FileTypeId",
|
||||
column: x => x.FileTypeId,
|
||||
principalTable: "Dictionary",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_SystemDocument_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "后台 - 系统签署文档");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TrialDocument",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
FileTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false, comment: "需要确认的项目用户 通过TrialId 关联 用中间表过滤"),
|
||||
TrialId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DeleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
Description = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
Name = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
Path = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
|
||||
SignViewMinimumMinutes = table.Column<int>(type: "int", nullable: false),
|
||||
UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TrialDocument", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TrialDocument_Dictionary_FileTypeId",
|
||||
column: x => x.FileTypeId,
|
||||
principalTable: "Dictionary",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_TrialDocument_Trial_TrialId",
|
||||
column: x => x.TrialId,
|
||||
principalTable: "Trial",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_TrialDocument_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "项目 - 项目文档");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SystemDocConfirmedUser",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ConfirmUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SystemDocumentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ConfirmTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DeleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
SignFirstViewTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
SignText = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SystemDocConfirmedUser", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SystemDocConfirmedUser_SystemDocument_SystemDocumentId",
|
||||
column: x => x.SystemDocumentId,
|
||||
principalTable: "SystemDocument",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_SystemDocConfirmedUser_User_ConfirmUserId",
|
||||
column: x => x.ConfirmUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_SystemDocConfirmedUser_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "后台 - 系统文档签署记录");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "SystemDocNeedConfirmedUserType",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
NeedConfirmUserTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
SystemDocumentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_SystemDocNeedConfirmedUserType", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_SystemDocNeedConfirmedUserType_SystemDocument_SystemDocumentId",
|
||||
column: x => x.SystemDocumentId,
|
||||
principalTable: "SystemDocument",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_SystemDocNeedConfirmedUserType_UserType_NeedConfirmUserTypeId",
|
||||
column: x => x.NeedConfirmUserTypeId,
|
||||
principalTable: "UserType",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "后台 - 系统文档需要签署用户类型");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TrialDocConfirmedUser",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ConfirmUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TrialDocumentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
ConfirmTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
|
||||
DeleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
|
||||
DeletedTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
IsDeleted = table.Column<bool>(type: "bit", nullable: false),
|
||||
SignFirstViewTime = table.Column<DateTime>(type: "datetime2", nullable: true),
|
||||
SignText = table.Column<string>(type: "nvarchar(1000)", maxLength: 1000, nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TrialDocConfirmedUser", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TrialDocConfirmedUser_TrialDocument_TrialDocumentId",
|
||||
column: x => x.TrialDocumentId,
|
||||
principalTable: "TrialDocument",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_TrialDocConfirmedUser_User_ConfirmUserId",
|
||||
column: x => x.ConfirmUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_TrialDocConfirmedUser_User_CreateUserId",
|
||||
column: x => x.CreateUserId,
|
||||
principalTable: "User",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "项目 - 项目文档签署记录");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "TrialDocNeedConfirmedUserType",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
NeedConfirmUserTypeId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
||||
TrialDocumentId = table.Column<Guid>(type: "uniqueidentifier", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_TrialDocNeedConfirmedUserType", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_TrialDocNeedConfirmedUserType_TrialDocument_TrialDocumentId",
|
||||
column: x => x.TrialDocumentId,
|
||||
principalTable: "TrialDocument",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_TrialDocNeedConfirmedUserType_UserType_NeedConfirmUserTypeId",
|
||||
column: x => x.NeedConfirmUserTypeId,
|
||||
principalTable: "UserType",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
},
|
||||
comment: "项目 - 项目文档需要签署的用户类型");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SystemDocConfirmedUser_ConfirmUserId",
|
||||
table: "SystemDocConfirmedUser",
|
||||
column: "ConfirmUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SystemDocConfirmedUser_CreateUserId",
|
||||
table: "SystemDocConfirmedUser",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SystemDocConfirmedUser_SystemDocumentId",
|
||||
table: "SystemDocConfirmedUser",
|
||||
column: "SystemDocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SystemDocNeedConfirmedUserType_NeedConfirmUserTypeId",
|
||||
table: "SystemDocNeedConfirmedUserType",
|
||||
column: "NeedConfirmUserTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SystemDocNeedConfirmedUserType_SystemDocumentId",
|
||||
table: "SystemDocNeedConfirmedUserType",
|
||||
column: "SystemDocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SystemDocument_CreateUserId",
|
||||
table: "SystemDocument",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_SystemDocument_FileTypeId",
|
||||
table: "SystemDocument",
|
||||
column: "FileTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TrialDocConfirmedUser_ConfirmUserId",
|
||||
table: "TrialDocConfirmedUser",
|
||||
column: "ConfirmUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TrialDocConfirmedUser_CreateUserId",
|
||||
table: "TrialDocConfirmedUser",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TrialDocConfirmedUser_TrialDocumentId",
|
||||
table: "TrialDocConfirmedUser",
|
||||
column: "TrialDocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TrialDocNeedConfirmedUserType_NeedConfirmUserTypeId",
|
||||
table: "TrialDocNeedConfirmedUserType",
|
||||
column: "NeedConfirmUserTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TrialDocNeedConfirmedUserType_TrialDocumentId",
|
||||
table: "TrialDocNeedConfirmedUserType",
|
||||
column: "TrialDocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TrialDocument_CreateUserId",
|
||||
table: "TrialDocument",
|
||||
column: "CreateUserId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TrialDocument_FileTypeId",
|
||||
table: "TrialDocument",
|
||||
column: "FileTypeId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_TrialDocument_TrialId",
|
||||
table: "TrialDocument",
|
||||
column: "TrialId");
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue