|
|
@ -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<VmiMessage>(); |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|