|
@ -2465,21 +2465,21 @@ namespace BBWYB.Server.Business |
|
|
|
|
|
|
|
|
#region 订单sku平价
|
|
|
#region 订单sku平价
|
|
|
var orderSku = dbOrderSkus.FirstOrDefault(osku => osku.SkuId == belongSkuId); |
|
|
var orderSku = dbOrderSkus.FirstOrDefault(osku => osku.SkuId == belongSkuId); |
|
|
if (isEditOrderPrice) |
|
|
//if (isEditOrderPrice)
|
|
|
{ |
|
|
//{
|
|
|
orderSku.Price = currentOrderSkuProductAmount / orderSku.ItemTotal; |
|
|
// orderSku.Price = currentOrderSkuProductAmount / orderSku.ItemTotal;
|
|
|
orderSku.BuyerPayFreight = currentPurchaseFreight; |
|
|
// orderSku.BuyerPayFreight = currentPurchaseFreight;
|
|
|
op_EditPriceSkuRequests.Add(new OP_EditPriceSkuRequest() |
|
|
// op_EditPriceSkuRequests.Add(new OP_EditPriceSkuRequest()
|
|
|
{ |
|
|
// {
|
|
|
Freight = currentPurchaseFreight ?? 0M, |
|
|
// Freight = currentPurchaseFreight ?? 0M,
|
|
|
InPackAmountPrice = orderSku.InPackAmount ?? 0M, |
|
|
// InPackAmountPrice = orderSku.InPackAmount ?? 0M,
|
|
|
OrderSkuId = orderSku.Id.ToString(), |
|
|
// OrderSkuId = orderSku.Id.ToString(),
|
|
|
Price = orderSku.Price ?? 0M, |
|
|
// Price = orderSku.Price ?? 0M,
|
|
|
SkuId = orderSku.SkuId |
|
|
// SkuId = orderSku.SkuId
|
|
|
}); |
|
|
// });
|
|
|
updateOrderSkuList.Add(fsql.Update<OrderSku>(orderSku.Id).Set(osku => osku.Price, orderSku.Price) |
|
|
// updateOrderSkuList.Add(fsql.Update<OrderSku>(orderSku.Id).Set(osku => osku.Price, orderSku.Price)
|
|
|
.Set(osku => osku.BuyerPayFreight, orderSku.BuyerPayFreight)); |
|
|
// .Set(osku => osku.BuyerPayFreight, orderSku.BuyerPayFreight));
|
|
|
} |
|
|
//}
|
|
|
#endregion
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
var dbOrderSkuDetail = dbOrderCostDetails.FirstOrDefault(ocd => ocd.SkuId == belongSkuId && ocd.PurchaseOrderId == opi.PurchaseOrderId); |
|
|
var dbOrderSkuDetail = dbOrderCostDetails.FirstOrDefault(ocd => ocd.SkuId == belongSkuId && ocd.PurchaseOrderId == opi.PurchaseOrderId); |
|
@ -2493,15 +2493,15 @@ namespace BBWYB.Server.Business |
|
|
updateOrderCostDetailList.Add(fsql.Update<OrderCostDetail>().SetSource(dbOrderSkuDetail)); |
|
|
updateOrderCostDetailList.Add(fsql.Update<OrderCostDetail>().SetSource(dbOrderSkuDetail)); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (isEditOrderPrice) |
|
|
//if (isEditOrderPrice)
|
|
|
{ |
|
|
//{
|
|
|
dbOrder.OrderTotalPrice = totalPurchaseProductAmount + totalPurchaseFreight; |
|
|
// dbOrder.OrderTotalPrice = totalPurchaseProductAmount + totalPurchaseFreight;
|
|
|
dbOrder.OrderSellerPrice = totalPurchaseProductAmount; |
|
|
// dbOrder.OrderSellerPrice = totalPurchaseProductAmount;
|
|
|
dbOrder.FreightPrice = totalPurchaseFreight; |
|
|
// dbOrder.FreightPrice = totalPurchaseFreight;
|
|
|
updateOrder = fsql.Update<Order>(dbOrder.Id).Set(o => o.OrderTotalPrice, dbOrder.OrderTotalPrice) |
|
|
// updateOrder = fsql.Update<Order>(dbOrder.Id).Set(o => o.OrderTotalPrice, dbOrder.OrderTotalPrice)
|
|
|
.Set(o => o.OrderSellerPrice, dbOrder.OrderSellerPrice) |
|
|
// .Set(o => o.OrderSellerPrice, dbOrder.OrderSellerPrice)
|
|
|
.Set(o => o.FreightPrice, dbOrder.FreightPrice); |
|
|
// .Set(o => o.FreightPrice, dbOrder.FreightPrice);
|
|
|
} |
|
|
//}
|
|
|
|
|
|
|
|
|
dbOrderCost.CalculationOrderCostCostAndProfit(dbOrder.OrderTotalPrice ?? 0M, |
|
|
dbOrderCost.CalculationOrderCostCostAndProfit(dbOrder.OrderTotalPrice ?? 0M, |
|
|
totalPurchaseProductAmount, |
|
|
totalPurchaseProductAmount, |
|
@ -2515,34 +2515,34 @@ namespace BBWYB.Server.Business |
|
|
foreach (var update in updateOrderCostDetailList) |
|
|
foreach (var update in updateOrderCostDetailList) |
|
|
update.ExecuteAffrows(); |
|
|
update.ExecuteAffrows(); |
|
|
updateOrderCost?.ExecuteAffrows(); |
|
|
updateOrderCost?.ExecuteAffrows(); |
|
|
foreach (var update in updateOrderSkuList) |
|
|
//foreach (var update in updateOrderSkuList)
|
|
|
update.ExecuteAffrows(); |
|
|
// update.ExecuteAffrows();
|
|
|
updateOrder?.ExecuteAffrows(); |
|
|
//updateOrder?.ExecuteAffrows();
|
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (isEditOrderPrice) |
|
|
//if (isEditOrderPrice)
|
|
|
{ |
|
|
//{
|
|
|
#region 通知拳探改价
|
|
|
// #region 通知拳探改价
|
|
|
var opclient = opPlatformClientFactory.GetClient(AdapterEnums.PlatformType.拳探); |
|
|
// var opclient = opPlatformClientFactory.GetClient(AdapterEnums.PlatformType.拳探);
|
|
|
opclient.EditPrice(new OP_EditPriceRequest() |
|
|
// opclient.EditPrice(new OP_EditPriceRequest()
|
|
|
{ |
|
|
// {
|
|
|
AppKey = shop.AppKey, |
|
|
// AppKey = shop.AppKey,
|
|
|
AppSecret = shop.AppSecret, |
|
|
// AppSecret = shop.AppSecret,
|
|
|
AppToken = shop.AppToken, |
|
|
// AppToken = shop.AppToken,
|
|
|
OrderId = dbOrder.Id, |
|
|
// OrderId = dbOrder.Id,
|
|
|
EditItems = op_EditPriceSkuRequests |
|
|
// EditItems = op_EditPriceSkuRequests
|
|
|
}); |
|
|
// });
|
|
|
#endregion
|
|
|
// #endregion
|
|
|
|
|
|
|
|
|
#region 通知C端改价
|
|
|
// #region 通知C端改价
|
|
|
restApiService.SendRequest("https://bbwy.qiyue666.com", |
|
|
// restApiService.SendRequest("https://bbwy.qiyue666.com",
|
|
|
"/Api/PurchaseOrder/QuanTanEditPriceCallback", |
|
|
// "/Api/PurchaseOrder/QuanTanEditPriceCallback",
|
|
|
new { orderId = dbOrder.Id }, |
|
|
// new { orderId = dbOrder.Id },
|
|
|
null, |
|
|
// null,
|
|
|
HttpMethod.Post); |
|
|
// HttpMethod.Post);
|
|
|
#endregion
|
|
|
// #endregion
|
|
|
} |
|
|
//}
|
|
|
} |
|
|
} |
|
|
catch (Exception ex) |
|
|
catch (Exception ex) |
|
|
{ |
|
|
{ |
|
|