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