From 1daabef557329c7d31607d9b6925af203bc8a1df Mon Sep 17 00:00:00 2001
From: shanj <18996038927@163.com>
Date: Sun, 21 Aug 2022 00:14:59 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E4=B8=80=E5=88=A9=E6=B6=A6=E8=AE=A1?=
=?UTF-8?q?=E7=AE=97=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Views/Order/ManualCalculationCost.xaml | 65 ++++---------------
BBWY.Server.Business/Order/OrderBusiness.cs | 26 ++++----
2 files changed, 27 insertions(+), 64 deletions(-)
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);
}