增加验证

This commit is contained in:
2022-07-26 13:33:33 +08:00
parent 39844dc8a4
commit c80dd824ed
4 changed files with 14 additions and 9 deletions
@@ -104,6 +104,14 @@ namespace IRaCIS.Application.Services
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> SetEnrollReadingCategory(SetEnrollReadingCategoryInDto inDto)
{
var enroll = await _enrollRepository.FirstAsync(t => t.Id == inDto.EnrollId);
if(_repository.Where<VisitTask>(t=>t.TrialId==enroll.TrialId && t.DoctorUserId==enroll.DoctorUserId ).Any(t=>t.ReadingTaskState != ReadingTaskState.WaitReading))
{
return ResponseOutput.NotOk("已经开始读片,不允许修改阅片类型");
}
await _enrollReadingCategoryRepository.BatchDeleteNoTrackingAsync(x => x.EnrollId == inDto.EnrollId);
List<EnrollReadingCategory> enrollReadings = inDto.ReadingCategorys.Select(x => new EnrollReadingCategory()