From 42437a65c6e8a0145bc224ccf44debe1e2eb8eb2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com>
Date: Wed, 30 Aug 2023 17:11:02 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=89=88=E6=9C=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Entities/BQ/Dtos/BBAC_SE_EDI_DTO.cs | 4 +--
.../BQ/Syncs/PendingDeductionService.cs | 25 ++++++++++++++++---
2 files changed, 23 insertions(+), 6 deletions(-)
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);
}
}