|
@ -7,7 +7,9 @@ using System.Threading; |
|
|
using System.Threading.Tasks; |
|
|
using System.Threading.Tasks; |
|
|
using EFCore.BulkExtensions; |
|
|
using EFCore.BulkExtensions; |
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax; |
|
|
using Microsoft.CodeAnalysis.CSharp.Syntax; |
|
|
|
|
|
using Newtonsoft.Json; |
|
|
using Nito.AsyncEx; |
|
|
using Nito.AsyncEx; |
|
|
|
|
|
using NPOI.OpenXmlFormats; |
|
|
using NPOI.SS.Formula.Functions; |
|
|
using NPOI.SS.Formula.Functions; |
|
|
using SettleAccount.Bases; |
|
|
using SettleAccount.Bases; |
|
|
using SettleAccount.Domain.BQ; |
|
|
using SettleAccount.Domain.BQ; |
|
@ -15,6 +17,7 @@ using TaskJob.EventArgs; |
|
|
using TaskJob.Interfaces; |
|
|
using TaskJob.Interfaces; |
|
|
using Volo.Abp.Application.Services; |
|
|
using Volo.Abp.Application.Services; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
using Volo.Abp.DependencyInjection; |
|
|
|
|
|
using Volo.Abp.Domain.Entities; |
|
|
using Volo.Abp.Uow; |
|
|
using Volo.Abp.Uow; |
|
|
using Win.Sfs.SettleAccount.Constant; |
|
|
using Win.Sfs.SettleAccount.Constant; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; |
|
|
using Win.Sfs.SettleAccount.Entities.BQ.Vmi; |
|
@ -121,6 +124,10 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
ErpToLoc = string.IsNullOrEmpty(itm.Extend2)?"CC001":itm.Extend2, //寄售库
|
|
|
ErpToLoc = string.IsNullOrEmpty(itm.Extend2)?"CC001":itm.Extend2, //寄售库
|
|
|
}; |
|
|
}; |
|
|
var ls = query.ToList(); |
|
|
var ls = query.ToList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var _first= p_ls.FirstOrDefault(); |
|
|
var _first= p_ls.FirstOrDefault(); |
|
|
using (var transaction =_dbcontext.Database.BeginTransaction()) |
|
|
using (var transaction =_dbcontext.Database.BeginTransaction()) |
|
|
{ |
|
|
{ |
|
@ -132,13 +139,23 @@ public class PendingDeductionService : ApplicationService, ITransientDependency, |
|
|
var count = CalculatePageCount(ls.Count, 2000); |
|
|
var count = CalculatePageCount(ls.Count, 2000); |
|
|
for (int pagenumber = 0; pagenumber < count; pagenumber++) |
|
|
for (int pagenumber = 0; pagenumber < count; pagenumber++) |
|
|
{ |
|
|
{ |
|
|
ls = GetPagedData(ls, pagenumber, 2000); |
|
|
var lst = GetPagedData(ls, pagenumber, 2000); |
|
|
foreach (var item in ls) |
|
|
|
|
|
|
|
|
var messagelist= new List<VmiMessage>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
foreach (var item in lst) |
|
|
{ |
|
|
{ |
|
|
item.SetId(GuidGenerator.Create()); |
|
|
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); |
|
|
Task.Delay(500); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|