diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs index d401f7fe..d422a3e6 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application.Contracts/Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs @@ -20,7 +20,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// 期间 /// [Display(Name = "期间")] - public string Version { get; set; } + public int Version { get; set; } /// /// 零件号 @@ -85,7 +85,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Dtos /// [Display(Name = "期间")] [ExporterHeader(DisplayName = "期间")] - public string Version { get; set; } + public int Version { get; set; } /// /// 零件号 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs index e2227e82..2aab0692 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/PendingDeductionService.cs @@ -7,7 +7,9 @@ using System.Threading; using System.Threading.Tasks; using EFCore.BulkExtensions; using Microsoft.CodeAnalysis.CSharp.Syntax; +using Newtonsoft.Json; using Nito.AsyncEx; +using NPOI.OpenXmlFormats; using NPOI.SS.Formula.Functions; using SettleAccount.Bases; using SettleAccount.Domain.BQ; @@ -15,6 +17,7 @@ using TaskJob.EventArgs; using TaskJob.Interfaces; using Volo.Abp.Application.Services; using Volo.Abp.DependencyInjection; +using Volo.Abp.Domain.Entities; using Volo.Abp.Uow; using Win.Sfs.SettleAccount.Constant; using Win.Sfs.SettleAccount.Entities.BQ.Vmi; @@ -121,6 +124,10 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, ErpToLoc = string.IsNullOrEmpty(itm.Extend2)?"CC001":itm.Extend2, //寄售库 }; var ls = query.ToList(); + + + + var _first= p_ls.FirstOrDefault(); using (var transaction =_dbcontext.Database.BeginTransaction()) { @@ -132,13 +139,23 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, var count = CalculatePageCount(ls.Count, 2000); for (int pagenumber = 0; pagenumber < count; pagenumber++) { - ls = GetPagedData(ls, pagenumber, 2000); - foreach (var item in ls) + var lst = GetPagedData(ls, pagenumber, 2000); + + var messagelist= new List(); + + + foreach (var item in lst) { item.SetId(GuidGenerator.Create()); - + + var message = new VmiMessage(Guid.NewGuid()) + { + Message = System.Text.Json.JsonSerializer.Serialize(item), + }; + messagelist.Add(message); } - _dbcontext.BulkInsert(ls); + _dbcontext.BulkInsert(messagelist); + _dbcontext.BulkInsert(lst,new BulkConfig() { }); Task.Delay(500); } }