任务答案数量验证

This commit is contained in:
he
2026-06-29 15:35:33 +08:00
parent 9362b2fb23
commit 254e9508b6
3 changed files with 88 additions and 14 deletions
@@ -1,6 +1,7 @@
using DocumentFormat.OpenXml;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Helper;
using IRaCIS.Core.Application.Helper.OtherTool;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.Service.ImageAndDoc;
using IRaCIS.Core.Application.Service.Reading.Dto;
@@ -10,6 +11,7 @@ using IRaCIS.Core.Infra.EFCore.Common;
using IRaCIS.Core.Infrastructure;
using MassTransit;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Options;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@@ -68,6 +70,7 @@ namespace IRaCIS.Core.Application.Service
IGeneralCalculateService _generalCalculateService,
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
IRepository<TaskStudy> _taskStudyRepository,
IConfiguration _config,
IDownloadAndUploadService _downloadAndUploadService,
ITrialEmailNoticeConfigService _trialEmailNoticeConfigService,
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, IReadingImageTaskService
@@ -3426,6 +3429,18 @@ namespace IRaCIS.Core.Application.Service
[HttpPost]
public async Task<IResponseOutput> VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto)
{
//// 验证一个问题不能有多个答案
//bool hasDuplicate = await _readingTaskQuestionAnswerRepository
// .Where(x => x.VisitTaskId == inDto.VisitTaskId)
// .GroupBy(x => x.ReadingQuestionTrialId)
// .AnyAsync(g => g.Count() > 1);
//if (hasDuplicate)
//{
// return ResponseOutput.NotOk(_localizer["ReadingImage_BackImageNotExist"]);
//}
//验证后处理影像必须传
if (_visitTaskRepository.Any(t => t.Id == inDto.VisitTaskId && t.TrialReadingCriterion.ImageUploadEnum != ReadingImageUpload.None))
{