导入代码修改
parent
721ab8dfd3
commit
b097ca1db3
|
@ -2197,6 +2197,12 @@
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
<exception cref="T:IRaCIS.Core.Infrastructure.BusinessValidationFailedException"></exception>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.GeneralCalculateService.GetDataTableFromUpload(Microsoft.AspNetCore.Http.IFormFile)">
|
||||||
|
<summary>
|
||||||
|
从上传文件中获取Datatable
|
||||||
|
</summary>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.GeneralCalculateService.LogRecord(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto,System.String,IRaCIS.Core.Domain.Share.LesionType)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingCalculate.GeneralCalculateService.LogRecord(IRaCIS.Core.Application.Service.Reading.Dto.ReadingCalculateDto,System.String,IRaCIS.Core.Domain.Share.LesionType)">
|
||||||
<summary>
|
<summary>
|
||||||
添加计算错误日志
|
添加计算错误日志
|
||||||
|
@ -4780,6 +4786,13 @@
|
||||||
<param name="lesionType"></param>
|
<param name="lesionType"></param>
|
||||||
<returns></returns>
|
<returns></returns>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="M:IRaCIS.Core.Application.Service.IGeneralCalculateService.GetDataTableFromUpload(Microsoft.AspNetCore.Http.IFormFile)">
|
||||||
|
<summary>
|
||||||
|
从上传文件中获取Datatable
|
||||||
|
</summary>
|
||||||
|
<param name="file"></param>
|
||||||
|
<returns></returns>
|
||||||
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.IReadingCalculateService.CalculateTask(IRaCIS.Core.Application.Service.Reading.Dto.CalculateTaskInDto)">
|
<member name="M:IRaCIS.Core.Application.Service.IReadingCalculateService.CalculateTask(IRaCIS.Core.Application.Service.Reading.Dto.CalculateTaskInDto)">
|
||||||
<summary>
|
<summary>
|
||||||
自动计算 并修改值
|
自动计算 并修改值
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using MiniExcelLibs;
|
||||||
|
using System.Data;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
@ -46,6 +49,41 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
this._readingTaskQuestionAnswerRepository = readingTaskQuestionAnswerRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从上传文件中获取Datatable
|
||||||
|
/// </summary>
|
||||||
|
/// <returns></returns>
|
||||||
|
public async Task<DataTable> GetDataTableFromUpload(IFormFile file)
|
||||||
|
{
|
||||||
|
DataTable result = new DataTable();
|
||||||
|
var fileFolder = "Upload\\";
|
||||||
|
if (!Directory.Exists(fileFolder))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(fileFolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
var fileName = DateTime.Now.ToString("yyyyMMddHHmmss") +
|
||||||
|
Path.GetExtension(file.FileName);
|
||||||
|
var filePath = Path.Combine(fileFolder, fileName);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
using (var stream = new FileStream(filePath, FileMode.Create))
|
||||||
|
{
|
||||||
|
file.CopyTo(stream);
|
||||||
|
stream.Position = 0;
|
||||||
|
result = stream.QueryAsDataTable(useHeaderRow: false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
File.Delete(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
File.Delete(filePath);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加计算错误日志
|
/// 添加计算错误日志
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -2,7 +2,10 @@
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using MiniExcelLibs;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
@ -45,6 +48,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
this._readingQuestionCriterionTrialRepository = readingQuestionCriterionTrialRepository;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取Service
|
/// 获取Service
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using DocumentFormat.OpenXml.Presentation;
|
||||||
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
|
@ -7,6 +8,7 @@ using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
using Microsoft.IdentityModel.Tokens;
|
using Microsoft.IdentityModel.Tokens;
|
||||||
|
using MiniExcelLibs;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
|
@ -576,7 +578,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
|
|
||||||
var values = new
|
var values = new
|
||||||
{
|
{
|
||||||
SubjectID = taskinfo.BlindSubjectCode.IsNotNullOrEmpty()? taskinfo.Subject.Code: taskinfo.BlindSubjectCode,
|
SubjectID = taskinfo.BlindSubjectCode.IsNullOrEmpty()? taskinfo.Subject.Code: taskinfo.BlindSubjectCode,
|
||||||
TaskBlindName = taskinfo.TaskBlindName,
|
TaskBlindName = taskinfo.TaskBlindName,
|
||||||
};
|
};
|
||||||
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
return await _visitTaskHelpeService.ExportTemplateAsync(new IRaCIS.Application.Contracts.ExportTemplateAsyncDto()
|
||||||
|
@ -595,10 +597,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
public async Task UploadIVUSTemplate()
|
public async Task UploadIVUSTemplate()
|
||||||
{
|
{
|
||||||
var request = httpContext.HttpContext!.Request;
|
var request = httpContext.HttpContext!.Request;
|
||||||
var File = request.Form.Files[0];
|
var file = request.Form.Files[0];
|
||||||
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
Guid visitTaskId = Guid.Parse(request.Form["VisitTaskId"]);
|
||||||
|
var dataTable = _generalCalculateService.GetDataTableFromUpload(file);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
|
@ -36,5 +38,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="lesionType"></param>
|
/// <param name="lesionType"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task LogRecord(ReadingCalculateDto inDto, string lesionName, LesionType lesionType);
|
Task LogRecord(ReadingCalculateDto inDto, string lesionName, LesionType lesionType);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 从上传文件中获取Datatable
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="file"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<DataTable> GetDataTableFromUpload(IFormFile file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using System.Data;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
|
@ -54,5 +56,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Task<object> GetReadingCalculationData(GetReadingCalculationDataInDto inDto);
|
Task<object> GetReadingCalculationData(GetReadingCalculationDataInDto inDto);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue