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);