From 096b4cad73a2a24ba57aff9444a11a6b7cceebe9 Mon Sep 17 00:00:00 2001 From: zhouhongjun <565221961@qq.com> Date: Mon, 27 Nov 2023 17:29:13 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=89=E5=8F=91=E8=BF=90=E6=9C=89=E9=80=80?= =?UTF-8?q?=E8=B4=A7=EF=BC=8C=E6=AF=94=E5=AF=B9=E7=BB=93=E6=9E=9C=E5=B7=AE?= =?UTF-8?q?=E5=BC=82=E8=AF=B4=E6=98=8E=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BQ/Syncs/JisBBACSeEdiCompareAppService.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs index ae0d3281..8a82159f 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/JisBBACSeEdiCompareAppService.cs @@ -5,9 +5,11 @@ using Coravel.Invocable; using EFCore.BulkExtensions; using LinqToDB; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.DependencyInjection; using SettleAccount.Domain.BQ; using Volo.Abp.Application.Services; +using Win.Sfs.SettleAccount.Entities.BQ.Vmi; namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { @@ -42,6 +44,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs using var serviceScope = _serviceProvider.CreateScope(); var db = serviceScope.ServiceProvider.GetRequiredService(); + + await HandDelEdiDataAsync().ConfigureAwait(false); var seDetailGroup = db.Set() @@ -90,7 +94,17 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs { await transaction.RollbackAsync().ConfigureAwait(false); } + + } + //var ediReturnQuery = db.Set().FromSqlRaw("SELECT a.* FROM Set_BBAC_SE_DETAIL a right join (SELECT PN,CustomerPartCodeNoSpace,sum(Qty) as Qty FROM Set_BBAC_SE_DETAIL group by PN,CustomerPartCodeNoSpace having sum(Qty)=0) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace"); + var ediReturnQuery = db.Set().FromSqlRaw("select * from (SELECT a.* FROM [dbo].[Set_BBAC_SE_EDI] a right join (SELECT PN,CustomerPartCodeNoSpace,sum(Qty) as Qty FROM Set_BBAC_SE_DETAIL group by PN,CustomerPartCodeNoSpace having sum(Qty)=0) b on a.PN=b.PN and a.CustomerPartCodeNoSpace=b.CustomerPartCodeNoSpace and a.IsHaveSeData=1) c where c.id is not null"); + var ediReturnEntities = ediReturnQuery.ToList(); + if(ediReturnEntities.Count>0) + { + ediReturnEntities.ForEach(t => t.IsHaveSeData = false); + await db.BulkUpdateAsync(ediReturnEntities).ConfigureAwait(false); } + } ///