|
@ -915,23 +915,27 @@ namespace BBWY.Server.Business |
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
#region 计算成本
|
|
|
#region 计算成本
|
|
|
orderCost = new OrderCost() |
|
|
//当具备订单明细成本的时候,才为其创建订单成本
|
|
|
|
|
|
if (insertOrderCostDetailList.Any(iocd => iocd.OrderId == orderId)) |
|
|
{ |
|
|
{ |
|
|
OrderId = orderId, |
|
|
orderCost = new OrderCost() |
|
|
PlatformCommissionRatio = platformCommissionRatio, |
|
|
{ |
|
|
PreferentialAmount = (dbOrderTotal?.TotalPingTaiChengDanYouHuiQuan) ?? dbOrder.PreferentialAmount, |
|
|
OrderId = orderId, |
|
|
Profit = 0, |
|
|
PlatformCommissionRatio = platformCommissionRatio, |
|
|
PurchaseAmount = orderCostPurchaseAmount, |
|
|
PreferentialAmount = (dbOrderTotal?.TotalPingTaiChengDanYouHuiQuan) ?? dbOrder.PreferentialAmount, |
|
|
DeliveryExpressFreight = orderDeliveryExpressFreight, |
|
|
Profit = 0, |
|
|
CreateTime = DateTime.Now, |
|
|
PurchaseAmount = orderCostPurchaseAmount, |
|
|
IsEstimateCost = false |
|
|
DeliveryExpressFreight = orderDeliveryExpressFreight, |
|
|
}; |
|
|
CreateTime = DateTime.Now, |
|
|
if (dbOrder.OrderTotalPrice != 0) |
|
|
IsEstimateCost = false |
|
|
orderCost.CalculationOrderProfitAndCost(dbOrder, null); |
|
|
}; |
|
|
else |
|
|
if (dbOrder.OrderTotalPrice != 0) |
|
|
orderCost.CalculationOrderProfitAndCost(actualAmount, null); |
|
|
orderCost.CalculationOrderProfitAndCost(dbOrder, null); |
|
|
|
|
|
else |
|
|
insertOrderCostList.Add(orderCost); |
|
|
orderCost.CalculationOrderProfitAndCost(actualAmount, null); |
|
|
|
|
|
|
|
|
|
|
|
insertOrderCostList.Add(orderCost); |
|
|
|
|
|
} |
|
|
#endregion
|
|
|
#endregion
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|