Browse Source

更新版本

master
赵新宇 1 year ago
parent
commit
4811760e42
  1. 58
      code/src/Modules/SettleAccount/src/SettleAccount.Application/Entities/BQ/Syncs/MakeCanSettlementService.cs

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

@ -57,10 +57,8 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
{
flag.IsReturn = false;
}
_dbcontext.BulkUpdate(flaglist);//插入可结明细
_dbcontext.BulkUpdate(flaglist);//插入可结明细
}
var jis1 = p_list.Where(p => p.Site == "1040").ToList();
var jis2 = p_list.Where(p => p.Site == "1046").ToList();
List<BBAC_NOT_SA_DETAIL> notlist = new List<BBAC_NOT_SA_DETAIL>();
@ -226,8 +224,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
_dbcontext.BulkDelete(notlist);//删除不可结数据
_dbcontext.BulkInsert(billDetails);//插入可结主表
_dbcontext.BulkInsert(billList);//插入可结明细
issucess = true;
}
var flaglist = _dbcontext.Set<BBAC_NOT_SA_DETAIL>().Where(p => p.IsReturn == true).ToList();
foreach (var flag in flaglist)
@ -239,12 +235,6 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
}
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();
@ -252,20 +242,33 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
}
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
select new
{
a,
b.Price
};
foreach (var item in result)
if (billDetails.Count > 0)
{
item.a.Price = item.Price;
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
select new
{
a,
b.Price
};
foreach (var item in result)
{
item.a.Price = item.Price;
}
var salist = result.Select(p => p.a).ToList();
_dbcontext.BulkUpdate(salist);//更新结算数据
}
var salist = result.Select(p => p.a).ToList();
_dbcontext.BulkUpdate(salist);//更新结算数据
}
else
{
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);//插入可结明细
}
}
if (businesstype == "JisHBPO" || businesstype== "MaiDanJianHBPO")
@ -404,6 +407,15 @@ namespace Win.Sfs.SettleAccount.Entities.BQ.Syncs
var salist = result.Select(p => p.a).ToList();
_dbcontext.BulkUpdate(salist);//更新结算数据
}
else
{
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);//插入可结明细
}
}
return id.ToString();

Loading…
Cancel
Save