181 lines
6.6 KiB
C#
181 lines
6.6 KiB
C#
using IRaCIS.Api.Filter;
|
||
using IRaCIS.Application;
|
||
using IRaCIS.Application.Interfaces;
|
||
using IRaCIS.Application.ViewModels;
|
||
using Microsoft.AspNetCore.Authorization;
|
||
using Microsoft.AspNetCore.Mvc;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using IRaCIS.Core.Application.Contracts.RequestAndResponse;
|
||
using IRaCIS.Core.Domain.Share;
|
||
using IRaCIS.Core.Domain.Interfaces;
|
||
using System.Linq;
|
||
|
||
namespace IRaCIS.Core.API.Controllers
|
||
{
|
||
/// <summary>
|
||
/// 入组具体流程各个医生列表信息、和提交动作
|
||
/// </summary>
|
||
[Route("enroll")]
|
||
[ApiController, Authorize, ApiExplorerSettings(GroupName = "Enroll")]
|
||
public class EnrollController : ControllerBase
|
||
{
|
||
private readonly IFileService _fileService;
|
||
private readonly ITrialEnrollmentService _trialEnrollmentService;
|
||
private readonly IDoctorListQueryService _doctorListQueryService;
|
||
private readonly IEnrollRepository _enrollRepository;
|
||
private readonly IDoctorRepository _doctorRepository;
|
||
|
||
|
||
|
||
public EnrollController(IFileService fileService,
|
||
ITrialEnrollmentService trialEnrollmentService,
|
||
IDoctorListQueryService doctorListQueryService,
|
||
IEnrollRepository enrollRepository,
|
||
IDoctorRepository doctorRepository
|
||
|
||
)
|
||
{
|
||
_fileService = fileService;
|
||
_trialEnrollmentService = trialEnrollmentService;
|
||
_doctorListQueryService = doctorListQueryService;
|
||
_enrollRepository = enrollRepository;
|
||
_doctorRepository = doctorRepository;
|
||
|
||
}
|
||
|
||
#region Trial 入组相关
|
||
|
||
/// <summary> 为项目筛选医生 提交 【select】 </summary>
|
||
/// <param name="trialId">项目Id</param>
|
||
/// <param name="doctorIdArray">医生Id数组</param>
|
||
/// <returns></returns>
|
||
[LogFilter]
|
||
[HttpPost, Route("selectReviewers/{trialId:guid}")]
|
||
public IResponseOutput SelectReviewers(Guid trialId, Guid[] doctorIdArray)
|
||
{
|
||
var userId = Guid.Parse(User.FindFirst("id").Value);
|
||
return _trialEnrollmentService.SelectReviewer(userId, trialId, doctorIdArray);
|
||
|
||
}
|
||
|
||
[LogFilter]
|
||
[HttpPost, Route("downloadResume/{trialId:guid}")]
|
||
public IResponseOutput<string> DownloadResume(Guid trialId, Guid[] doctorIdArray)
|
||
{
|
||
var userId = Guid.Parse(User.FindFirst("id").Value);
|
||
var zipPath = _fileService.CreateOfficialResumeZip(doctorIdArray);
|
||
|
||
return ResponseOutput.Ok(SystemConfig.RootUrl + zipPath);
|
||
}
|
||
|
||
/// <summary>提交CRO列表 【Submit】</summary>
|
||
/// <param name="trialId">项目Id</param>
|
||
/// <param name="doctorIdArray">医生Id列表</param>
|
||
/// <param name="commitState"></param>
|
||
/// <returns></returns>
|
||
[LogFilter]
|
||
[HttpPost, Route("submitReviewer/{trialId:guid}/{commitState:int}")]
|
||
public IResponseOutput SubmitReviewer(Guid trialId, Guid[] doctorIdArray, int commitState)
|
||
{
|
||
var userId = Guid.Parse(User.FindFirst("id").Value);
|
||
return _trialEnrollmentService.SubmitReviewer(userId, trialId, doctorIdArray, commitState);
|
||
|
||
|
||
}
|
||
/// <summary>入组名单确认 提交【 Approve】 </summary>
|
||
/// <param name="trialId">项目Id</param>
|
||
/// <param name="doctorIdArray">医生Id列表</param>
|
||
/// <param name="auditState"></param>
|
||
/// <returns></returns>
|
||
|
||
[LogFilter]
|
||
[HttpPost, Route("approveReviewer/{trialId:guid}/{auditState:int}")]
|
||
public IResponseOutput ApproveReviewer(Guid trialId, Guid[] doctorIdArray, int auditState)
|
||
{
|
||
var userId = Guid.Parse(User.FindFirst("id").Value);
|
||
return _trialEnrollmentService.ApproveReviewer(userId, trialId, doctorIdArray, auditState);
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取医生项目列表
|
||
/// </summary>
|
||
/// <param name="challengeQuery"></param>
|
||
/// <returns></returns>
|
||
[HttpPost,Route("Enroll/GetTrialDoctorList")]
|
||
[LogFilter]
|
||
public PageOutput<EnrollViewModel> GetTrialDoctorList(EnrollGetQuery challengeQuery)
|
||
{
|
||
|
||
|
||
return _doctorListQueryService.GetTrialDoctorList(challengeQuery);
|
||
//return ResponseOutput.Ok(_doctorListQueryService.GetTrialDoctorList(challengeQuery));
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 添加或更新项目医生项目价格
|
||
/// </summary>
|
||
[LogFilter]
|
||
[HttpPost, Route("addOrUpdateModel")]
|
||
public IResponseOutput AddOrUpdateEnroll(EnrollCommand addOrUpdateModel)
|
||
{
|
||
return ResponseOutput.Ok(_doctorListQueryService.AddOrUpdateEnroll(addOrUpdateModel));
|
||
}
|
||
|
||
/// <summary>
|
||
/// 后台确认医生入组 【Confirm】
|
||
/// </summary>
|
||
|
||
[LogFilter]
|
||
[HttpPost, Route("confirmReviewer/{trialId:guid}/{confirmState:int}")]
|
||
public IResponseOutput ConfirmReviewer(Guid trialId, Guid[] doctorIdArray, int confirmState)
|
||
{
|
||
var userId = Guid.Parse(User.FindFirst("id").Value);
|
||
return _trialEnrollmentService.ConfirmReviewer(userId, trialId, doctorIdArray, confirmState);
|
||
|
||
}
|
||
|
||
#endregion
|
||
|
||
#region 入组过程,各个状态的列表接口
|
||
/// <summary>
|
||
/// 筛选医生列表 [AUTH]
|
||
/// </summary>
|
||
[HttpPost, Route("getSelectionReviewerList")]
|
||
public IResponseOutput<PageOutput<SelectionReviewerDTO>> GetSelectionReviewerList(
|
||
ReviewerSelectionQueryDTO param)
|
||
{
|
||
|
||
return ResponseOutput.Ok(_doctorListQueryService.GetSelectionReviewerList(param));
|
||
|
||
}
|
||
/// <summary>
|
||
/// 根据状态获取医生列表,入组 相关接口 (提交CRO-1) CRO确认-4
|
||
/// </summary>
|
||
[HttpPost, Route("getSubmissionOrApprovalReviewerList")]
|
||
public IResponseOutput<PageOutput<ConfirmationReviewerDTO>> GetSubmissionOrApprovalReviewerList(
|
||
ReviewerSubmissionQueryDTO param)
|
||
{
|
||
|
||
return ResponseOutput.Ok(_doctorListQueryService.GetSubmissionOrApprovalReviewerList(param));
|
||
|
||
}
|
||
|
||
/// <summary>
|
||
/// 获取项目下医生入组状态列表[Confirmation]
|
||
/// </summary>
|
||
|
||
[HttpPost, Route("getConfirmationReviewerList")]
|
||
public IResponseOutput<PageOutput<ConfirmationReviewerDTO>> GetConfirmationReviewerList(
|
||
ReviewerConfirmationQueryDTO trialIdPageModel)
|
||
{
|
||
|
||
return ResponseOutput.Ok(_doctorListQueryService.GetConfirmationReviewerList(trialIdPageModel));
|
||
|
||
}
|
||
#endregion
|
||
}
|
||
}
|