From eaf05a4fd31a4ddad6269d2a092fd6aa8d466ef6 Mon Sep 17 00:00:00 2001 From: zhaoxinyu <89237069@qq.com> Date: Mon, 3 Jun 2024 13:02:43 +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/INVOICE_SERVICE.cs | 46 +++++++++++-------- 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs index f8e0717b..bd4faa1b 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/INVOICE_SERVICE.cs @@ -144,19 +144,29 @@ namespace Win.Sfs.SettleAccount.Entities.BQ var invoiceGrps = _settleAccountDbContext.Set() .Where(t => invbillNums.Contains(t.InvbillNum)); - var invoiceBBACGrps = invoiceGrps.Where(p => p.BusinessType == EnumBusinessType.JisBBAC).Where(t => t.State == SettleBillState.已扣减); + foreach (var itm in invoiceGrps) + { + itm.State = SettleBillState.发票同步中; + } + await _settleAccountDbContext.BulkUpdateAsync(invoiceGrps.ToList()).ConfigureAwait(false); + + + + + + var invoiceBBACGrps = invoiceGrps.Where(p => p.BusinessType == EnumBusinessType.JisBBAC).Where(t => t.State == SettleBillState.发票同步中); var invoicePubGrps = invoiceGrps.Where(p => p.BusinessType != EnumBusinessType.JisBBAC && p.BusinessType != EnumBusinessType.JisHBPO) - .Where(t => t.State == SettleBillState.已扣减); - var invoiceHbpoGrps = invoiceGrps.Where(p => p.BusinessType == EnumBusinessType.JisHBPO).Where(t => t.State == SettleBillState.已扣减); + .Where(t => t.State == SettleBillState.发票同步中); + var invoiceHbpoGrps = invoiceGrps.Where(p => p.BusinessType == EnumBusinessType.JisHBPO).Where(t => t.State == SettleBillState.发票同步中); if (invoiceBBACGrps.Any()) { var invlist = await invoiceBBACGrps.ToListAsync().ConfigureAwait(false); - foreach (var itm in invlist) - { - itm.State = SettleBillState.发票同步中; - } - await _settleAccountDbContext.BulkUpdateAsync(invlist).ConfigureAwait(false); + //foreach (var itm in invlist) + //{ + // itm.State = SettleBillState.发票同步中; + //} + //await _settleAccountDbContext.BulkUpdateAsync(invlist).ConfigureAwait(false); var billinvs=invlist.Select(p => p.InvbillNum).ToList(); @@ -165,11 +175,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (invoicePubGrps.Any()) { var invlist = await invoicePubGrps.ToListAsync().ConfigureAwait(false); - foreach (var itm in invlist) - { - itm.State = SettleBillState.发票同步中; - } - await _settleAccountDbContext.BulkUpdateAsync(invlist).ConfigureAwait(false); + //foreach (var itm in invlist) + //{ + // itm.State = SettleBillState.发票同步中; + //} + //await _settleAccountDbContext.BulkUpdateAsync(invlist).ConfigureAwait(false); var billinvs = invlist.Select(p => p.InvbillNum).ToList(); @@ -178,11 +188,11 @@ namespace Win.Sfs.SettleAccount.Entities.BQ if (invoiceHbpoGrps.Any()) { var invlist = await invoiceHbpoGrps.ToListAsync().ConfigureAwait(false); - foreach (var itm in invlist) - { - itm.State = SettleBillState.发票同步中; - } - await _settleAccountDbContext.BulkUpdateAsync(invlist).ConfigureAwait(false); + //foreach (var itm in invlist) + //{ + // itm.State = SettleBillState.发票同步中; + //} + //await _settleAccountDbContext.BulkUpdateAsync(invlist).ConfigureAwait(false); var billinvs = invlist.Select(p => p.InvbillNum).ToList(); await CreateHBPOTaskAsync(billinvs).ConfigureAwait(false);