From 8b710e28b5d029707d0a433b942898c35aed9431 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Mon, 4 Dec 2023 16:41:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BA=93=E5=AD=98=E4=BA=8B?= =?UTF-8?q?=E5=8A=A1=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Entities/BQ/VmiAppService.cs | 16 ++- ...ttleAccountApplicationAutoMapperProfile.cs | 4 +- .../Entities/BQ/TED_SAS_INVOICE.cs | 7 ++ .../Entities/BQ/Vmi/VmiBalanceBase.cs | 3 +- .../Entities/BQ/Vmi/VmiLog.cs | 100 +++++++++++++++++- 5 files changed, 124 insertions(+), 6 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 ace474aa..d122b842 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 @@ -75,6 +75,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ private readonly ICurrentUser _currentUser; private readonly ILogger _logger; private readonly TaskJobService _service; + private readonly Volo.Abp.ObjectMapping.IObjectMapper _maper; protected readonly IExcelImportAppService _excelImportService; public VmiAppService(IConfiguration cfg, IServiceProvider serviceProvider, @@ -83,7 +84,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ INormalEfCoreRepository logRepository, INormalEfCoreRepository codeRepository, IBlobContainer fileContainer, - + Volo.Abp.ObjectMapping.IObjectMapper maper, IHubContext hubContext, ICurrentUser currentUser, ILogger logger, @@ -93,6 +94,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ ) { + _maper = maper; this._codeRepository = codeRepository; this._cfg = cfg; this._guidGenerator = guidGenerator; @@ -520,8 +522,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ throw new UserFriendlyException("导出行数超过100W不能导出,请重新录入查询条件导出","400"); } - var content = this.GetContent(entities, "库存事务_"); - await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false); + var dtos = _maper.Map, List>(entities); + + var exportImporter = new ExportImporter(); + var result = await exportImporter.ExcelExporter(dtos).ConfigureAwait(false); + result.ShouldNotBeNull(); + + await _excelImportService.SaveBlobAsync(new SaveExcelImportInputDto { Name = fileName, Content = result }).ConfigureAwait(false); + + //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/SettleAccountApplicationAutoMapperProfile.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs index 44e86d1f..9fc6ba70 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs @@ -13,6 +13,7 @@ using Win.Sfs.SettleAccount.Entities.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Dtos; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; +using Win.Sfs.SettleAccount.Entities.BQ.Vmi; using Win.Sfs.SettleAccount.Entities.CodeSettings; using Win.Sfs.SettleAccount.Entities.Controls; using Win.Sfs.SettleAccount.Entities.Factories; @@ -522,13 +523,14 @@ namespace Win.Sfs.SettleAccount } /// - /// 印度价格 + /// QAD发票 /// private void CreateMapInvoiceSyncQad() { CreateMap(); CreateMap(); CreateMap(); + CreateMap(); } private void CreateMapInvoiceSettledDiff() diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SAS_INVOICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SAS_INVOICE.cs index 133c5c86..5b58221e 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SAS_INVOICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SAS_INVOICE.cs @@ -86,6 +86,13 @@ namespace Win.Sfs.SettleAccount.Entities.BQ [ExporterHeader(DisplayName = "出库数量")] public decimal InvoiceQuatity { get; set; } + /// + /// ERP库位 + /// + [Display(Name = "ERP库位")] + [ExporterHeader(DisplayName = "ERP库位")] + public string Location { get; set; } + /// /// 单价 /// diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs index 2258f63b..a525ba95 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs @@ -1,5 +1,6 @@ using System; using System.ComponentModel.DataAnnotations; +using Magicodes.ExporterAndImporter.Core; using Volo.Abp.Domain.Entities; using Win.Sfs.SettleAccount.Entities.BQ.Syncs; @@ -27,7 +28,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi [Display(Name = "数量", Order = 10)] public decimal Qty { get; set; } - + [ExporterHeader(DisplayName = "发运日期", Format = "yyyy-MM-dd HH:mm:ss")] [Display(Name = "发运日期", Order = 11)] public DateTime? BillTime { get; set; } diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs index 29a4b1bf..5ac71974 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using Magicodes.ExporterAndImporter.Core; using SequentialGuid; +using Win.Sfs.SettleAccount.Entities.BQ.Syncs; namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi { @@ -44,7 +45,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi [ExporterHeader(DisplayName = "变动单号")] [Display(Name = "变动单号", Order = 1)] public string ChangedNumber { get; set; } - [ExporterHeader(DisplayName = "变动时间")] + + [ExporterHeader(DisplayName = "变动时间", Format = "yyyy-MM-dd HH:mm:ss")] [Display(Name = "变动时间", Order = 2)] public DateTime ChangedTime { get; set; } [ExporterHeader(DisplayName = "变动类型")] @@ -60,7 +62,103 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi [Display(Name = "版本", Order = 5)] public int Version { get; set; } public string ConcurrencyStamp { get; set; } + [ExporterHeader(DisplayName = "创建时间", Format = "yyyy-MM-dd HH:mm:ss")] + [Display(Name = "创建时间", Order = 2)] public DateTime CreatedTime { get; set; } + [ExporterHeader(DisplayName = "更新时间", Format = "yyyy-MM-dd HH:mm:ss")] + [Display(Name = "更新时间", Order = 2)] public DateTime UpdatedTime { get; set; } = DateTime.Now; } + + public class VmiLogExportDto + { + [ExporterHeader(DisplayName = "库存事务分类")] + [Display(Name = "库存事务分类", Order = 0)] + public VmiLogType LogType { get; set; } + [ExporterHeader(DisplayName = "变动单号")] + [Display(Name = "变动单号", Order = 1)] + public string ChangedNumber { get; set; } + + [ExporterHeader(DisplayName = "变动时间", Format = "yyyy-MM-dd HH:mm:ss")] + [Display(Name = "变动时间", Order = 2)] + public DateTime ChangedTime { get; set; } + [ExporterHeader(DisplayName = "变动类型")] + [Display(Name = "变动类型", Order = 3)] + public VmiType ChangedType { get; set; } + [ExporterHeader(DisplayName = "变动人")] + [Display(Name = "变动人", Order = 4)] + public string ChangedBy { get; set; } + [ExporterHeader(DisplayName = "库存变动")] + [Display(Name = "库存变动", Order = 5)] + public decimal ChangedQty { get; set; } + [ExporterHeader(DisplayName = "版本")] + [Display(Name = "版本", Order = 5)] + public int Version { get; set; } + [Display(Name = "厂内零件号", Order = 6)] + public string RealPartCode { get; set; }//原始 + + [Display(Name = "客户零件号", Order = 7)] + public string CustPartCode { get; set; } + + [Display(Name = "生产码类型", Order = 8)] + public string CodeType { get; set; } + + [Display(Name = "发货类型", Order = 9)] + public EnumDeliverBjBmpBillType? DeliverBillType { get; set; } + + [Display(Name = "数量", Order = 10)] + public decimal Qty { get; set; } + [ExporterHeader(DisplayName = "发运日期", Format = "yyyy-MM-dd HH:mm:ss")] + [Display(Name = "发运日期", Order = 11)] + public DateTime? BillTime { get; set; } + + [Display(Name = "订单日期", Order = 12)] + public DateTime? AssembleData { get; set; } + + [Display(Name = "ERP库位", Order = 13)] + public string ErpToLoc { get; set; } + + [Display(Name = "EDI顺序号", Order = 14)] + public string Seq { get; set; } + + [Display(Name = "客户订单号", Order = 15)] + public string OrderNum { get; set; } + + [Display(Name = "塑件唯一码", Order = 16)] + public string UniqueCode { get; set; } + + [Display(Name = "EDI总成号", Order = 17)] + public string MatchNumber { get; set; } + + [Display(Name = "PJIS生产顺序号", Order = 18)] + public string PjsNum { get; set; } + + [Display(Name = "实际生产码", Order = 19)] + public string RealCode { get; set; } + + [Display(Name = "配置码", Order = 20)] + public string Configcode { get; set; } + + [Display(Name = "工厂", Order = 21)] + public string factory { get; set; } + + [Display(Name = "发货子类型", Order = 22)] + public EnumDeliverSubBillType? DeliverSubBillType { get; set; } + + [Display(Name = "EDI订单生产码", Order = 23)] + public string VinCode { get; set; } + + [Display(Name = "结算生产码", Order = 24)] + public string SettlementVinCode { get; set; } + + [Display(Name = "结算厂内生产码", Order = 25)] + public string SettlementPartCode { get; set; } + + [Display(Name = "是否补货", Order = 26)] + public bool? IsReplenished { get; set; } + + [Display(Name = "备注", Order = 27)] + public string ReMark { get; set; } + + } }