From fe5050a4616c78a4c9b5a5c15be634a0df78d222 Mon Sep 17 00:00:00 2001
From: he <10978375@qq.com>
Date: Wed, 3 Aug 2022 11:47:08 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E7=89=88?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Controllers/UploadDownLoadController.cs | 24 +++++++++++++++++++
.../Service/Reading/ReadModuleService.cs | 2 +-
.../Reading/ReadingPeriodSetService.cs | 2 +-
IRaCIS.Core.Domain/_Config/_StaticData.cs | 2 ++
4 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs
index 3bf6cf68..b69eb7eb 100644
--- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs
+++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs
@@ -460,6 +460,30 @@ namespace IRaCIS.Core.API.Controllers
}
+ ///
+ /// 上传Reading问题的图像
+ ///
+ ///
+ ///
+ ///
+ [HttpPost("VisitTask/UploadReadingAnswerImage/{trialId:guid}/{visitTaskId:guid}")]
+ [TypeFilter(typeof(TrialResourceFilter))]
+ public async Task> UploadReadingAnswerImage(Guid trialId, Guid visitTaskId)
+ {
+
+ FileDto fileDto = new FileDto();
+ await FileUploadAsync(async (fileName) =>
+ {
+ var (serverFilePath, relativePath, fileRealName) = FileStoreHelper.GetFilePath(_hostEnvironment, fileName, trialId, visitTaskId, StaticData.Folder.JudgeTask);
+ fileDto.Path = relativePath;
+ fileDto.FileName = fileName;
+ return serverFilePath;
+ });
+
+
+ return ResponseOutput.Ok(fileDto);
+ }
+
///
/// 上传裁判任务的图像
///
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs
index 38f5a6a1..bdee9d97 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadModuleService.cs
@@ -389,7 +389,7 @@ namespace IRaCIS.Application.Services
var globalModule = await _readModuleRepository.Where(x => x.SubjectId == readModuleData.SubjectId && x.SubjectVisitId == readModuleData.SubjectVisitId&& x.ModuleType == ModuleTypeEnum.Global).FirstOrDefaultAsync();
if (globalModule != null)
{
- var globalTaskInfoList = await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalModule.Id && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned).ToListAsync();
+ var globalTaskInfoList = await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalModule.Id && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned&&!x.IsAnalysisCreate).ToListAsync();
if (globalTaskInfoList.Count() > 0 && globalTaskInfoList.Count == (int)trialInfo.ReadingType)
{
diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs
index 6b40bf4a..0f1dc8ca 100644
--- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs
+++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriodSetService.cs
@@ -381,7 +381,7 @@ namespace IRaCIS.Application.Services
var globalModuleIds = await _readModuleRepository.Where(x => subjectVisitIds.Contains(x.SubjectVisitId) && x.ModuleType == ModuleTypeEnum.Global).Select(x => x.Id).ToListAsync();
- var globalTaskInfo = await _visitTaskRepository.Where(x => globalModuleIds.Contains(x.SouceReadModuleId ?? default(Guid)) && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned).GroupBy(x=> new { x.SouceReadModuleId }).Select(x =>
+ var globalTaskInfo = await _visitTaskRepository.Where(x => globalModuleIds.Contains(x.SouceReadModuleId ?? default(Guid)) && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned&&!x.IsAnalysisCreate).GroupBy(x=> new { x.SouceReadModuleId }).Select(x =>
new {
SouceReadModuleId=x.Key.SouceReadModuleId,
Count=x.ToList().Count,
diff --git a/IRaCIS.Core.Domain/_Config/_StaticData.cs b/IRaCIS.Core.Domain/_Config/_StaticData.cs
index ce7140dd..7e6e7846 100644
--- a/IRaCIS.Core.Domain/_Config/_StaticData.cs
+++ b/IRaCIS.Core.Domain/_Config/_StaticData.cs
@@ -42,6 +42,8 @@ public static class StaticData
public static readonly string JudgeTask = "JudgeTask";
+ public static readonly string ReadingAnswer = "ReadingAnswer";
+
public static readonly string UploadEDCData = "UploadEDCData";
public static readonly string UploadFileFolder = "UploadFile";