Merge branch 'Test_IRC_Net8' of http://192.168.3.68:2000/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
b8f5f32596
|
@ -2197,7 +2197,7 @@
|
|||
<returns></returns>
|
||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.GeneralCalculateService.GetDataTableFromUpload(Microsoft.AspNetCore.Http.IFormFile)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.GeneralCalculateService.GetDataTableFromUpload(Microsoft.AspNetCore.Http.IFormFile,System.String,System.Guid)">
|
||||
<summary>
|
||||
从上传文件中获取Datatable
|
||||
</summary>
|
||||
|
@ -4840,7 +4840,7 @@
|
|||
<param name="lesionType"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.IGeneralCalculateService.GetDataTableFromUpload(Microsoft.AspNetCore.Http.IFormFile)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.IGeneralCalculateService.GetDataTableFromUpload(Microsoft.AspNetCore.Http.IFormFile,System.String,System.Guid)">
|
||||
<summary>
|
||||
从上传文件中获取Datatable
|
||||
</summary>
|
||||
|
|
|
@ -234,6 +234,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
|||
}
|
||||
}
|
||||
|
||||
public class TemplateData
|
||||
{
|
||||
public string TaskBlindName { get; set; }
|
||||
|
||||
public string SubjectID { get; set; }
|
||||
}
|
||||
|
||||
public class OCTFCTUploadData
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||
using IRaCIS.Core.Domain.Models;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infra.EFCore.Common;
|
||||
using MassTransit;
|
||||
|
@ -6,56 +8,38 @@ using Microsoft.AspNetCore.Http;
|
|||
using Microsoft.Extensions.Logging;
|
||||
using MiniExcelLibs;
|
||||
using System.Data;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||
{
|
||||
public class GeneralCalculateService : BaseService, IGeneralCalculateService
|
||||
public class GeneralCalculateService(IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
ILogger<GeneralCalculateService> _logger,
|
||||
IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository,
|
||||
IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository,
|
||||
IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository,
|
||||
IRepository<InspectionFile> _inspectionFileRepository,
|
||||
IOSSService oSSService
|
||||
) : BaseService, IGeneralCalculateService
|
||||
{
|
||||
|
||||
private readonly IRepository<ReadingTableQuestionAnswer> _readingTableQuestionAnswerRepository;
|
||||
private readonly IRepository<VisitTask> _visitTaskRepository;
|
||||
private readonly IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository;
|
||||
private readonly ILogger<GeneralCalculateService> _logger;
|
||||
private readonly IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository;
|
||||
private readonly IRepository<ReadingTableAnswerRowInfo> _readingTableAnswerRowInfoRepository;
|
||||
private readonly IRepository<ReadingQuestionTrial> _readingQuestionTrialRepository;
|
||||
private readonly IRepository<SubjectVisit> _subjectVisitRepository;
|
||||
private readonly IRepository<TumorAssessment_RECIST1Point1> _tumorAssessmentRepository;
|
||||
private readonly IRepository<ReadingTaskQuestionAnswer> _readingTaskQuestionAnswerRepository;
|
||||
|
||||
public GeneralCalculateService(
|
||||
IRepository<ReadingTableQuestionAnswer> readingTableQuestionAnswerRepository,
|
||||
IRepository<VisitTask> visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> readingQuestionCriterionTrialRepository,
|
||||
ILogger<GeneralCalculateService> logger,
|
||||
IRepository<ReadingTableQuestionTrial> readingTableQuestionTrialRepository,
|
||||
IRepository<ReadingTableAnswerRowInfo> readingTableAnswerRowInfoRepository,
|
||||
IRepository<ReadingQuestionTrial> readingQuestionTrialRepository,
|
||||
IRepository<SubjectVisit> subjectVisitRepository,
|
||||
IRepository<TumorAssessment_RECIST1Point1> tumorAssessmentRepository,
|
||||
IRepository<ReadingTaskQuestionAnswer> readingTaskQuestionAnswerRepository
|
||||
)
|
||||
{
|
||||
this._readingTableQuestionAnswerRepository = readingTableQuestionAnswerRepository;
|
||||
this._visitTaskRepository = visitTaskRepository;
|
||||
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||
this._logger = logger;
|
||||
this._readingTableQuestionTrialRepository = readingTableQuestionTrialRepository;
|
||||
this._readingTableAnswerRowInfoRepository = readingTableAnswerRowInfoRepository;
|
||||
this._readingQuestionTrialRepository = readingQuestionTrialRepository;
|
||||
this._subjectVisitRepository = subjectVisitRepository;
|
||||
this._tumorAssessmentRepository = tumorAssessmentRepository;
|
||||
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 从上传文件中获取Datatable
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public async Task<DataTable> GetDataTableFromUpload(IFormFile file)
|
||||
public async Task<DataTable> GetDataTableFromUpload(IFormFile file,string pathCode,Guid trialId)
|
||||
{
|
||||
|
||||
|
||||
|
||||
DataTable result = new DataTable();
|
||||
var fileFolder = "Upload\\";
|
||||
if (!Directory.Exists(fileFolder))
|
||||
|
@ -66,11 +50,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
var fileName = DateTime.Now.ToString("yyyyMMddHHmmss") +
|
||||
Path.GetExtension(file.FileName);
|
||||
var filePath = Path.Combine(fileFolder, fileName);
|
||||
|
||||
var fileStream = new MemoryStream();
|
||||
try
|
||||
{
|
||||
using (var stream = new FileStream(filePath, FileMode.Create))
|
||||
{
|
||||
file.CopyTo(stream);
|
||||
await stream.CopyToAsync(fileStream);
|
||||
|
||||
stream.Position = 0;
|
||||
result = stream.QueryAsDataTable(useHeaderRow: false);
|
||||
}
|
||||
|
@ -80,6 +68,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
File.Delete(filePath);
|
||||
}
|
||||
|
||||
|
||||
try
|
||||
{
|
||||
var ossRelativePath = await oSSService.UploadToOSSAsync(fileStream, pathCode, file.FileName);
|
||||
await _inspectionFileRepository.AddAsync(new InspectionFile() { FileName = file.FileName, RelativePath = ossRelativePath, TrialId = trialId });
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
File.Delete(filePath);
|
||||
|
||||
// 创建一个要删除的行集合
|
||||
|
|
|
@ -580,9 +580,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x=>x.Subject).FirstNotNullAsync();
|
||||
|
||||
var values = new
|
||||
var values = new TemplateData()
|
||||
{
|
||||
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty()? taskinfo.Subject.Code: taskinfo.BlindSubjectCode,
|
||||
SubjectID = "'" + (taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode),
|
||||
TaskBlindName = taskinfo.TaskBlindName,
|
||||
};
|
||||
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
||||
|
@ -603,11 +603,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
var request = httpContext.HttpContext!.Request;
|
||||
var file = request.Form.Files[0];
|
||||
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
||||
var dataTable =await _generalCalculateService.GetDataTableFromUpload(file);
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
var dataTable =await _generalCalculateService.GetDataTableFromUpload(file, "IVUSTemplate", taskinfo.TrialId);
|
||||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x=>x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
|
||||
|
||||
var values = new
|
||||
var values = new TemplateData()
|
||||
{
|
||||
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
||||
TaskBlindName = taskinfo.TaskBlindName,
|
||||
|
|
|
@ -44,6 +44,6 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
/// <param name="file"></param>
|
||||
/// <returns></returns>
|
||||
Task<DataTable> GetDataTableFromUpload(IFormFile file);
|
||||
Task<DataTable> GetDataTableFromUpload(IFormFile file, string pathCode, Guid trialId);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -447,9 +447,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
public async Task<FileResult> GetOCTFCTTemplate(GetExportTemplateInDto inDto)
|
||||
{
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).FirstNotNullAsync();
|
||||
var values = new
|
||||
var values = new TemplateData()
|
||||
{
|
||||
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
||||
SubjectID = "'" + (taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode),
|
||||
TaskBlindName = taskinfo.TaskBlindName,
|
||||
};
|
||||
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
||||
|
@ -470,11 +470,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
var request = httpContext.HttpContext!.Request;
|
||||
var file = request.Form.Files[0];
|
||||
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
||||
var dataTable = await _generalCalculateService.GetDataTableFromUpload(file);
|
||||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
var dataTable = await _generalCalculateService.GetDataTableFromUpload(file, "OCTFCT", taskinfo.TrialId);
|
||||
|
||||
var values = new
|
||||
|
||||
|
||||
var values = new TemplateData()
|
||||
{
|
||||
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
||||
TaskBlindName = taskinfo.TaskBlindName,
|
||||
|
@ -623,9 +624,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
public async Task<FileResult> GetOCTLipidAngleTemplate(GetExportTemplateInDto inDto)
|
||||
{
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).FirstNotNullAsync();
|
||||
var values = new
|
||||
var values = new TemplateData()
|
||||
{
|
||||
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
||||
SubjectID = "'" + (taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode),
|
||||
TaskBlindName = taskinfo.TaskBlindName,
|
||||
};
|
||||
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
||||
|
@ -646,11 +647,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
var request = httpContext.HttpContext!.Request;
|
||||
var file = request.Form.Files[0];
|
||||
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
||||
var dataTable = await _generalCalculateService.GetDataTableFromUpload(file);
|
||||
|
||||
var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.Subject).Include(x => x.TrialReadingCriterion).FirstNotNullAsync();
|
||||
var dataTable = await _generalCalculateService.GetDataTableFromUpload(file, "OCTLipidAngle", taskinfo.TrialId);
|
||||
|
||||
var values = new
|
||||
|
||||
|
||||
var values = new TemplateData()
|
||||
{
|
||||
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty() ? taskinfo.Subject.Code : taskinfo.BlindSubjectCode,
|
||||
TaskBlindName = taskinfo.TaskBlindName,
|
||||
|
@ -994,7 +996,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
|||
// 平均最小FCT
|
||||
tableAnswers.Add(new ReadingTableQuestionAnswer()
|
||||
{
|
||||
Answer = oCTFCTInfos.Count() == 0 ? "0.00" : GetDigitPlacesData(oCTFCTInfos.Where(x => x.PlaqueNum == item).Average(x => x.Data).ToString()),
|
||||
Answer = oCTFCTInfos.Where(x => x.PlaqueNum == item).Count() == 0 ? "0.00" : GetDigitPlacesData(oCTFCTInfos.Where(x => x.PlaqueNum == item).Average(x => x.Data).ToString()),
|
||||
Id = NewId.NextGuid(),
|
||||
QuestionId = patchDataStatisticsInfo.Id,
|
||||
TrialId = inDto.TrialId,
|
||||
|
|
|
@ -1967,6 +1967,32 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
});
|
||||
}
|
||||
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)))
|
||||
{
|
||||
|
||||
var type = GetEntityAuditOpt(item);
|
||||
|
||||
var entity = item.Entity as NoneDicomStudyFile;
|
||||
|
||||
var extraIdentification = string.Empty;
|
||||
|
||||
if (entity.VisitTaskId!=null)
|
||||
{
|
||||
extraIdentification = "/VisitTask";
|
||||
}
|
||||
|
||||
var trialid = await _dbContext.NoneDicomStudy.Where(x => x.Id == entity.NoneDicomStudyId).Select(x => x.TrialId).FirstOrDefaultAsync();
|
||||
|
||||
|
||||
await InsertInspection<NoneDicomStudyFile>(item.Entity as NoneDicomStudyFile, type, x => new InspectionConvertDTO()
|
||||
{
|
||||
TrialId= trialid,
|
||||
ObjectRelationParentId = x.VisitTaskId,
|
||||
ExtraIndentification = extraIdentification
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// 既往手术史
|
||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(PreviousSurgery)))
|
||||
{
|
||||
|
|
|
@ -108,7 +108,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
|
||||
public bool IsSelfDefine = false;
|
||||
|
||||
// 额外标识
|
||||
/// <summary>
|
||||
/// 额外标识
|
||||
/// </summary>
|
||||
public string ExtraIndentification = string.Empty;
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue