diff --git a/BBWY.Client/Models/APIModel/Response/Order/OrderCostDetailResponse.cs b/BBWY.Client/Models/APIModel/Response/Order/OrderCostDetailResponse.cs index 17b9e19c..85ae07ea 100644 --- a/BBWY.Client/Models/APIModel/Response/Order/OrderCostDetailResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/Order/OrderCostDetailResponse.cs @@ -4,80 +4,80 @@ namespace BBWY.Client.Models { public class OrderCostDetailResponse { - - public long Id { get; set; } - - - public DateTime? CreateTime { get; set; } - - /// - /// 扣减数量 - /// - public int DeductionQuantity { get; set; } = 0; - - /// - /// 发货运费 - /// - public decimal DeliveryExpressFreight { get; set; } = 0.00M; - - public string OrderId { get; set; } - - - public string ProductId { get; set; } - - /// - /// 单件成本 - /// - public decimal UnitCost { get; set; } = 0.00M; - - /// - /// 采购单流水Id - /// - public long PurchaseOrderPKId { get; set; } - - public string SkuId { get; set; } - - /// - /// Sku成本(商品成本) - /// - public decimal SkuAmount { get; set; } = 0.00M; - - /// - /// 采购运费 - /// - public decimal PurchaseFreight { get; set; } = 0.00M; - - /// - /// 头程运费 - /// - public decimal FirstFreight { get; set; } = 0.00M; - - - //public decimal OperationAmount { get; set; } = 0.00M; - - /// - /// 入仓操作费 - /// - public decimal InStorageAmount { get; set; } - - /// - /// 出仓操作费 - /// - public decimal OutStorageAmount { get; set; } - - /// - /// 耗材费 - /// - public decimal ConsumableAmount { get; set; } = 0.00M; - - /// - /// 仓储费 - /// - public decimal StorageAmount { get; set; } = 0.00M; - - /// - /// 总计(不含发货运费) - /// - public decimal TotalCost { get; set; } = 0.00M; - } + + public long Id { get; set; } + + + public DateTime? CreateTime { get; set; } + + /// + /// 扣减数量 + /// + public int DeductionQuantity { get; set; } = 0; + + /// + /// 发货运费 + /// + public decimal DeliveryExpressFreight { get; set; } = 0.00M; + + public string OrderId { get; set; } + + + public string ProductId { get; set; } + + /// + /// 单件成本 + /// + public decimal UnitCost { get; set; } = 0.00M; + + /// + /// 采购单流水Id + /// + public long PurchaseOrderPKId { get; set; } + + public string SkuId { get; set; } + + /// + /// Sku成本(商品成本) + /// + public decimal SkuAmount { get; set; } = 0.00M; + + /// + /// 采购运费 + /// + public decimal PurchaseFreight { get; set; } = 0.00M; + + /// + /// 头程运费 + /// + public decimal FirstFreight { get; set; } = 0.00M; + + + //public decimal OperationAmount { get; set; } = 0.00M; + + /// + /// 入仓操作费 + /// + public decimal InStorageAmount { get; set; } + + /// + /// 出仓操作费 + /// + public decimal OutStorageAmount { get; set; } + + /// + /// 耗材费 + /// + public decimal ConsumableAmount { get; set; } = 0.00M; + + /// + /// 仓储费 + /// + public decimal StorageAmount { get; set; } = 0.00M; + + /// + /// 总计 + /// + public decimal TotalCost { get; set; } = 0.00M; + } } diff --git a/BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs b/BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs index ef20e1a4..a8829c46 100644 --- a/BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs +++ b/BBWY.Client/Models/APIModel/Response/Order/OrderResponse.cs @@ -153,6 +153,7 @@ namespace BBWY.Client.Models /// public OrderCostResponse OrderCost { get; set; } + public IList ItemList { get; set; } /// diff --git a/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs b/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs new file mode 100644 index 00000000..49840022 --- /dev/null +++ b/BBWY.Client/Models/AfterSaleOrder/AfterSaleOrderGroup.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace BBWY.Client.Models +{ + public class AfterSaleOrderGroup + { + public string SkuId { get; set; } + + public IList Items { get; set; } + + public AfterSaleOrderGroup() + { + Items = new List(); + } + } +} diff --git a/BBWY.Client/Models/Order/Order.cs b/BBWY.Client/Models/Order/Order.cs index d298534c..9c79c61e 100644 --- a/BBWY.Client/Models/Order/Order.cs +++ b/BBWY.Client/Models/Order/Order.cs @@ -9,6 +9,7 @@ namespace BBWY.Client.Models public Order() { OrderCostDetailGroupList = new List(); + AfterSaleOrderGroupList = new List(); } private StorageType? storageType; @@ -196,14 +197,19 @@ namespace BBWY.Client.Models /// public IList OrderDropShippingList { get; set; } - /*/// + /// /// 售后信息 - /// */ - //public List AfterSaleOrderList { get; set; } + /// + public IList AfterSaleOrderList { get; set; } + + /// + ///售后信息分组 + /// + public IList AfterSaleOrderGroupList { get; set; } public void LocalConvert() { - //ConvertAfterSaleOrderSku(); + ConvertAfterSaleOrderToGroup(); ConvertOrderCostDetailToGroup(); } @@ -223,28 +229,21 @@ namespace BBWY.Client.Models } } - /* - /// - /// 处理售后集合,如果Sku没有售后,则赋值一个空对象进行占位,保持售后信息和Sku对位 - /// - */ - //private void ConvertAfterSaleOrderSku() - //{ - // if (!IsAfterSaleOrder || AfterSaleOrderList == null || AfterSaleOrderList.Count() == 0 || (ItemList.Count() == AfterSaleOrderList.Count())) - // return; - // var asoList = new List(); - // asoList.AddRange(AfterSaleOrderList); - // AfterSaleOrderList.Clear(); - // foreach (var sku in ItemList) - // { - // var afterSaleOrderSku = asoList.FirstOrDefault(aso => aso.SkuId == sku.Id); - // if (afterSaleOrderSku == null) - // afterSaleOrderSku = new AfterSaleOrder() { IsPlaceholder = true }; - // AfterSaleOrderList.Add(afterSaleOrderSku); - // } - // asoList.Clear(); - - //} + private void ConvertAfterSaleOrderToGroup() + { + if (!IsAfterSaleOrder || AfterSaleOrderList == null || AfterSaleOrderList.Count() == 0) + return; + foreach (var aso in AfterSaleOrderList) + { + var group = AfterSaleOrderGroupList.FirstOrDefault(g => g.SkuId == aso.SkuId); + if (group == null) + { + group = new AfterSaleOrderGroup() { SkuId = aso.SkuId }; + AfterSaleOrderGroupList.Add(group); + } + group.Items.Add(aso); + } + } } public class OrderList diff --git a/BBWY.Client/Views/Order/OrderList.xaml b/BBWY.Client/Views/Order/OrderList.xaml index b1cdb292..6cf3415c 100644 --- a/BBWY.Client/Views/Order/OrderList.xaml +++ b/BBWY.Client/Views/Order/OrderList.xaml @@ -583,8 +583,8 @@ - + @@ -657,6 +657,7 @@ + - + - @@ -689,30 +689,77 @@ - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + - @@ -721,19 +768,31 @@ - + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + @@ -748,23 +807,6 @@ - - - - - - - - - - - - - - - - diff --git a/BBWY.Server.Business/Order/OrderBusiness.cs b/BBWY.Server.Business/Order/OrderBusiness.cs index 35462491..bdc9bc05 100644 --- a/BBWY.Server.Business/Order/OrderBusiness.cs +++ b/BBWY.Server.Business/Order/OrderBusiness.cs @@ -483,10 +483,10 @@ namespace BBWY.Server.Business SkuId = orderSku.SkuId, CreateTime = DateTime.Now, PurchaseOrderPKId = purchaseOrder.Id, - UnitCost = purchaseOrder.UnitCost, + //UnitCost = purchaseOrder.UnitCost, DeductionQuantity = deductionQuantity, DeliveryExpressFreight = currentSkuDeliveryFreight, - TotalCost = currentPurchaseAmount, + //TotalCost = currentPurchaseAmount, ConsumableAmount = purchaseOrder.SingleConsumableAmount * deductionQuantity, FirstFreight = purchaseOrder.SingleFirstFreight * deductionQuantity, InStorageAmount = purchaseOrder.SingleInStorageAmount * deductionQuantity, @@ -815,8 +815,8 @@ namespace BBWY.Server.Business SkuAmount = relationOrderSku.SingleSkuAmount * relationOrderSku.Quantity, SkuId = relationOrderSku.SkuId, StorageAmount = 0, - TotalCost = relationOrderSku.SingleSkuAmount * relationOrderSku.Quantity + odsRequest.PurchaseFreight / odsRequest.RelationPurchaseOrderSkuList.Count(), - UnitCost = purchaseOrder.UnitCost, + //TotalCost = relationOrderSku.SingleSkuAmount * relationOrderSku.Quantity + odsRequest.PurchaseFreight / odsRequest.RelationPurchaseOrderSkuList.Count(), + //UnitCost = purchaseOrder.UnitCost, PurchaseOrderPKId = purchaseOrder.Id }); #endregion diff --git a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs index 58d9e759..2150ef59 100644 --- a/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs +++ b/BBWY.Server.Business/PurchaseOrder/PurchaseOrderBusiness.cs @@ -250,8 +250,8 @@ namespace BBWY.Server.Business SkuAmount = currentOrderSkuProductAmount, SkuId = orderSku.SkuId, StorageAmount = 0, - UnitCost = purchaseOrder.UnitCost, - TotalCost = currentOrderSkuProductAmount + currentOrderSkuFreightAmount//purchaseOrder.UnitCost * orderSku.ItemTotal.Value + //UnitCost = purchaseOrder.UnitCost, + //TotalCost = currentOrderSkuProductAmount + currentOrderSkuFreightAmount//purchaseOrder.UnitCost * orderSku.ItemTotal.Value }; insertOrderCostDetails.Add(orderCostDetail); #endregion @@ -621,8 +621,8 @@ namespace BBWY.Server.Business orderCostDetail.SkuAmount = currentOrderSkuProductAmount; orderCostDetail.PurchaseFreight = currentOrderSkuFreightAmount; - orderCostDetail.UnitCost = purchaseOrder.UnitCost; - orderCostDetail.TotalCost = currentOrderSkuProductAmount + currentOrderSkuFreightAmount; + //orderCostDetail.UnitCost = purchaseOrder.UnitCost; + //orderCostDetail.TotalCost = currentOrderSkuProductAmount + currentOrderSkuFreightAmount; updatePurchaseOrders.Add(fsql.Update().SetSource(purchaseOrder)); updateOrderCostDetails.Add(fsql.Update().SetSource(orderCostDetail)); diff --git a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs index 4b9486f4..f8149895 100644 --- a/BBWY.Server.Business/Sync/OrderSyncBusiness.cs +++ b/BBWY.Server.Business/Sync/OrderSyncBusiness.cs @@ -462,10 +462,10 @@ namespace BBWY.Server.Business SkuId = orderSkuId, CreateTime = DateTime.Now, PurchaseOrderPKId = purchaseOrder.Id, - UnitCost = purchaseOrder.UnitCost, + //UnitCost = purchaseOrder.UnitCost, DeductionQuantity = deductionQuantity, DeliveryExpressFreight = currentSkuDeliveryFreight, - TotalCost = currentPurchaseAmount, + //TotalCost = currentPurchaseAmount, ConsumableAmount = purchaseOrder.SingleConsumableAmount * deductionQuantity, FirstFreight = purchaseOrder.SingleFirstFreight * deductionQuantity, //OperationAmount = purchaseOrder.SingleOperationAmount * deductionQuantity, diff --git a/BBWY.Server.Model/Db/Order/OrderCostDetail.cs b/BBWY.Server.Model/Db/Order/OrderCostDetail.cs index b19fcfb8..43b2859d 100644 --- a/BBWY.Server.Model/Db/Order/OrderCostDetail.cs +++ b/BBWY.Server.Model/Db/Order/OrderCostDetail.cs @@ -32,11 +32,11 @@ namespace BBWY.Server.Model.Db [Column(StringLength = 50)] public string ProductId { get; set; } - /// + /*/// /// 单件成本 - /// - [Column(DbType = "decimal(20,2)")] - public decimal UnitCost { get; set; } = 0.00M; + /// */ + //[Column(DbType = "decimal(20,2)")] + //public decimal UnitCost { get; set; } = 0.00M; /// /// 采购单流水Id @@ -96,14 +96,23 @@ namespace BBWY.Server.Model.Db [Column(DbType = "decimal(20,2)")] public decimal StorageAmount { get; set; } = 0.00M; - /// - /// 总计(不含发货运费) - /// - [Column(DbType = "decimal(20,2)")] - public decimal TotalCost { get; set; } = 0.00M; - [Column(DbType = "bit")] public bool IsEnabled { get; set; } = true; + + + /// + /// 总计 + /// + [Column(IsIgnore = true)] + public decimal TotalCost + { + get + { + return SkuAmount + PurchaseFreight + FirstFreight + InStorageAmount + OutStorageAmount + StorageAmount + ConsumableAmount + DeliveryExpressFreight; + } + } + //[Column(DbType = "decimal(20,2)")] + //public decimal TotalCost { get; set; } = 0.00M; } }