|
|
@ -54,7 +54,7 @@ namespace BBWY.Server.Business |
|
|
|
venderBusinessLazy = new Lazy<VenderBusiness>(() => serviceProvider.GetService<VenderBusiness>()); |
|
|
|
} |
|
|
|
|
|
|
|
private ISelect<Order, OrderConsignee, OrderCost, Storehouse> GetOrderListQueryConditions(SearchOrderRequest searchOrderRequest) |
|
|
|
private ISelect<Order, OrderConsignee, OrderCost, Storehouse> GetOrderListQueryConditions(SearchOrderRequest searchOrderRequest) |
|
|
|
{ |
|
|
|
var select = fsql.Select<Order, OrderConsignee, OrderCost, Storehouse>().LeftJoin((o, ocs, oct, sh) => o.Id == ocs.OrderId) |
|
|
|
.LeftJoin((o, ocs, oct, sh) => o.Id == oct.OrderId) |
|
|
@ -341,7 +341,8 @@ namespace BBWY.Server.Business |
|
|
|
OrderId = g.Key, |
|
|
|
SkuAmount = g.Sum(g.Value.SkuAmount), |
|
|
|
FirstFreight = g.Sum(g.Value.FirstFreight), |
|
|
|
StorageAmount = g.Sum(g.Value.StorageAmount), |
|
|
|
//StorageAmount = g.Sum(g.Value.StorageAmount),
|
|
|
|
PackagingLaborAmount = g.Sum(g.Value.PackagingLaborAmount), |
|
|
|
PurchaseFreight = g.Sum(g.Value.PurchaseFreight), |
|
|
|
ConsumableAmount = g.Sum(g.Value.ConsumableAmount), |
|
|
|
InStorageAmount = g.Sum(g.Value.InStorageAmount), |
|
|
@ -360,7 +361,8 @@ namespace BBWY.Server.Business |
|
|
|
OrderId = g.Key, |
|
|
|
SkuAmount = g.Sum(g.Value.Item1.SkuAmount), |
|
|
|
FirstFreight = g.Sum(g.Value.Item1.FirstFreight), |
|
|
|
StorageAmount = g.Sum(g.Value.Item1.StorageAmount), |
|
|
|
//StorageAmount = g.Sum(g.Value.Item1.StorageAmount),
|
|
|
|
PackagingLaborAmount = g.Sum(g.Value.Item1.PackagingLaborAmount), |
|
|
|
PurchaseFreight = g.Sum(g.Value.Item1.PurchaseFreight), |
|
|
|
ConsumableAmount = g.Sum(g.Value.Item1.ConsumableAmount), |
|
|
|
InStorageAmount = g.Sum(g.Value.Item1.InStorageAmount), |
|
|
@ -377,7 +379,8 @@ namespace BBWY.Server.Business |
|
|
|
order.FirstFreight = statistics?.FirstFreight ?? 0M; |
|
|
|
order.PurchaseSkuAmount = statistics?.SkuAmount ?? 0M; |
|
|
|
order.PurchaseFreight = statistics?.PurchaseFreight ?? 0M; |
|
|
|
order.StorageAmount = statistics?.StorageAmount ?? 0M; |
|
|
|
//order.StorageAmount = statistics?.StorageAmount ?? 0M;
|
|
|
|
order.PackagingLaborAmount = statistics?.PackagingLaborAmount ?? 0M; |
|
|
|
order.SkuIds = string.Join("|", orderSkuList.Where(osku => osku.OrderId == order.OrderId).Select(osku => osku.SkuId)); |
|
|
|
order.ProfitRatio = order.TotalCost == 0 ? 0 : Math.Round(order.Profit / order.TotalCost * 100, 2); |
|
|
|
order.ConsumableAmount = statistics?.ConsumableAmount ?? 0M; |
|
|
@ -594,7 +597,8 @@ namespace BBWY.Server.Business |
|
|
|
//OperationAmount = purchaseOrder.SingleOperationAmount * deductionQuantity,
|
|
|
|
PurchaseFreight = purchaseOrder.SingleFreight * deductionQuantity, |
|
|
|
SkuAmount = purchaseOrder.SingleSkuAmount * deductionQuantity, |
|
|
|
StorageAmount = purchaseOrder.SingleStorageAmount * deductionQuantity |
|
|
|
//StorageAmount = purchaseOrder.SingleStorageAmount * deductionQuantity
|
|
|
|
PackagingLaborAmount = purchaseOrder.SinglePackagingLaborAmount * deductionQuantity |
|
|
|
}; |
|
|
|
|
|
|
|
orderCostDetail.CalculationSkuGrossProfit(orderSku.ShouldPay ?? 0M, |
|
|
@ -957,7 +961,8 @@ namespace BBWY.Server.Business |
|
|
|
//SingleOperationAmount = 0,
|
|
|
|
SingleInStorageAmount = 0, |
|
|
|
SingleOutStorageAmount = 0, |
|
|
|
SingleStorageAmount = 0, |
|
|
|
SinglePackagingLaborAmount = 0M, |
|
|
|
//SingleStorageAmount = 0,
|
|
|
|
SingleSkuAmount = relationOrderSku.SingleSkuAmount, |
|
|
|
SingleDeliveryFreight = 0 |
|
|
|
}; |
|
|
@ -981,7 +986,8 @@ namespace BBWY.Server.Business |
|
|
|
PurchaseFreight = odsRequest.PurchaseFreight / odsRequest.RelationPurchaseOrderSkuList.Count(), |
|
|
|
SkuAmount = relationOrderSku.SingleSkuAmount * relationOrderSku.Quantity, |
|
|
|
SkuId = relationOrderSku.SkuId, |
|
|
|
StorageAmount = 0, |
|
|
|
PackagingLaborAmount = 0, |
|
|
|
//StorageAmount = 0,
|
|
|
|
//TotalCost = relationOrderSku.SingleSkuAmount * relationOrderSku.Quantity + odsRequest.PurchaseFreight / odsRequest.RelationPurchaseOrderSkuList.Count(),
|
|
|
|
//UnitCost = purchaseOrder.UnitCost,
|
|
|
|
PurchaseOrderPKId = purchaseOrder.Id |
|
|
|