From b6caf835c1c9b38e1f53f0d633e76f7b8de7b895 Mon Sep 17 00:00:00 2001
From: shanj <18996038927@163.com>
Date: Fri, 11 Nov 2022 02:52:04 +0800
Subject: [PATCH] 1
---
.../Statistics/OrderCountStatisticsResponse.cs | 4 ++++
BBWY.Client/ViewModels/Order/OrderListViewModel.cs | 9 +++++++++
.../Controllers/StatisticsController.cs | 6 ++----
BBWY.Server.Business/Order/OrderBusiness.cs | 11 -----------
.../Statistics/StatisticsBusiness.cs | 14 ++++++++------
.../Statistics/OrderCountStatisticsResponse.cs | 4 ++++
6 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/BBWY.Client/Models/APIModel/Response/Statistics/OrderCountStatisticsResponse.cs b/BBWY.Client/Models/APIModel/Response/Statistics/OrderCountStatisticsResponse.cs
index 0be31401..5fa9db37 100644
--- a/BBWY.Client/Models/APIModel/Response/Statistics/OrderCountStatisticsResponse.cs
+++ b/BBWY.Client/Models/APIModel/Response/Statistics/OrderCountStatisticsResponse.cs
@@ -5,5 +5,9 @@
public long WaitPurchaseCount { get; set; }
public long ExceptionCount { get; set; }
+
+ public long WaitOutStoreCount { get; set; }
+
+ public long AfterSaleOrderUnhandleCount { get; set; }
}
}
diff --git a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs
index 764f0574..bd98f390 100644
--- a/BBWY.Client/ViewModels/Order/OrderListViewModel.cs
+++ b/BBWY.Client/ViewModels/Order/OrderListViewModel.cs
@@ -52,6 +52,9 @@ namespace BBWY.Client.ViewModels
private string searchServiceId;
private long waitPurchaseOrderCount;
private long exceptionOrderCount;
+ private long waitOutStoreCount;
+ private long afterSaleOrderUnhandleCount;
+
private long? queryShopId;
private string querySDOperator;
private bool isSDGroup;
@@ -144,12 +147,16 @@ namespace BBWY.Client.ViewModels
public long WaitPurchaseOrderCount { get => waitPurchaseOrderCount; set { Set(ref waitPurchaseOrderCount, 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); } }
///
/// 是否为刷单组
///
public bool IsSDGroup { get => isSDGroup; set { Set(ref isSDGroup, value); } }
+
+
public OrderListViewModel(OrderService orderService, StatisticsService statisticsService, AfterOrderService afterOrderService, GlobalContext globalContext, ChoosePurchaseSchemeViewModel choosePurchaseSchemeViewModel)
{
IsSDGroup = globalContext.User.TeamName == "刷单组";
@@ -486,6 +493,8 @@ namespace BBWY.Client.ViewModels
return;
WaitPurchaseOrderCount = response.Data.WaitPurchaseCount;
ExceptionOrderCount = response.Data.ExceptionCount;
+ WaitOutStoreCount = response.Data.WaitOutStoreCount;
+ AfterSaleOrderUnhandleCount = response.Data.AfterSaleOrderUnhandleCount;
}
private void DecodeConsignee(Order order)
diff --git a/BBWY.Server.API/Controllers/StatisticsController.cs b/BBWY.Server.API/Controllers/StatisticsController.cs
index 545e4144..568d5d28 100644
--- a/BBWY.Server.API/Controllers/StatisticsController.cs
+++ b/BBWY.Server.API/Controllers/StatisticsController.cs
@@ -54,13 +54,11 @@ namespace BBWY.Server.API.Controllers
/// bbwy订单选项卡数量统计
///
///
- ///
- ///
///
[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);
}
///
diff --git a/BBWY.Server.Business/Order/OrderBusiness.cs b/BBWY.Server.Business/Order/OrderBusiness.cs
index 89a0fce4..142bff82 100644
--- a/BBWY.Server.Business/Order/OrderBusiness.cs
+++ b/BBWY.Server.Business/Order/OrderBusiness.cs
@@ -546,12 +546,6 @@ namespace BBWY.Server.Business
DeliveryExpressFreight = orderDeliveryExpressFreight,
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);
insertOrderCost = fsql.Insert(orderCost);
#endregion
@@ -560,11 +554,6 @@ namespace BBWY.Server.Business
{
orderCost.PurchaseAmount += orderCostPurchaseAmount;
orderCost.DeliveryExpressFreight += orderDeliveryExpressFreight;
- //orderCost.Profit = dbOrder.OrderSellerPrice +
- // dbOrder.FreightPrice -
- // orderCost.PurchaseAmount -
- // orderCost.DeliveryExpressFreight -
- // orderCost.PlatformCommissionAmount;
orderCost.CalculationOrderProfitAndCost(dbOrder, dbAfterSaleOrderList);
updateOrderCost = fsql.Update().SetSource(orderCost);
}
diff --git a/BBWY.Server.Business/Statistics/StatisticsBusiness.cs b/BBWY.Server.Business/Statistics/StatisticsBusiness.cs
index 23de2942..b4378d03 100644
--- a/BBWY.Server.Business/Statistics/StatisticsBusiness.cs
+++ b/BBWY.Server.Business/Statistics/StatisticsBusiness.cs
@@ -288,22 +288,24 @@ namespace BBWY.Server.Business
///
///
///
- public OrderCountStatisticsResponse GetOrderCountStatistics(long shopId, DateTime startDate, DateTime endDate)
+ public OrderCountStatisticsResponse GetOrderCountStatistics(long shopId)
{
- startDate = startDate.Date;
- endDate = endDate.Date.AddDays(1).AddSeconds(-1);
+ //startDate = startDate.Date;
+ //endDate = endDate.Date.AddDays(1).AddSeconds(-1);
var response = new OrderCountStatisticsResponse();
response.WaitPurchaseCount = fsql.Select().Where(o => o.ShopId == shopId &&
- o.StartTime >= startDate &&
- o.StartTime <= endDate &&
o.OrderState == Enums.OrderState.等待采购).Count();
response.ExceptionCount = fsql.Select().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.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 == null && o.OrderState != Enums.OrderState.等待采购))).Count();
+
+ response.WaitOutStoreCount = fsql.Select().Where(o => o.ShopId == shopId && o.OrderState == Enums.OrderState.待出库).Count();
+
+ response.AfterSaleOrderUnhandleCount = fsql.Select().Where(aso => aso.ProductHealth == null || aso.ProductResult == null).Count();
return response;
}
diff --git a/BBWY.Server.Model/Dto/Response/Statistics/OrderCountStatisticsResponse.cs b/BBWY.Server.Model/Dto/Response/Statistics/OrderCountStatisticsResponse.cs
index 74409229..74536602 100644
--- a/BBWY.Server.Model/Dto/Response/Statistics/OrderCountStatisticsResponse.cs
+++ b/BBWY.Server.Model/Dto/Response/Statistics/OrderCountStatisticsResponse.cs
@@ -5,5 +5,9 @@
public long WaitPurchaseCount { get; set; }
public long ExceptionCount { get; set; }
+
+ public long WaitOutStoreCount { get; set; }
+
+ public long AfterSaleOrderUnhandleCount { get; set; }
}
}