Browse Source

1

AddValidOverTime
sanji 2 years ago
parent
commit
f6eed25979
  1. 10
      BBWY.Server.Business/Extensions/OrderCostExtension.cs
  2. 2
      BBWY.Server.Business/Sync/OrderSyncBusiness.cs
  3. 3
      BBWY.Server.Business/TestBusiness.cs
  4. 5
      BBWY.Server.Business/Vender/VenderBusiness.cs
  5. 3
      BBWY.Server.Model/Db/Mds/Shops.cs

10
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.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.Profit = order.OrderSellerPrice + order.FreightPrice - orderCost.RefundAmount -
// orderCost.PurchaseAmount - // orderCost.PurchaseAmount -
// orderCost.DeliveryExpressFreight - // 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<AfterSaleOrder> afterSaleOrders) public static void CalculationOrderProfitAndCost(this OrderCost orderCost, decimal actualAmountProduct, IList<AfterSaleOrder> afterSaleOrders)
{ {
orderCost.AfterTotalCost = afterSaleOrders == null || afterSaleOrders.Count == 0 ? 0M : afterSaleOrders.Sum(aso => aso.AfterTotalCost); 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); 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 = (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.Profit = orderSellerPrice + freightPrice - orderCost.RefundAmount -
// orderCost.PurchaseAmount - // orderCost.PurchaseAmount -

2
BBWY.Server.Business/Sync/OrderSyncBusiness.cs

@ -898,7 +898,7 @@ namespace BBWY.Server.Business
if (dbOrder.OrderTotalPrice != 0) if (dbOrder.OrderTotalPrice != 0)
orderCost.CalculationOrderProfitAndCost(dbOrder, null); orderCost.CalculationOrderProfitAndCost(dbOrder, null);
else else
orderCost.CalculationOrderProfitAndCost(actualProductAmount ?? 0M, orderSellerPrice, pingtaiChengDanYouHuiQuan ?? 0M, null); orderCost.CalculationOrderProfitAndCost(actualProductAmount ?? 0M, null);
insertOrderCostList.Add(orderCost); insertOrderCostList.Add(orderCost);
#endregion #endregion

3
BBWY.Server.Business/TestBusiness.cs

@ -180,6 +180,7 @@ namespace BBWY.Server.Business
o.StartTime >= request.StartTime && o.StartTime >= request.StartTime &&
o.StartTime <= request.EndTime) o.StartTime <= request.EndTime)
.WhereIf(!string.IsNullOrEmpty(request.OrderId), o => o.Id == request.OrderId) .WhereIf(!string.IsNullOrEmpty(request.OrderId), o => o.Id == request.OrderId)
.OrderByDescending(o => o.StartTime)
.ToList(o => o.Id); .ToList(o => o.Id);
fsql.Transaction(() => fsql.Transaction(() =>
@ -241,8 +242,6 @@ namespace BBWY.Server.Business
if (orderCost != null && orderTotal != null) if (orderCost != null && orderTotal != null)
{ {
orderCost.CalculationOrderProfitAndCost(order.ActualProductAmount ?? 0M, orderCost.CalculationOrderProfitAndCost(order.ActualProductAmount ?? 0M,
orderTotal.TotalPingTaiChengDanYouHuiQuan ?? 0M,
orderTotal.TotalVenderFee ?? 0M,
currentAfterOrderList); currentAfterOrderList);
if (updateOrderCostDetailList.Count() > 0) if (updateOrderCostDetailList.Count() > 0)
{ {

5
BBWY.Server.Business/Vender/VenderBusiness.cs

@ -263,8 +263,8 @@ namespace BBWY.Server.Business
SiNanPolicyLevel = x.SiNanPolicyLevel, SiNanPolicyLevel = x.SiNanPolicyLevel,
PJZSDingDingKey = x.PJZSDingDingKey, PJZSDingDingKey = x.PJZSDingDingKey,
PJZSDingDingWebHook = x.PJZSDingDingWebHook, PJZSDingDingWebHook = x.PJZSDingDingWebHook,
QiKuDingDingKey=x.QiKuDingDingKey, QiKuDingDingKey = x.QiKuDingDingKey,
QiKuDingDingWebHook=x.QiKuDingDingWebHook QiKuDingDingWebHook = x.QiKuDingDingWebHook
}).ToList() }).ToList()
}; };
departmentList.Add(department); departmentList.Add(department);
@ -300,6 +300,7 @@ namespace BBWY.Server.Business
.WhereIf(platform != null, s => s.PlatformId == (int)platform) .WhereIf(platform != null, s => s.PlatformId == (int)platform)
.WhereIf(filterTurnoverDays, s => s.SkuSafeTurnoverDays != 0) .WhereIf(filterTurnoverDays, s => s.SkuSafeTurnoverDays != 0)
.WhereIf(filterSiNan, s => !string.IsNullOrEmpty(s.SiNanDingDingWebHook)) .WhereIf(filterSiNan, s => !string.IsNullOrEmpty(s.SiNanDingDingWebHook))
.Where(s => s.IsEnabled == true)
.ToList<ShopResponse>(); .ToList<ShopResponse>();
} }

3
BBWY.Server.Model/Db/Mds/Shops.cs

@ -184,6 +184,9 @@ namespace BBWY.Server.Model.Db.Mds
/// </summary> /// </summary>
[Column(StringLength = 100)] [Column(StringLength = 100)]
public string QiKuDingDingKey { get; set; } public string QiKuDingDingKey { get; set; }
[Column(DbType = "bit", IsNullable = true)]
public bool? IsEnabled { get; set; } = true;
} }
} }

Loading…
Cancel
Save