shanji 3 years ago
parent
commit
b6caf835c1
  1. 4
      BBWY.Client/Models/APIModel/Response/Statistics/OrderCountStatisticsResponse.cs
  2. 9
      BBWY.Client/ViewModels/Order/OrderListViewModel.cs
  3. 6
      BBWY.Server.API/Controllers/StatisticsController.cs
  4. 11
      BBWY.Server.Business/Order/OrderBusiness.cs
  5. 14
      BBWY.Server.Business/Statistics/StatisticsBusiness.cs
  6. 4
      BBWY.Server.Model/Dto/Response/Statistics/OrderCountStatisticsResponse.cs

4
BBWY.Client/Models/APIModel/Response/Statistics/OrderCountStatisticsResponse.cs

@ -5,5 +5,9 @@
public long WaitPurchaseCount { get; set; } public long WaitPurchaseCount { get; set; }
public long ExceptionCount { get; set; } public long ExceptionCount { get; set; }
public long WaitOutStoreCount { get; set; }
public long AfterSaleOrderUnhandleCount { get; set; }
} }
} }

9
BBWY.Client/ViewModels/Order/OrderListViewModel.cs

@ -52,6 +52,9 @@ namespace BBWY.Client.ViewModels
private string searchServiceId; private string searchServiceId;
private long waitPurchaseOrderCount; private long waitPurchaseOrderCount;
private long exceptionOrderCount; private long exceptionOrderCount;
private long waitOutStoreCount;
private long afterSaleOrderUnhandleCount;
private long? queryShopId; private long? queryShopId;
private string querySDOperator; private string querySDOperator;
private bool isSDGroup; private bool isSDGroup;
@ -144,12 +147,16 @@ namespace BBWY.Client.ViewModels
public long WaitPurchaseOrderCount { get => waitPurchaseOrderCount; set { Set(ref waitPurchaseOrderCount, value); } } public long WaitPurchaseOrderCount { get => waitPurchaseOrderCount; set { Set(ref waitPurchaseOrderCount, value); } }
public long ExceptionOrderCount { get => exceptionOrderCount; set { Set(ref exceptionOrderCount, value); } } public long ExceptionOrderCount { get => exceptionOrderCount; set { Set(ref exceptionOrderCount, value); } }
public long WaitOutStoreCount { get => waitOutStoreCount; set { Set(ref waitOutStoreCount, value); } }
public long AfterSaleOrderUnhandleCount { get => afterSaleOrderUnhandleCount; set { Set(ref afterSaleOrderUnhandleCount, value); } }
/// <summary> /// <summary>
/// 是否为刷单组 /// 是否为刷单组
/// </summary> /// </summary>
public bool IsSDGroup { get => isSDGroup; set { Set(ref isSDGroup, value); } } public bool IsSDGroup { get => isSDGroup; set { Set(ref isSDGroup, value); } }
public OrderListViewModel(OrderService orderService, StatisticsService statisticsService, AfterOrderService afterOrderService, GlobalContext globalContext, ChoosePurchaseSchemeViewModel choosePurchaseSchemeViewModel) public OrderListViewModel(OrderService orderService, StatisticsService statisticsService, AfterOrderService afterOrderService, GlobalContext globalContext, ChoosePurchaseSchemeViewModel choosePurchaseSchemeViewModel)
{ {
IsSDGroup = globalContext.User.TeamName == "刷单组"; IsSDGroup = globalContext.User.TeamName == "刷单组";
@ -486,6 +493,8 @@ namespace BBWY.Client.ViewModels
return; return;
WaitPurchaseOrderCount = response.Data.WaitPurchaseCount; WaitPurchaseOrderCount = response.Data.WaitPurchaseCount;
ExceptionOrderCount = response.Data.ExceptionCount; ExceptionOrderCount = response.Data.ExceptionCount;
WaitOutStoreCount = response.Data.WaitOutStoreCount;
AfterSaleOrderUnhandleCount = response.Data.AfterSaleOrderUnhandleCount;
} }
private void DecodeConsignee(Order order) private void DecodeConsignee(Order order)

6
BBWY.Server.API/Controllers/StatisticsController.cs

@ -54,13 +54,11 @@ namespace BBWY.Server.API.Controllers
/// bbwy订单选项卡数量统计 /// bbwy订单选项卡数量统计
/// </summary> /// </summary>
/// <param name="shopId"></param> /// <param name="shopId"></param>
/// <param name="startDate"></param>
/// <param name="endDate"></param>
/// <returns></returns> /// <returns></returns>
[HttpGet] [HttpGet]
public OrderCountStatisticsResponse GetOrderCountStatistics([FromQuery] long shopId, [FromQuery] DateTime startDate, [FromQuery] DateTime endDate) public OrderCountStatisticsResponse GetOrderCountStatistics([FromQuery] long shopId)
{ {
return statisticsBusiness.GetOrderCountStatistics(shopId, startDate, endDate); return statisticsBusiness.GetOrderCountStatistics(shopId);
} }
/// <summary> /// <summary>

