修改一版

Uat_Study
he 2022-07-08 14:50:47 +08:00
parent a74d3fc501
commit 691e024322
6 changed files with 70 additions and 0 deletions

View File

@ -460,6 +460,32 @@ namespace IRaCIS.Core.API.Controllers
} }
/// <summary>
/// 上传裁判任务的图像
/// </summary>
/// <param name="trialId"></param>
/// <param name="visitTaskId"></param>
/// <returns></returns>
[HttpPost("VisitTask/UploadMedicalReviewImage/{trialId:guid}/{visitTaskId:guid}")]
[TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput<FileDto>> UploadJudgeTaskImage(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;
});
await _repository.SaveChangesAsync();
return ResponseOutput.Ok(fileDto);
}
/// <summary> /// <summary>
/// 上传医学审核图片 /// 上传医学审核图片
/// </summary> /// </summary>

View File

@ -345,6 +345,33 @@ public static class FileStoreHelper
} }
/// <summary>
/// 通用获取文件路径
/// </summary>
/// <param name="_hostEnvironment"></param>
/// <param name="fileName"></param>
/// <param name="trialId"></param>
/// <param name="id"></param>
/// <param name="type"></param>
/// <returns></returns>
public static (string PhysicalPath, string RelativePath, string FileRealName) GetFilePath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid id,string type)
{
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);
string uploadFolderPath = Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), id.ToString(), type);
if (!Directory.Exists(uploadFolderPath)) Directory.CreateDirectory(uploadFolderPath);
var (trustedFileNameForFileStorage, fileRealName) = FileStoreHelper.GetStoreFileName(fileName);
var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{id}/{type}/{trustedFileNameForFileStorage}";
var serverFilePath = Path.Combine(uploadFolderPath, trustedFileNameForFileStorage);
return (serverFilePath, relativePath, fileRealName);
}
public static (string PhysicalPath, string RelativePath, string FileRealName) GetMedicalReviewImage(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid taskMedicalReviewId) public static (string PhysicalPath, string RelativePath, string FileRealName) GetMedicalReviewImage(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid taskMedicalReviewId)
{ {
var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment);

View File

@ -153,6 +153,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
/// 裁判结果的备注 /// 裁判结果的备注
/// </summary> /// </summary>
public string JudgeResultRemark { get; set; } public string JudgeResultRemark { get; set; }
public string JudgeResultImagePath { get; set; } = string.Empty;
} }
public class GetReadingPastResultListOutDto public class GetReadingPastResultListOutDto
@ -182,6 +185,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
public Guid JudgeResultTaskId { get; set; } public Guid JudgeResultTaskId { get; set; }
public string JudgeResultRemark { get; set; } = string.Empty; public string JudgeResultRemark { get; set; } = string.Empty;
public string JudgeResultImagePath { get; set; } = string.Empty;
} }
public class GetJudgeReadingInfo public class GetJudgeReadingInfo

View File

@ -372,12 +372,14 @@ namespace IRaCIS.Application.Services
x.ReadingTaskState, x.ReadingTaskState,
x.JudgeResultTaskId, x.JudgeResultTaskId,
x.JudgeResultRemark, x.JudgeResultRemark,
x.JudgeResultImagePath,
}).FirstOrDefaultAsync(); }).FirstOrDefaultAsync();
GetJudgeReadingInfoOutDto judgeInfo = new GetJudgeReadingInfoOutDto() GetJudgeReadingInfoOutDto judgeInfo = new GetJudgeReadingInfoOutDto()
{ {
ReadingTaskState = visitTask.ReadingTaskState, ReadingTaskState = visitTask.ReadingTaskState,
JudgeResultTaskId = visitTask.JudgeResultTaskId, JudgeResultTaskId = visitTask.JudgeResultTaskId,
JudgeResultRemark=visitTask.JudgeResultRemark, JudgeResultRemark=visitTask.JudgeResultRemark,
JudgeResultImagePath= JudgeResultImagePath,
VisitTaskInfoList = new List<JudgeReadingInfoDto>() VisitTaskInfoList = new List<JudgeReadingInfoDto>()
}; };
var visitIds = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).Select(x => new var visitIds = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).Select(x => new
@ -415,6 +417,7 @@ namespace IRaCIS.Application.Services
{ {
JudgeResultTaskId = inDto.JudgeResultTaskId, JudgeResultTaskId = inDto.JudgeResultTaskId,
JudgeResultRemark = inDto.JudgeResultRemark, JudgeResultRemark = inDto.JudgeResultRemark,
}); });
var result=await _visitTaskRepository.SaveChangesAsync(); var result=await _visitTaskRepository.SaveChangesAsync();
return ResponseOutput.Ok(result); return ResponseOutput.Ok(result);
@ -434,6 +437,7 @@ namespace IRaCIS.Application.Services
ReadingTaskState = ReadingTaskState.HaveSigned, ReadingTaskState = ReadingTaskState.HaveSigned,
JudgeResultRemark = inDto.JudgeResultRemark, JudgeResultRemark = inDto.JudgeResultRemark,
SignTime = DateTime.Now, SignTime = DateTime.Now,
JudgeResultImagePath=inDto.JudgeResultImagePath,
}); });
var result = await _visitTaskRepository.SaveChangesAsync(); var result = await _visitTaskRepository.SaveChangesAsync();
return ResponseOutput.Ok(result); return ResponseOutput.Ok(result);

View File

@ -152,6 +152,12 @@ namespace IRaCIS.Core.Domain.Models
/// </summary> /// </summary>
public bool? IsGlobalHaveUpdate { get; set; } public bool? IsGlobalHaveUpdate { get; set; }
/// <summary>
/// 裁判结果的图片路径
/// </summary>
public string JudgeResultImagePath { get; set; } = string.Empty;
#region 一致性分析的任务特有数据 #region 一致性分析的任务特有数据
/// <summary> /// <summary>

View File

@ -40,6 +40,8 @@ public static class StaticData
public static readonly string MedicalReview = "MedicalReview"; public static readonly string MedicalReview = "MedicalReview";
public static readonly string JudgeTask = "JudgeTask";
public static readonly string UploadEDCData = "UploadEDCData"; public static readonly string UploadEDCData = "UploadEDCData";
public static readonly string UploadFileFolder = "UploadFile"; public static readonly string UploadFileFolder = "UploadFile";