Browse Source

更新版本

master
zhaoxinyu 10 months ago
parent
commit
08b49d573a
  1. 44
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs

44
code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs

@ -227,7 +227,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
_dbcontext.BulkInsert(billDetails);//插入可结主表
_dbcontext.BulkInsert(billList);//插入可结明细
issucess = true;
transaction.Commit();
}
var flaglist = _dbcontext.Set<BBAC_NOT_SA_DETAIL>().Where(p => p.IsReturn == true).ToList();
foreach (var flag in flaglist)
@ -235,6 +235,7 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
flag.IsReturn = false;
}
_dbcontext.BulkUpdate(flaglist);//插入可结明细
transaction.Commit();
}
catch (Exception)
{
@ -371,48 +372,31 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
_dbcontext.BulkDelete(p_list);//删除不可结数据
_dbcontext.BulkInsert(billDetails);//插入可结明细
_dbcontext.BulkInsert(billList);//插入可结主表
var result = from a in _dbcontext.Set<HBPO_SA_DETAIL>()
join b in _dbcontext.Set<HBPO_CAN_SA_DETAIL>() on new { a.KeyCode, a.BusinessType } equals new { b.KeyCode, b.BusinessType }
where a.Price == 0
select new
{
a,
b.Price
};
foreach (var item in result)
var flaglist = _dbcontext.Set<BBAC_NOT_SA_DETAIL>().Where(p => p.IsReturn == true).ToList();
foreach (var flag in flaglist)
{
item.a.Price = item.Price;
flag.IsReturn = false;
}
var salist = result.Select(p => p.a).ToList();
_dbcontext.BulkUpdate(salist);//更新结算数据
_dbcontext.BulkUpdate(flaglist);//插入可结明细
transaction.Commit();
}
else
{
issucess = false;// 回滚事务
transaction.Rollback();
}
var flaglist = _dbcontext.Set<BBAC_NOT_SA_DETAIL>().Where(p => p.IsReturn == true).ToList();
foreach (var flag in flaglist)
{
flag.IsReturn = false;
}
_dbcontext.BulkUpdate(flaglist);//插入可结明细
}
catch (Exception)
{
var flaglist = _dbcontext.Set<BBAC_NOT_SA_DETAIL>().Where(p => p.IsReturn == true).ToList();
foreach (var flag in flaglist)
{
flag.IsReturn = false;
}
_dbcontext.BulkUpdate(flaglist);//插入可结明细
issucess = false;// 回滚事务
transaction.Rollback();
}
}
if (issucess == true)
{
var result = from a in _dbcontext.Set<BBAC_SA_DETAIL>()
join b in _dbcontext.Set<BBAC_CAN_SA_DETAIL>() on new { a.KeyCode, a.BusinessType } equals new { b.KeyCode, b.BusinessType }
where a.Price == 0

Loading…
Cancel
Save