|
|
@ -292,20 +292,21 @@ namespace BBWY.Server.Business |
|
|
|
{ |
|
|
|
//startDate = startDate.Date;
|
|
|
|
//endDate = endDate.Date.AddDays(1).AddSeconds(-1);
|
|
|
|
var dt = DateTime.Parse("2022-05-01"); |
|
|
|
var response = new OrderCountStatisticsResponse(); |
|
|
|
response.WaitPurchaseCount = fsql.Select<Order>().Where(o => o.ShopId == shopId && |
|
|
|
o.OrderState == Enums.OrderState.等待采购).Count(); |
|
|
|
o.OrderState == Enums.OrderState.等待采购 && o.StartTime >= dt).Count(); |
|
|
|
|
|
|
|
response.ExceptionCount = fsql.Select<Order, OrderCost>().LeftJoin((o, oc) => o.Id == oc.OrderId) |
|
|
|
.Where((o, oc) => o.ShopId == shopId && |
|
|
|
.Where((o, oc) => o.ShopId == shopId && o.StartTime >= dt && |
|
|
|
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<Order>().Where(o => o.ShopId == shopId && o.OrderState == Enums.OrderState.待出库).Count(); |
|
|
|
response.WaitOutStoreCount = fsql.Select<Order>().Where(o => o.ShopId == shopId && o.OrderState == Enums.OrderState.待出库 && o.StartTime >= dt).Count(); |
|
|
|
|
|
|
|
response.AfterSaleOrderUnhandleCount = fsql.Select<AfterSaleOrder>().Where(aso => aso.ProductHealth == null || aso.ProductResult == null).Count(); |
|
|
|
response.AfterSaleOrderUnhandleCount = fsql.Select<AfterSaleOrder>().Where(aso => aso.ShopId == shopId && aso.ProductHealth == null || aso.ProductResult == null && aso.CreateTime >= dt).Count(); |
|
|
|
return response; |
|
|
|
} |
|
|
|
|
|
|
|