diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Controllers/HomeController.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Controllers/HomeController.cs index 0f6d0f2f..95831263 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Controllers/HomeController.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Controllers/HomeController.cs @@ -1,4 +1,4 @@ -using System; +using System.IO; using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.SignalR; @@ -19,12 +19,12 @@ namespace Win.Sfs.SettleAccount.Controllers [ResponseCache(NoStore = true)] public ActionResult Index() { - return File("~/index.html", "text/html"); + return File(System.IO.File.ReadAllBytes(Path.Combine(Directory.GetCurrentDirectory(), "wwwroot", "index.html")), "text/html"); } public async Task Test(int seconds) { - await Task.Delay(seconds*1000).ConfigureAwait(false); + await Task.Delay(seconds * 1000).ConfigureAwait(false); return "ok"; } } diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj index c826b496..fad77652 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/SettleAccount.HttpApi.Host.csproj @@ -1,4 +1,4 @@ - + @@ -13,7 +13,15 @@ en;zh-Hans false - + False + ../libraries + ./libraries + False + False + False + True + Info + https://gitee.com/liesauer/HostFXRPatcher @@ -29,6 +37,7 @@ + diff --git a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs index 9711eff4..1c6494da 100644 --- a/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs +++ b/code/src/Modules/SettleAccount/host/SettleAccount.HttpApi.Host/Startup.cs @@ -17,6 +17,7 @@ using SettleAccount.Job.SignalR; //using ShardingCore; using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; +using Win.Sfs.SettleAccount.ExcelImporter; namespace Win.Sfs.SettleAccount; @@ -73,6 +74,7 @@ public class Startup public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { + ExportImporter.ServiceProvider = app.ApplicationServices; app.UseCors("Default"); app.UseResponseCompression(); app.UseRouting(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs index 7a42c764..a0f196a5 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/INVOICE_GRP_DTO.cs @@ -179,12 +179,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos public decimal Tax { get; set; } - [ImporterHeader(Name = "客户号", FixAllSpace = true)] + [ImporterHeader(Name = "客户编码", FixAllSpace = true)] [Required(ErrorMessage = "{0}是必填项")] public string ClientCode { get; set; } - [ImporterHeader(Name = "金税发票金额", FixAllSpace = true)] + [ImporterHeader(Name = "税后金额", FixAllSpace = true)] [Required(ErrorMessage = "{0}是必填项")] public decimal RealAmt { get; set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs index 78b66ae9..ae05f3df 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs @@ -162,7 +162,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran public async Task BalanceExport(RequestDto input) { var entities = await _balanceRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); - var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx"; + var fileName = $"库存余额_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; var content = this.GetContent(entities, "库存备份"); await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); return fileName; @@ -296,7 +296,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran public async Task LogExport(RequestDto input) { var entities = await _logRepository.GetListByFilterAsync(input.Filters, input.Sorting, input.MaxResultCount, input.SkipCount).ConfigureAwait(false); - var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx"; + var fileName = $"库存事务_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; var content = this.GetContent(entities, "库存事务_"); await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); return fileName; @@ -310,7 +310,7 @@ public class VmiAppService : Controller, IApplicationService, IJobService, ITran { var entities = await _logRepository.GetListByFilterAsync(input.Filters).ConfigureAwait(false); //IQueryable query = _logRepository.WhereIf(input.Filters?.Count != 0, input.Filters.ToLambda()); - var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH:mm:ss")}.xlsx"; + var fileName = $"补货数据_{DateTime.Now.ToString("yyyy-MM-dd_HH-mm-ss")}.xlsx"; var content = this.GetContent(entities, "补货数据_"); await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); return fileName; diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs index 8110cc2b..04a31bae 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/ImportExcelCommon/ExportImporter.cs @@ -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> UploadExcelImport([FromForm] IFormFileCollection files, IExcelImportAppService _excelImportService) where T : class, new() { + using var fs = ServiceProvider.CreateScope(); + var fc = fs.ServiceProvider.GetRequiredService>(); Type type = typeof(T).GetType(); var ImportList = new List(); ExcelImportResult returnResult = new ExcelImportResult(); diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs index 5373087e..6ca0ec22 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/BBAC_PD_MNG.cs @@ -13,16 +13,10 @@ using Volo.Abp.Domain.Services; using Win.Sfs.Shared.RepositoryBase; namespace Win.Sfs.SettleAccount.Entities.BQ.Managers; -public class BBAC_PD_MNG:DomainService - - +public class BBAC_PD_MNG:DomainService { - private readonly INormalEfCoreRepository _repository; private readonly INormalEfCoreRepository _detailRepository; - - - protected BBAC_PD_MNG( INormalEfCoreRepository repository,