diff --git a/BBWY.Client/Views/Order/ManualCalculationCost.xaml b/BBWY.Client/Views/Order/ManualCalculationCost.xaml index 8ce2c948..4fe1a555 100644 --- a/BBWY.Client/Views/Order/ManualCalculationCost.xaml +++ b/BBWY.Client/Views/Order/ManualCalculationCost.xaml @@ -25,7 +25,7 @@ Grid.Row="1" RowHeight="103"> - + @@ -106,11 +106,19 @@ - - + + + + + + + + @@ -138,7 +146,7 @@ - + @@ -154,55 +162,6 @@ - - diff --git a/BBWY.Server.Business/Order/OrderBusiness.cs b/BBWY.Server.Business/Order/OrderBusiness.cs index f0da8cbb..5c043bb8 100644 --- a/BBWY.Server.Business/Order/OrderBusiness.cs +++ b/BBWY.Server.Business/Order/OrderBusiness.cs @@ -1,6 +1,7 @@ using BBWY.Common.Extensions; using BBWY.Common.Http; using BBWY.Common.Models; +using BBWY.Server.Business.Extensions; using BBWY.Server.Business.PlatformSDK.DataExtension; using BBWY.Server.Model; using BBWY.Server.Model.Db; @@ -611,6 +612,7 @@ namespace BBWY.Server.Business IUpdate updateOrderCost = null; IInsert insertOrderCost = null; List insertOrderCostDetailList = new List(); + var dbAfterSaleOrderList = fsql.Select().Where(aso => aso.OrderId == manualCalculationCostRequest.OrderId).ToList(); if (manualCalculationCostRequest.IsSetStorageType) orderUpdate = fsql.Update(manualCalculationCostRequest.OrderId).Set(o => o.StorageType, manualCalculationCostRequest.StorageType); @@ -643,23 +645,25 @@ namespace BBWY.Server.Business CreateTime = DateTime.Now, IsManualEdited = true }; - orderCost.PlatformCommissionAmount = dbOrder.OrderSellerPrice * orderCost.PlatformCommissionRatio; - orderCost.Profit = dbOrder.OrderSellerPrice + - dbOrder.FreightPrice - - orderCost.PurchaseAmount - - orderCost.DeliveryExpressFreight - - orderCost.PlatformCommissionAmount; + //orderCost.PlatformCommissionAmount = dbOrder.OrderSellerPrice * orderCost.PlatformCommissionRatio; + //orderCost.Profit = dbOrder.OrderSellerPrice + + // dbOrder.FreightPrice - + // orderCost.PurchaseAmount - + // orderCost.DeliveryExpressFreight - + // orderCost.PlatformCommissionAmount; + orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList); insertOrderCost = fsql.Insert(orderCost); } else { orderCost.PurchaseAmount = totalPurchaseCost; orderCost.DeliveryExpressFreight = totalDeliveryExpressFreight; - orderCost.Profit = dbOrder.OrderSellerPrice + - dbOrder.FreightPrice - - orderCost.PurchaseAmount - - orderCost.DeliveryExpressFreight - - orderCost.PlatformCommissionAmount; + //orderCost.Profit = dbOrder.OrderSellerPrice + + // dbOrder.FreightPrice - + // orderCost.PurchaseAmount - + // orderCost.DeliveryExpressFreight - + // orderCost.PlatformCommissionAmount; + orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList); orderCost.IsManualEdited = true; updateOrderCost = fsql.Update().SetSource(orderCost); }