11
BBWY.Server.Business/Order/OrderBusiness.cs

@ -546,12 +546,6 @@ namespace BBWY.Server.Business
DeliveryExpressFreight = orderDeliveryExpressFreight, DeliveryExpressFreight = orderDeliveryExpressFreight,
CreateTime = DateTime.Now CreateTime = DateTime.Now
}; };
//orderCost.PlatformCommissionAmount = dbOrder.OrderSellerPrice * orderCost.PlatformCommissionRatio;
//orderCost.Profit = dbOrder.OrderSellerPrice +
// dbOrder.FreightPrice -
// orderCost.PurchaseAmount -
// orderCost.DeliveryExpressFreight -
// orderCost.PlatformCommissionAmount;
orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList); orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList);
insertOrderCost = fsql.Insert(orderCost); insertOrderCost = fsql.Insert(orderCost);
#endregion #endregion
@ -560,11 +554,6 @@ namespace BBWY.Server.Business
{ {
orderCost.PurchaseAmount += orderCostPurchaseAmount; orderCost.PurchaseAmount += orderCostPurchaseAmount;
orderCost.DeliveryExpressFreight += orderDeliveryExpressFreight; orderCost.DeliveryExpressFreight += orderDeliveryExpressFreight;
//orderCost.Profit = dbOrder.OrderSellerPrice +
// dbOrder.FreightPrice -
// orderCost.PurchaseAmount -
// orderCost.DeliveryExpressFreight -
// orderCost.PlatformCommissionAmount;
orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList); orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList);
updateOrderCost = fsql.Update<OrderCost>().SetSource(orderCost); updateOrderCost = fsql.Update<OrderCost>().SetSource(orderCost);
} }

14
BBWY.Server.Business/Statistics/StatisticsBusiness.cs

@ -288,22 +288,24 @@ namespace BBWY.Server.Business
/// <param name="startDate"></param> /// <param name="startDate"></param>
/// <param name="endDate"></param> /// <param name="endDate"></param>
/// <returns></returns> /// <returns></returns>
public OrderCountStatisticsResponse GetOrderCountStatistics(long shopId, DateTime startDate, DateTime endDate) public OrderCountStatisticsResponse GetOrderCountStatistics(long shopId)
{ {
startDate = startDate.Date; //startDate = startDate.Date;
endDate = endDate.Date.AddDays(1).AddSeconds(-1); //endDate = endDate.Date.AddDays(1).AddSeconds(-1);
var response = new OrderCountStatisticsResponse(); var response = new OrderCountStatisticsResponse();
response.WaitPurchaseCount = fsql.Select<Order>().Where(o => o.ShopId == shopId && response.WaitPurchaseCount = fsql.Select<Order>().Where(o => o.ShopId == shopId &&
o.StartTime >= startDate &&
o.StartTime <= endDate &&
o.OrderState == Enums.OrderState.).Count(); o.OrderState == Enums.OrderState.).Count();
response.ExceptionCount = fsql.Select<Order, OrderCost>().LeftJoin((o, oc) => o.Id == oc.OrderId) response.ExceptionCount = fsql.Select<Order, OrderCost>().LeftJoin((o, oc) => o.Id == oc.OrderId)
.Where((o, oc) => o.ShopId == shopId && o.StartTime >= startDate && o.StartTime <= endDate && .Where((o, oc) => o.ShopId == shopId &&
o.OrderState != Enums.OrderState. && o.OrderState != Enums.OrderState. &&
((o.StorageType != Enums.StorageType.SD && o.StorageType != null && oc.PurchaseAmount == 0M) || ((o.StorageType != Enums.StorageType.SD && o.StorageType != null && oc.PurchaseAmount == 0M) ||
(o.StorageType != Enums.StorageType.SD && oc.PurchaseAmount + oc.DeliveryExpressFreight > o.OrderSellerPrice + o.FreightPrice) || (o.StorageType != Enums.StorageType.SD && oc.PurchaseAmount + oc.DeliveryExpressFreight > o.OrderSellerPrice + o.FreightPrice) ||
(o.StorageType == null && o.OrderState != Enums.OrderState.))).Count(); (o.StorageType == null && o.OrderState != Enums.OrderState.))).Count();
response.WaitOutStoreCount = fsql.Select<Order>().Where(o => o.ShopId == shopId && o.OrderState == Enums.OrderState.).Count();
response.AfterSaleOrderUnhandleCount = fsql.Select<AfterSaleOrder>().Where(aso => aso.ProductHealth == null || aso.ProductResult == null).Count();
return response; return response;
} }

4
BBWY.Server.Model/Dto/Response/Statistics/OrderCountStatisticsResponse.cs

@ -5,5 +5,9 @@
public long WaitPurchaseCount { get; set; } public long WaitPurchaseCount { get; set; }
public long ExceptionCount { get; set; } public long ExceptionCount { get; set; }
public long WaitOutStoreCount { get; set; }
public long AfterSaleOrderUnhandleCount { get; set; }
} }
} }

Loading…
Cancel
Save