From d118479c52c47da88a7ab1b872072e32dd1a4a85 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 30 Aug 2023 09:37:48 +0800 Subject: [PATCH 1/6] update --- .../SettleAccount.HttpApi.Host.csproj | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 @@ + From e38813b366b1adb7d7d9f2bba665b09963e40d33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 30 Aug 2023 09:42:04 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 4 ++-- .../Entities/BQ/Managers/BBAC_PD_MNG.cs | 8 +------- 2 files changed, 3 insertions(+), 9 deletions(-) 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..084be2f4 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.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, From b5d34bbbe66e0c51acaeb0343061aa85e2aef79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Wed, 30 Aug 2023 09:43:11 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/INVOICE_GRP_DTO.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 084be2f4..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,7 +179,7 @@ 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; } From 513f0274bb1cd180848cb1b1da5f098b75b81f26 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 30 Aug 2023 10:03:05 +0800 Subject: [PATCH 4/6] up --- .../Controllers/HomeController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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"; } } From 224ade5492c019a08d28eac1a4a63fad097d6316 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 30 Aug 2023 10:09:49 +0800 Subject: [PATCH 5/6] up --- .../SettleAccount.Application/Entities/BQ/VmiAppService.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; From fb405b28dd3af7b6e1f569d62dccbe0db1f0bcf4 Mon Sep 17 00:00:00 2001 From: wanggang <76527413@qq.com> Date: Wed, 30 Aug 2023 10:39:37 +0800 Subject: [PATCH 6/6] up --- .../host/SettleAccount.HttpApi.Host/Startup.cs | 2 ++ .../ImportExcelCommon/ExportImporter.cs | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) 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 08f12964..05b8e06a 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/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();