This commit is contained in:
he
2023-01-10 14:08:24 +08:00
parent 744229da06
commit d78e5469b2
6 changed files with 181 additions and 3 deletions
@@ -677,6 +677,60 @@ namespace IRaCIS.Application.Contracts
public string BlindPublications { get; set; }
}
public class DeleteDoctorCriterionFile
{
public Guid Id { get; set; }
}
public class AddDoctorCriterionFileDto
{
/// <summary>
/// 文件名称
/// </summary>
public string FileName { get; set; }
/// <summary>
/// 文件路径
/// </summary>
public string FilePath { get; set; }
/// <summary>
/// 标准类型
/// </summary>
public CriterionType CriterionType { get; set; }
/// <summary>
/// 医生Id
/// </summary>
public Guid DoctorId { get; set; }
/// <summary>
/// 备注
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 文件类型
/// </summary>
public CriterionFileType FileType { get; set; }
}
public class GetDoctorCriterionFileInDto
{
public Guid DoctorId { get; set; }
/// <summary>
/// 文件类型
/// </summary>
public CriterionFileType? FileType { get; set; }
/// <summary>
/// 标准类型
/// </summary>
public CriterionType? CriterionType { get; set; }
}
public class ResumeConfirmDTO
{
@@ -16,6 +16,7 @@ namespace IRaCIS.Application.Services
private readonly IRepository<Enroll> _enrollRepository;
private readonly IRepository<DoctorDictionary> _doctorDictionaryRepository;
private readonly IRepository<Attachment> _attachmentRepository;
private readonly IRepository<DoctorCriterionFile> _doctorCriterionFileRepository;
private readonly IRepository<UserDoctor> _userDoctorRepository;
private readonly IRepository<Trial> _trialRepository;
private readonly IRepository<TrialPaymentPrice> _trialExtRepository;
@@ -28,6 +29,7 @@ namespace IRaCIS.Application.Services
IRepository<Message> sysMessageRepository, IRepository<Enroll> intoGroupRepository,
IRepository<DoctorDictionary> doctorDictionaryRepository,
IRepository<Attachment> attachmentRepository,
IRepository<DoctorCriterionFile> doctorCriterionFileRepository,
IRepository<UserDoctor> userDoctorRepository,
IRepository<Trial> trialRepository,
IRepository<TrialPaymentPrice> trialExtRepository, IRepository<Vacation> vacationRepository)
@@ -37,6 +39,7 @@ namespace IRaCIS.Application.Services
_enrollRepository = intoGroupRepository;
_doctorDictionaryRepository = doctorDictionaryRepository;
_attachmentRepository = attachmentRepository;
this._doctorCriterionFileRepository = doctorCriterionFileRepository;
_userDoctorRepository = userDoctorRepository;
_trialRepository = trialRepository;
_trialExtRepository = trialExtRepository;
@@ -467,7 +470,48 @@ namespace IRaCIS.Application.Services
return ResponseOutput.Result(success);
}
/// <summary>
/// 添加医生标准文件
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> AddDoctorCriterionFile(AddDoctorCriterionFileDto inDto)
{
var entity = await _doctorCriterionFileRepository.InsertOrUpdateAsync(inDto, true);
return ResponseOutput.Ok(entity.Id.ToString());
}
/// <summary>
/// 删除医生标准文件
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<IResponseOutput> DeleteDoctorCriterionFile(DeleteDoctorCriterionFile inDto)
{
var result = await _doctorCriterionFileRepository.DeleteFromQueryAsync(inDto.Id, true);
return ResponseOutput.Ok(result.Id.ToString());
}
/// <summary>
/// 获取医生标准文件
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<DoctorCriterionFile>> GetDoctorCriterionFile(GetDoctorCriterionFileInDto inDto)
{
var result = await _doctorCriterionFileRepository.Where(x => x.DoctorId == inDto.DoctorId)
.WhereIf(inDto.CriterionType != null, x => x.CriterionType == inDto.CriterionType)
.WhereIf(inDto.FileType != null, x => x.FileType == inDto.FileType)
.ToListAsync();
return result;
}
[HttpGet("{doctorId:guid}")]
public async Task<ResumeConfirmDTO> GetAuditState(Guid doctorId)
{
@@ -33,7 +33,7 @@ namespace IRaCIS.Core.Application.Service
CreateMap<ReviewerAckDTO, Attachment>().EqualityComparison((odto, o) => odto.Id == o.Id);
CreateMap<AddDoctorCriterionFileDto, DoctorCriterionFile>();
CreateMap<Doctor, DoctorBasicInfoCommand>();
CreateMap<Education, EducationInfoViewModel>();