diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs index 372d701d..63a05e44 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs @@ -216,17 +216,25 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs _dbcontext.BulkDelete(notlist);//删除不可结数据 _dbcontext.BulkInsert(billDetails);//插入可结主表 _dbcontext.BulkInsert(billList);//插入可结明细 - var flaglist= _dbcontext.Set().Where(p => p.IsReturn == true).ToList(); - foreach (var flag in flaglist) { - flag.IsReturn = false; - } - _dbcontext.BulkUpdate(flaglist);//插入可结明细 + issucess = true; transaction.Commit(); } + var flaglist = _dbcontext.Set().Where(p => p.IsReturn == true).ToList(); + foreach (var flag in flaglist) + { + flag.IsReturn = false; + } + _dbcontext.BulkUpdate(flaglist);//插入可结明细 } catch (Exception) { + var flaglist = _dbcontext.Set().Where(p => p.IsReturn == true).ToList(); + foreach (var flag in flaglist) + { + flag.IsReturn = false; + } + _dbcontext.BulkUpdate(flaglist);//插入可结明细 issucess = false; // 回滚事务 transaction.Rollback(); @@ -362,13 +370,26 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs } else { + issucess = false;// 回滚事务 transaction.Rollback(); } - + var flaglist = _dbcontext.Set().Where(p => p.IsReturn == true).ToList(); + foreach (var flag in flaglist) + { + flag.IsReturn = false; + } + _dbcontext.BulkUpdate(flaglist);//插入可结明细 + } catch (Exception) { + var flaglist = _dbcontext.Set().Where(p => p.IsReturn == true).ToList(); + foreach (var flag in flaglist) + { + flag.IsReturn = false; + } + _dbcontext.BulkUpdate(flaglist);//插入可结明细 issucess = false;// 回滚事务 transaction.Rollback(); } 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 2a957550..21d7a7c5 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 @@ -203,7 +203,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs [UnitOfWork(false)] public void Sync(List p_ls, EnumDeliverBjBmpBillType bussinessType, string p_email, bool flag = true) where T : PD_BASE, new() - { + { var ls=new List(); var invbills=p_ls.Select(p => p.BillNum).ToList();//发票号 var invs=_dbcontext.Set().Where(p => invbills.Contains(p.InvbillNum)).ToList();//所有发票 diff --git a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs index 46f458cc..5615cf69 100644 --- a/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs +++ b/code/src/Modules/SettleAccount/src/SettleAccount.Domain/Entities/BQ/Managers/PUB_NOT_SA_MNG.cs @@ -146,7 +146,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Managers var jit3 = result.Where(p => p.Site == "1041").ToList(); if (jit1.Count > 0) { - notlist.AddRange(jit1); var billNumber = OrderNumberGenerator.GenerateOrderNumber("N"); var entity = new PUB_CAN_SA();