|
|
@ -36,13 +36,14 @@ using Magicodes.ExporterAndImporter.Core.Filters; |
|
|
|
using OfficeOpenXml.Attributes; |
|
|
|
using Win.Sfs.SettleAccount.Attributes; |
|
|
|
using Magicodes.ExporterAndImporter.Core.Extension; |
|
|
|
using Microsoft.Extensions.DependencyInjection; |
|
|
|
using Volo.Abp.BlobStoring; |
|
|
|
|
|
|
|
namespace Win.Sfs.SettleAccount.ExcelImporter |
|
|
|
{ |
|
|
|
public class ExportImporter |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
public static IServiceProvider ServiceProvider { get; set; } |
|
|
|
|
|
|
|
private readonly IExporter _csvExporter = new Magicodes.ExporterAndImporter.Csv.CsvExporter();//导出CSV
|
|
|
|
private readonly IExcelImporter _importer = new Magicodes.ExporterAndImporter.Excel.ExcelImporter();//导入Excel
|
|
|
@ -51,6 +52,8 @@ namespace Win.Sfs.SettleAccount.ExcelImporter |
|
|
|
public virtual async Task<List<T>> UploadExcelImport<T>([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService) |
|
|
|
where T : class, new() |
|
|
|
{ |
|
|
|
using var fs = ServiceProvider.CreateScope(); |
|
|
|
var fc = fs.ServiceProvider.GetRequiredService<IBlobContainer<MyFileContainer>>(); |
|
|
|
Type type = typeof(T).GetType(); |
|
|
|
var ImportList = new List<T>(); |
|
|
|
ExcelImportResult returnResult = new ExcelImportResult(); |
|
|
|