Browse Source

修改库存事务导出功能

master
zhouhongjun 1 year ago
parent
commit
8b710e28b5
  1. 16
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/VmiAppService.cs
  2. 4
      code/src/Modules/SettleAccount/src/SettleAccount.Application/SettleAccountApplicationAutoMapperProfile.cs
  3. 7
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/TED_SAS_INVOICE.cs
  4. 3
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs
  5. 100
      code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiLog.cs

16
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 ICurrentUser _currentUser;
private readonly ILogger<VmiAppService> _logger; private readonly ILogger<VmiAppService> _logger;
private readonly TaskJobService _service; private readonly TaskJobService _service;
private readonly Volo.Abp.ObjectMapping.IObjectMapper _maper;
protected readonly IExcelImportAppService _excelImportService; protected readonly IExcelImportAppService _excelImportService;
public VmiAppService(IConfiguration cfg, public VmiAppService(IConfiguration cfg,
IServiceProvider serviceProvider, IServiceProvider serviceProvider,
@ -83,7 +84,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
INormalEfCoreRepository<VmiLog, Guid> logRepository, INormalEfCoreRepository<VmiLog, Guid> logRepository,
INormalEfCoreRepository<CodeSetting, Guid> codeRepository, INormalEfCoreRepository<CodeSetting, Guid> codeRepository,
IBlobContainer<MyFileContainer> fileContainer, IBlobContainer<MyFileContainer> fileContainer,
Volo.Abp.ObjectMapping.IObjectMapper maper,
IHubContext<PageHub> hubContext, IHubContext<PageHub> hubContext,
ICurrentUser currentUser, ICurrentUser currentUser,
ILogger<VmiAppService> logger, ILogger<VmiAppService> logger,
@ -93,6 +94,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
) )
{ {
_maper = maper;
this._codeRepository = codeRepository; this._codeRepository = codeRepository;
this._cfg = cfg; this._cfg = cfg;
this._guidGenerator = guidGenerator; this._guidGenerator = guidGenerator;
@ -520,8 +522,16 @@ namespace Win.Sfs.SettleAccount.Entities.BQ
throw new UserFriendlyException("导出行数超过100W不能导出,请重新录入查询条件导出","400"); throw new UserFriendlyException("导出行数超过100W不能导出,请重新录入查询条件导出","400");
} }
var content = this.GetContent(entities, "库存事务_"); var dtos = _maper.Map<List<VmiLog>, List<VmiLogExportDto>>(entities);
await _fileContainer.SaveAsync(fileName, content, true).ConfigureAwait(false);
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; return fileName;
} }

4
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;
using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ; using Win.Sfs.SettleAccount.Entities.BQ.Dtos.SettleAccount.Domain.BQ;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs; 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.CodeSettings;
using Win.Sfs.SettleAccount.Entities.Controls; using Win.Sfs.SettleAccount.Entities.Controls;
using Win.Sfs.SettleAccount.Entities.Factories; using Win.Sfs.SettleAccount.Entities.Factories;
@ -522,13 +523,14 @@ namespace Win.Sfs.SettleAccount
} }
/// <summary> /// <summary>
/// 印度价格 /// QAD发票
/// </summary> /// </summary>
private void CreateMapInvoiceSyncQad() private void CreateMapInvoiceSyncQad()
{ {
CreateMap<InvoiceSyncQad, InvoiceSyncQadDto>(); CreateMap<InvoiceSyncQad, InvoiceSyncQadDto>();
CreateMap<InvoiceSyncQad, InvoiceSyncQadExportDto>(); CreateMap<InvoiceSyncQad, InvoiceSyncQadExportDto>();
CreateMap<TED_SAS_INVOICE, TED_SAS_INVOICEExportDto>(); CreateMap<TED_SAS_INVOICE, TED_SAS_INVOICEExportDto>();
CreateMap<VmiLog, VmiLogExportDto>();
} }
private void CreateMapInvoiceSettledDiff() private void CreateMapInvoiceSettledDiff()

7
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 = "出库数量")] [ExporterHeader(DisplayName = "出库数量")]
public decimal InvoiceQuatity { get; set; } public decimal InvoiceQuatity { get; set; }
/// <summary>
/// ERP库位
/// </summary>
[Display(Name = "ERP库位")]
[ExporterHeader(DisplayName = "ERP库位")]
public string Location { get; set; }
/// <summary> /// <summary>
/// 单价 /// 单价
/// </summary> /// </summary>

3
code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Vmi/VmiBalanceBase.cs

@ -1,5 +1,6 @@
using System; using System;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs; using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
@ -27,7 +28,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi
[Display(Name = "数量", Order = 10)] [Display(Name = "数量", Order = 10)]
public decimal Qty { get; set; } public decimal Qty { get; set; }
[ExporterHeader(DisplayName = "发运日期", Format = "yyyy-MM-dd HH:mm:ss")]
[Display(Name = "发运日期", Order = 11)] [Display(Name = "发运日期", Order = 11)]
public DateTime? BillTime { get; set; } public DateTime? BillTime { get; set; }

100
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 System.ComponentModel.DataAnnotations;
using Magicodes.ExporterAndImporter.Core; using Magicodes.ExporterAndImporter.Core;
using SequentialGuid; using SequentialGuid;
using Win.Sfs.SettleAccount.Entities.BQ.Syncs;
namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi
{ {
@ -44,7 +45,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi
[ExporterHeader(DisplayName = "变动单号")] [ExporterHeader(DisplayName = "变动单号")]
[Display(Name = "变动单号", Order = 1)] [Display(Name = "变动单号", Order = 1)]
public string ChangedNumber { get; set; } public string ChangedNumber { get; set; }
[ExporterHeader(DisplayName = "变动时间")]
[ExporterHeader(DisplayName = "变动时间", Format = "yyyy-MM-dd HH:mm:ss")]
[Display(Name = "变动时间", Order = 2)] [Display(Name = "变动时间", Order = 2)]
public DateTime ChangedTime { get; set; } public DateTime ChangedTime { get; set; }
[ExporterHeader(DisplayName = "变动类型")] [ExporterHeader(DisplayName = "变动类型")]
@ -60,7 +62,103 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Vmi
[Display(Name = "版本", Order = 5)] [Display(Name = "版本", Order = 5)]
public int Version { get; set; } public int Version { get; set; }
public string ConcurrencyStamp { 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; } 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 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; }
}
} }

Loading…
Cancel
Save