CostCalculationItem/IRaCIS.Core.API/Controllers/Doctor/DoctorController.cs

227 lines
8.5 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System;
using System.Collections.Generic;
using IRaCIS.Api.Filter;
using IRaCIS.Application.Interfaces;
using IRaCIS.Application.ViewModels;
using IRaCIS.Core.Application.Contracts.RequestAndResponse;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace IRaCIS.Api.Controllers
{
/// <summary>
/// 医生基本信息 、工作信息 专业信息、审核状态
/// </summary>
[Route("doctor")]
[ApiController, Authorize, ApiExplorerSettings(GroupName = "Reviewer")]
public class DoctorController : ControllerBase
{
private readonly IDoctorService _doctorService;
public DoctorController(IDoctorService doctorService)
{
_doctorService = doctorService;
}
#region 医生列表查询接口
/// <summary>
/// 分页获取医生列表 (带查询条件)
/// </summary>
//
[HttpPost, Route("getDoctorSearchList")]
public IResponseOutput<PageOutput<DoctorDTO>> GetDoctorList([FromServices] IDoctorListQueryService _doctorListQueryService, DoctorSearchDTO doctorSearchModel)
{
var userId = Guid.Parse(User.FindFirst("id").Value);
return ResponseOutput.Ok(_doctorListQueryService.GetReviewerList(doctorSearchModel, userId)) ;
}
#endregion
#region 医生基本信息管理
/// <summary>
///详情、编辑-获取 医生基本信息 BasicInfo
/// </summary>
/// <param name="doctorId">ReviewerID</param>
/// <returns></returns>
[HttpGet, Route("getBasicInfo/{doctorId:guid}")]
public IResponseOutput<DoctorBasicInfoDTO> GetDoctorBasicInfoById(Guid doctorId)
{
var doctorInfo = _doctorService.GetDoctorBasicInfo(doctorId);
return ResponseOutput.Ok(doctorInfo);
}
/// <summary>
/// Get Statement of Work list.[New]
/// </summary>
/// <param name="doctorId"></param>
/// <returns></returns>
[HttpGet, Route("getDoctorSowList/{doctorId:guid}")]
public IResponseOutput<List<SowDTO>> GetDoctorSow(Guid doctorId)
{
var list = _doctorService.GetDoctorSow(doctorId);
return ResponseOutput.Ok(list);
}
/// <summary>
/// Get Ack Statement of Work[New]
/// </summary>
/// <param name="doctorId"></param>
/// <returns></returns>
[HttpGet, Route("getDoctorAckSowList/{doctorId:guid}")]
public IResponseOutput<List<SowDTO>> GetDoctorAckSow(Guid doctorId)
{
var list = _doctorService.GetDoctorAckSow(doctorId);
return ResponseOutput.Ok(list);
}
/// <summary>
/// 添加/更新 医生基本信息 BasicInfo
/// </summary>
[HttpPost, Route("addOrUpdateDoctorBasicInfo")]
public IResponseOutput<DoctorBasicInfoCommand> AddOrUpdateDoctorBasicInfo(DoctorBasicInfoCommand addBasicInfoViewModel)
{
var userId = Guid.Parse(User.FindFirst("id").Value);
return _doctorService.AddOrUpdateDoctorBasicInfo(addBasicInfoViewModel, userId);
}
#endregion
#region 医生工作信息 Employment
/// <summary>
/// 详情、编辑-获取医生工作信息 Employment
/// </summary>
/// <param name="doctorId"></param>
/// <returns></returns>
[HttpGet, Route("getEmploymentInfo/{doctorId:Guid}")]
public IResponseOutput<EmploymentDTO> GetDoctorWorkInfoById(Guid doctorId)
{
var doctorInfo = _doctorService.GetEmploymentInfo(doctorId);
return ResponseOutput.Ok(doctorInfo);
}
/// <summary> 更新-医生工作信息 WorkInfo </summary>
[HttpPost, Route("updateEmploymentInfo")]
public IResponseOutput UpdateEmploymentInfoInfo(EmploymentCommand updateEmploymentInfoViewModel)
{
return _doctorService.UpdateDoctorEmploymentInfo(updateEmploymentInfoViewModel);
}
#endregion
#region Reviewer 专业信息
/// <summary> 获取医生专业信息 </summary>
[HttpGet, Route("getSpecialtyInfo/{doctorId:Guid}")]
public IResponseOutput<SpecialtyDTO> GetDoctorSpecialty(Guid doctorId)
{
var doctorInfo = _doctorService.GetDoctorSpecialty(doctorId);
return ResponseOutput.Ok(doctorInfo);
}
/// <summary> 更新专业信息 </summary>
[HttpPost, Route("updateSpecialtyInfo")]
public IResponseOutput UpdateDoctorSpecialty(SpecialtyCommand specialtyUpdateModel)
{
return _doctorService.UpdateDoctorSpecialty(specialtyUpdateModel);
//return new IResponseOutput<string>()
//{
// IsSuccess = success,
// ErrorMessage = success ? "Update Successfully." : "Update Failed."
//};
}
#endregion
#region Reviewer 状态
/// <summary> 获取医生审核状态 </summary>
[HttpGet, Route("getAuditState/{doctorId:guid}")]
public IResponseOutput<ResumeConfirmDTO> GetResumeAuditState([FromServices] IVacationService _vacationService, Guid doctorId)
{
var result = _doctorService.GetDoctorAuditStatus(doctorId);
result.InHoliday = _vacationService.OnVacation(doctorId).IsSuccess;
return ResponseOutput.Ok(result);
}
/// <summary>
/// 审核简历状态
/// </summary>
/// <param name="auditResumeParam">复审状态ReviewStatus 0-未复审1-复审通过2-未通过 </param>
/// <returns></returns>
[LogFilter]
[HttpPost, Route("updateAuditResume")]
public IResponseOutput AuditResume(ResumeConfirmCommand auditResumeParam)
{
var userId = Guid.Parse(User.FindFirst("id").Value);
return _doctorService.AuditResume(auditResumeParam, userId);
}
/// <summary>
/// 获取医生入组信息 正在提交的数量 已同意入组项目个数 正在读的
/// </summary>
[HttpPost, Route("getDoctorIntoGroupInfo/{doctorId:guid}")]
public IResponseOutput<DoctorEnrollInfoDTO> GetDoctorEnrollInfo(Guid doctorId)
{
return ResponseOutput.Ok(_doctorService.GetDoctorEnrollInfo(doctorId));
}
#endregion
#region 医生详情
/// <summary>
/// 获取医生详情
/// </summary>
/// <param name="_vacationService"></param>
/// <param name="doctorId">医生Id</param>
/// <param name="attachmentService"></param>
/// <param name="_educationService"></param>
/// <param name="_trialExperienceService"></param>
/// <param name="_researchPublicationService"></param>
/// <returns></returns>
[HttpGet, Route("getDetail/{doctorId:guid}")]
public IResponseOutput<DoctorDetailDTO> GetDoctorDetail([FromServices] IAttachmentService attachmentService, [FromServices] IEducationService _educationService, [FromServices] ITrialExperienceService _trialExperienceService, [FromServices] IResearchPublicationService _researchPublicationService, [FromServices] IVacationService _vacationService, Guid doctorId)
{
var education = _educationService.GetEducation(doctorId);
var sowList = _doctorService.GetDoctorSow(doctorId);
var ackSowList = _doctorService.GetDoctorAckSow(doctorId);
var doctorDetail = new DoctorDetailDTO
{
AuditView = _doctorService.GetDoctorAuditStatus(doctorId),
BasicInfoView = _doctorService.GetDoctorBasicInfo(doctorId),
EmploymentView = _doctorService.GetEmploymentInfo(doctorId),
AttachmentList = attachmentService.GetAttachments(doctorId),
EducationList = education.EducationList,
PostgraduateList = education.PostgraduateList,
TrialExperienceView = _trialExperienceService.GetTrialExperience(doctorId),
ResearchPublicationView = _researchPublicationService.GetResearchPublication(doctorId),
SpecialtyView = _doctorService.GetDoctorSpecialty(doctorId),
InHoliday = _vacationService.OnVacation(doctorId).IsSuccess,
IntoGroupInfo = _doctorService.GetDoctorEnrollInfo(doctorId),
SowList = sowList,
AckSowList = ackSowList
};
return ResponseOutput.Ok(doctorDetail);
}
#endregion
}
}