Commit 99505546 authored by liudong1993's avatar liudong1993

Merge branch 'master' of http://gitlab.oytour.com/Kui2/mall.oytour.com into sdzq-ld

parents 7bf89c5b 93e212e0
......@@ -240,8 +240,7 @@ namespace Mall.Module.Finance
[TransactionCallHandler]
public virtual bool SetFinanceRecord(RB_Finance_Record_Extend model, List<Model.Extend.Product.RB_Goods_OrderDetail_Extend> list )
{
bool flag = false;
bool flag = false;
try
{
int recordId = 0;
......@@ -253,30 +252,28 @@ namespace Mall.Module.Finance
{
model.RecordDetailList.ForEach(x => x.RecordId = recordId);
model.RecordDetailList.ForEach(x => x.FinanceId = model.FinanceId);
financeRecordDetailRepository.InsertBatch(model.RecordDetailList);
}
foreach (var item in model.RecordDetailList)
{
Dictionary<string, object> keyValues = new Dictionary<string, object>();
if (list.Any(x=>x.Id==item.OrderDetailId && x.FinanceType==1)&& list.Any(x => x.Id == item.OrderDetailId && x.FinanceType == 2))
if (list.Any(x => x.Id == item.OrderDetailId && x.FinanceType == 1) && list.Any(x => x.Id == item.OrderDetailId && x.FinanceType == 2))
{
keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Goods_OrderDetail.CostFinanceId),model.FinanceId},
{ nameof(RB_Goods_OrderDetail.FreightFinanceId),model.FinanceId},
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
};
}
else if (list.Any(x => x.Id == item.OrderDetailId && x.FinanceType == 1) && list.Any(x => x.Id == item.OrderDetailId && x.FinanceType ==3))
else if (list.Any(x => x.Id == item.OrderDetailId && x.FinanceType == 1) && list.Any(x => x.Id == item.OrderDetailId && x.FinanceType == 3))
{
keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Goods_OrderDetail.CostFinanceId),model.FinanceId},
{ nameof(RB_Goods_OrderDetail.InsuranceFinanceId),model.FinanceId},
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
};
}
else if (list.Any(x => x.Id == item.OrderDetailId && x.FinanceType == 1))
......@@ -284,8 +281,7 @@ namespace Mall.Module.Finance
keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Goods_OrderDetail.CostFinanceId),model.FinanceId},
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
};
}
else if (list.Any(x => x.Id == item.OrderDetailId && x.FinanceType == 2))
......@@ -293,27 +289,30 @@ namespace Mall.Module.Finance
keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Goods_OrderDetail.FreightFinanceId),model.FinanceId},
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
};
}
else if (list.Any(x => x.Id == item.OrderDetailId && x.FinanceType ==3))
else if (list.Any(x => x.Id == item.OrderDetailId && x.FinanceType == 3))
{
keyValues = new Dictionary<string, object>()
{
{ nameof(RB_Goods_OrderDetail.InsuranceFinanceId),model.FinanceId},
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
{ nameof(RB_Goods_OrderDetail.PaidCostMoney),item.OrderDetailPaid}
};
}
List<WhereHelper> whereHelpers = new List<WhereHelper>() { new WhereHelper()
{
FiledName=nameof(RB_Finance_Configurine_Extend.Id),
FiledValue=item.OrderDetailId,
OperatorEnum=OperatorEnum.Equal
}
};
goods_OrderDetailRepository.Update(keyValues, whereHelpers);
List<WhereHelper> whereHelpers = new List<WhereHelper>()
{
new WhereHelper()
{
FiledName=nameof(RB_Finance_Configurine_Extend.Id),
FiledValue=item.OrderDetailId,
OperatorEnum=OperatorEnum.Equal
}
};
if (keyValues != null && keyValues.Count > 0)
{
goods_OrderDetailRepository.Update(keyValues, whereHelpers);
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment