diff --git a/BBWY.Server.Business/Extensions/OrderCostExtension.cs b/BBWY.Server.Business/Extensions/OrderCostExtension.cs index 43d32c6a..2eabda1f 100644 --- a/BBWY.Server.Business/Extensions/OrderCostExtension.cs +++ b/BBWY.Server.Business/Extensions/OrderCostExtension.cs @@ -15,7 +15,11 @@ namespace BBWY.Server.Business.Extensions //退款之后平台扣点 //orderCost.PlatformCommissionAmount = (order.OrderPayment - order.FreightPrice - orderCost.RefundAmount) * (orderCost.PlatformCommissionRatio); - orderCost.PlatformCommissionAmount = (order.OrderSellerPrice + (order.PingTaiChengDanYouHuiQuan ?? 0M) - orderCost.RefundAmount) * orderCost.PlatformCommissionRatio; + //orderCost.PlatformCommissionAmount = (order.OrderSellerPrice + (order.PingTaiChengDanYouHuiQuan ?? 0M) - orderCost.RefundAmount) * orderCost.PlatformCommissionRatio; + + orderCost.PlatformCommissionAmount = ((order.ActualProductAmount ?? 0M) - orderCost.RefundAmount) * orderCost.PlatformCommissionRatio; + + //orderCost.Profit = order.OrderSellerPrice + order.FreightPrice - orderCost.RefundAmount - // orderCost.PurchaseAmount - // orderCost.DeliveryExpressFreight - @@ -33,7 +37,7 @@ namespace BBWY.Server.Business.Extensions } - public static void CalculationOrderProfitAndCost(this OrderCost orderCost, decimal actualAmountProduct, decimal orderSellerPrice, decimal pingtaichengdanyouhuiquan, IList afterSaleOrders) + public static void CalculationOrderProfitAndCost(this OrderCost orderCost, decimal actualAmountProduct, IList afterSaleOrders) { orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost); orderCost.RefundAmount = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.RefundAmount ?? 0M); @@ -41,7 +45,7 @@ namespace BBWY.Server.Business.Extensions //退款之后平台扣点 //orderCost.PlatformCommissionAmount = (orderPayment - freightPrice - orderCost.RefundAmount) * (orderCost.PlatformCommissionRatio); - orderCost.PlatformCommissionAmount = (orderSellerPrice + pingtaichengdanyouhuiquan - orderCost.RefundAmount) * orderCost.PlatformCommissionRatio; + orderCost.PlatformCommissionAmount = (actualAmountProduct - orderCost.RefundAmount) * orderCost.PlatformCommissionRatio; //orderCost.Profit = orderSellerPrice + freightPrice - orderCost.RefundAmount - // orderCost.PurchaseAmount - diff --git a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs index e60ea19b..91b3490e 100644 --- a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs @@ -898,7 +898,7 @@ namespace BBWY.Server.Business if (dbOrder.OrderTotalPrice != 0) orderCost.CalculationOrderProfitAndCost(dbOrder, null); else - orderCost.CalculationOrderProfitAndCost(actualProductAmount ?? 0M, orderSellerPrice, pingtaiChengDanYouHuiQuan ?? 0M, null); + orderCost.CalculationOrderProfitAndCost(actualProductAmount ?? 0M, null); insertOrderCostList.Add(orderCost); #endregion diff --git a/BBWY.Server.Business/TestBusiness.cs b/BBWY.Server.Business/TestBusiness.cs index 1850e817..8b892e70 100644 --- a/BBWY.Server.Business/TestBusiness.cs +++ b/BBWY.Server.Business/TestBusiness.cs @@ -180,6 +180,7 @@ namespace BBWY.Server.Business o.StartTime >= request.StartTime && o.StartTime <= request.EndTime) .WhereIf(!string.IsNullOrEmpty(request.OrderId), o => o.Id == request.OrderId) + .OrderByDescending(o => o.StartTime) .ToList(o => o.Id); fsql.Transaction(() => @@ -241,8 +242,6 @@ namespace BBWY.Server.Business if (orderCost != null && orderTotal != null) { orderCost.CalculationOrderProfitAndCost(order.ActualProductAmount ?? 0M, - orderTotal.TotalPingTaiChengDanYouHuiQuan ?? 0M, - orderTotal.TotalVenderFee ?? 0M, currentAfterOrderList); if (updateOrderCostDetailList.Count() > 0) { diff --git a/BBWY.Server.Business/Vender/VenderBusiness.cs b/BBWY.Server.Business/Vender/VenderBusiness.cs index 96c93963..5ad45bd3 100644 --- a/BBWY.Server.Business/Vender/VenderBusiness.cs +++ b/BBWY.Server.Business/Vender/VenderBusiness.cs @@ -263,8 +263,8 @@ namespace BBWY.Server.Business SiNanPolicyLevel = x.SiNanPolicyLevel, PJZSDingDingKey = x.PJZSDingDingKey, PJZSDingDingWebHook = x.PJZSDingDingWebHook, - QiKuDingDingKey=x.QiKuDingDingKey, - QiKuDingDingWebHook=x.QiKuDingDingWebHook + QiKuDingDingKey = x.QiKuDingDingKey, + QiKuDingDingWebHook = x.QiKuDingDingWebHook }).ToList() }; departmentList.Add(department); @@ -300,6 +300,7 @@ namespace BBWY.Server.Business .WhereIf(platform != null, s => s.PlatformId == (int)platform) .WhereIf(filterTurnoverDays, s => s.SkuSafeTurnoverDays != 0) .WhereIf(filterSiNan, s => !string.IsNullOrEmpty(s.SiNanDingDingWebHook)) + .Where(s => s.IsEnabled == true) .ToList(); } diff --git a/BBWY.Server.Model/Db/Mds/Shops.cs b/BBWY.Server.Model/Db/Mds/Shops.cs index 50bc611a..7ff00458 100644 --- a/BBWY.Server.Model/Db/Mds/Shops.cs +++ b/BBWY.Server.Model/Db/Mds/Shops.cs @@ -184,6 +184,9 @@ namespace BBWY.Server.Model.Db.Mds /// [Column(StringLength = 100)] public string QiKuDingDingKey { get; set; } + + [Column(DbType = "bit", IsNullable = true)] + public bool? IsEnabled { get; set; } = true; } }