删除表单数据

IRC_NewDev
he 2023-07-03 14:03:29 +08:00
parent 049c3918a4
commit e2060a1460
2 changed files with 27 additions and 2 deletions

View File

@ -409,13 +409,34 @@ namespace IRaCIS.Core.Application.Service
return ResponseOutput.Ok(true); return ResponseOutput.Ok(true);
} }
/// <summary> /// <summary>
/// 获取CRC确认列表 /// 删除表单数据
/// </summary> /// </summary>
/// <param name="inDto"></param> /// <param name="inDto"></param>
/// <returns></returns> /// <returns></returns>
/// <exception cref="BusinessValidationFailedException"></exception>
[HttpPost] [HttpPost]
public async Task<IResponseOutput> DeleteClinicalForm(DeleteClinicalFormInDto inDto)
{
if (await _readModuleCriterionFromRepository.AnyAsync(x => x.ClinicalFormId == inDto.ClinicalFormId))
{
throw new BusinessValidationFailedException("当前表单已确认,无法删除!");
}
await _clinicalFormRepository.BatchDeleteNoTrackingAsync(x => x.Id == inDto.ClinicalFormId);
await _clinicalQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.ClinicalFormId == inDto.ClinicalFormId);
await _clinicalAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.ClinicalFormId == inDto.ClinicalFormId);
await _clinicalTableAnswerRepository.BatchDeleteNoTrackingAsync(x => x.ClinicalFormId == inDto.ClinicalFormId);
return ResponseOutput.Ok(true);
}
/// <summary>
/// 获取CRC确认列表
/// </summary>
/// <param name="inDto"></param>
/// <returns></returns>
[HttpPost]
public async Task<List<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto) public async Task<List<GetCRCConfirmListOutDto>> GetCRCConfirmList(GetCRCConfirmListInDto inDto)
{ {
List<GetCRCConfirmListOutDto> result = await _readModuleRepository.Where(x => x.TrialId == inDto.TrialId) List<GetCRCConfirmListOutDto> result = await _readModuleRepository.Where(x => x.TrialId == inDto.TrialId)

View File

@ -161,6 +161,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
} }
} }
public class DeleteClinicalFormInDto
{
public Guid ClinicalFormId { get; set; }
}
public class SubmitClinicalFormInDto public class SubmitClinicalFormInDto
{ {
/// <summary> /// <summary>