@@ -1,11 +1,16 @@
|
||||
using DocumentFormat.OpenXml.Office2010.ExcelAc;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Application.Interfaces;
|
||||
using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson;
|
||||
using IRaCIS.Core.Application.Filter;
|
||||
using IRaCIS.Core.Application.ViewModel;
|
||||
using IRaCIS.Core.Domain.Share;
|
||||
using IRaCIS.Core.Infrastructure;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using MiniExcelLibs;
|
||||
using System.ComponentModel.Design;
|
||||
|
||||
namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
@@ -485,22 +490,21 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
|
||||
[HttpGet("{visitPlanInfluenceStatId:guid}")]
|
||||
public async Task<IActionResult> DownloadInflunceStudyList(Guid visitPlanInfluenceStatId)
|
||||
public async Task<IActionResult> DownloadInflunceStudyList(Guid visitPlanInfluenceStatId,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository, [FromServices] IWebHostEnvironment _hostEnvironment, [FromServices] IRaCIS.Application.Interfaces.IDictionaryService _dictionaryService)
|
||||
{
|
||||
var list = _influnceRepository.Where(t => t.VisitPlanInfluenceStatId == visitPlanInfluenceStatId)
|
||||
.ProjectTo<VisitPlanInfluenceSubjectVisitDTO>(_mapper.ConfigurationProvider).ToList();
|
||||
|
||||
var memoryStream = new MemoryStream();
|
||||
memoryStream.SaveAs(list);
|
||||
memoryStream.Seek(0, SeekOrigin.Begin);
|
||||
return new FileStreamResult(memoryStream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
|
||||
{
|
||||
FileDownloadName = _localizer["VisitPlan_CheckExport", DateTime.Now.ToString("yyyy-MM-dd:hh:mm:ss")]
|
||||
};
|
||||
|
||||
var exportInfo = new ExcelExportInfo();
|
||||
|
||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialVisit_InfluenceStudys_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(VisitPlanInfluenceSubjectVisitDTO));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user