From 8fa9855fab7cb9048bffa18080e2e6e82e3f8b9d Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Fri, 1 Dec 2023 10:44:46 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E5=AF=BC=E5=85=A5=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=8E=A7=E4=BB=B6=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs | 4 ++-- .../Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs | 2 +- .../Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs | 4 ++-- .../Entities/BQ/BBAC_SE_DETAIL_Service.cs | 8 ++++++-- .../SettleAccount.Domain.Shared.csproj | 3 ++- .../src/SettleAccount.Domain/SettleAccount.Domain.csproj | 4 ++-- .../src/SettleAccount.Job/Services/InputService.cs | 2 +- .../src/SettleAccount.Job/SettleAccount.Job.csproj | 4 ++-- 8 files changed, 18 insertions(+), 13 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs index 2529d035..cd6efe92 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_DETAIL_DTO.cs @@ -270,7 +270,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// 发货时间 /// [Display(Name = "发货时间")] - [ExporterHeader(DisplayName = "发货时间")] + [ExporterHeader(DisplayName = "发货时间", Format = "yyyy-MM-dd HH:mm:ss")] public DateTime BillTime { get; set; } /// @@ -285,7 +285,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// [Display(Name = "数量")] [ExporterHeader(DisplayName = "数量")] - public decimal Qty { get; set; } + public int Qty { get; set; } /// /// 排序单号 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs index bf89d3ef..5eff134e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/HBPO_SE_DETAIL_DTO.cs @@ -270,7 +270,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// 发货时间 /// [Display(Name = "发货时间")] - [ExporterHeader(DisplayName = "发货时间")] + [ExporterHeader(DisplayName = "发货时间", Format = "yyyy-MM-dd HH:mm:ss")] public DateTime BillTime { get; set; } /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs index 7f9a0da7..d7a52fe8 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/PUB_SE_DETAIL_DTO.cs @@ -216,7 +216,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// /// 发货时间 /// - [ExporterHeader(DisplayName = "发货时间")] + [ExporterHeader(DisplayName = "发货时间", Format = "yyyy-MM-dd HH:mm:ss")] public DateTime ShippingDate { set; get; } /// /// 发运单号 @@ -264,7 +264,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// 发货时间 /// [Display(Name = "发货时间")] - [ExporterHeader(DisplayName = "发货时间")] + [ExporterHeader(DisplayName = "发货时间", Format = "yyyy-MM-dd HH:mm:ss")] public DateTime BillTime { get; set; } /// /// 订单时间 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs index 2142bc96..58657dec 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/BBAC_SE_DETAIL_Service.cs @@ -1,6 +1,9 @@ using System; using System.Collections.Generic; +using System.IO; using System.Threading.Tasks; +using Magicodes.ExporterAndImporter.Core; +using Magicodes.ExporterAndImporter.Excel; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using SettleAccount.Domain.BQ; @@ -50,12 +53,12 @@ namespace Win.Sfs.SettleAccount.Entities.BQ string fileName = $"JisBBAC发运数据_{Guid.NewGuid()}.xlsx"; var entities = await _repository.GetListByFilterAsync(input.Filters, input.Sorting, int.MaxValue, 0, true).ConfigureAwait(false); var dtos = ObjectMapper.Map, List>(entities); + ExportImporter _exportImporter = new ExportImporter(); var result = await _exportImporter.ExcelExporter(dtos).ConfigureAwait(false); result.ShouldNotBeNull(); - - await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); return fileName; } #endregion @@ -74,5 +77,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ } #endregion + } } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccount.Domain.Shared.csproj b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccount.Domain.Shared.csproj index a263766c..0937a8a7 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccount.Domain.Shared.csproj +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain.Shared/SettleAccount.Domain.Shared.csproj @@ -10,7 +10,8 @@ - + + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccount.Domain.csproj b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccount.Domain.csproj index 59ba8817..fd274007 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccount.Domain.csproj +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/SettleAccount.Domain.csproj @@ -33,8 +33,8 @@ - - + + diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/InputService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/InputService.cs index a87322bf..ab3f4b92 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/InputService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/Services/InputService.cs @@ -26,7 +26,7 @@ namespace SettleAccount.Job.Services } var ImportList = new List(); ExcelImporter _importer = new ExcelImporter(); - var import = _importer.Import(filePath).Result; + var import = _importer.Import(filePath,null,null).Result; if (import.Exception != null) { if (import.Exception.Message.ToString() == "导入文件不存在!") diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccount.Job.csproj b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccount.Job.csproj index 659ddb81..46106c17 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccount.Job.csproj +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Job/SettleAccount.Job.csproj @@ -7,8 +7,8 @@ - - + +