shanji 3 years ago
parent
commit
138d49a5c4
  1. 18
      BBWY.Server.Business/Order/OrderBusiness.cs

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

@ -466,7 +466,7 @@ namespace BBWY.Server.Business
IUpdate<Order> orderUpdate = null; IUpdate<Order> orderUpdate = null;
IUpdate<OrderCost> updateOrderCost = null; IUpdate<OrderCost> updateOrderCost = null;
IInsert<OrderCost> insertOrderCost = null; IInsert<OrderCost> insertOrderCost = null;
//IList<IUpdate<PurchaseOrder>> updatePurchaseOrderList = new List<IUpdate<PurchaseOrder>>(); IList<IUpdate<PurchaseOrder>> updatePurchaseOrderList = new List<IUpdate<PurchaseOrder>>();
List<OrderCostDetail> insertOrderCostDetailList = new List<OrderCostDetail>(); List<OrderCostDetail> insertOrderCostDetailList = new List<OrderCostDetail>();
if (autoCalculationCostRequest.IsSetStorageType) if (autoCalculationCostRequest.IsSetStorageType)
@ -482,7 +482,7 @@ namespace BBWY.Server.Business
var deductedQuantity = currentOrderSkuCostDetails.Count() == 0 ? 0 : currentOrderSkuCostDetails.Sum(ocd => ocd.DeductionQuantity); var deductedQuantity = currentOrderSkuCostDetails.Count() == 0 ? 0 : currentOrderSkuCostDetails.Sum(ocd => ocd.DeductionQuantity);
//剩余扣减数量 //剩余扣减数量
var noDeductionQuantity = orderSku.ItemTotal.Value - deductedQuantity; var noDeductionQuantity = orderSku.ItemTotal.Value - deductedQuantity;
if (noDeductionQuantity == 0) if (noDeductionQuantity <= 0)
continue; continue;
//是否多次扣减库存 //是否多次扣减库存
@ -517,8 +517,8 @@ namespace BBWY.Server.Business
//累计发货运费(销售运费) //累计发货运费(销售运费)
orderDeliveryExpressFreight += currentSkuDeliveryFreight; orderDeliveryExpressFreight += currentSkuDeliveryFreight;
//var updateSql = fsql.Update<PurchaseOrder>(purchaseOrder.Id).Set(po => po.RemainingQuantity - deductionQuantity); var updateSql = fsql.Update<PurchaseOrder>(purchaseOrder.Id).Set(po => po.RemainingQuantity - deductionQuantity);
//updatePurchaseOrderList.Add(updateSql); updatePurchaseOrderList.Add(updateSql);
var orderCostDetail = new OrderCostDetail() var orderCostDetail = new OrderCostDetail()
{ {
@ -588,11 +588,11 @@ namespace BBWY.Server.Business
orderUpdate?.ExecuteAffrows(); orderUpdate?.ExecuteAffrows();
updateOrderCost?.ExecuteAffrows(); updateOrderCost?.ExecuteAffrows();
insertOrderCost?.ExecuteAffrows(); insertOrderCost?.ExecuteAffrows();
//if (updatePurchaseOrderList.Count > 0) if (updatePurchaseOrderList.Count > 0)
//{ {
// foreach (var update in updatePurchaseOrderList) foreach (var update in updatePurchaseOrderList)
// update.ExecuteAffrows(); update.ExecuteAffrows();
//} }
if (insertOrderCostDetailList.Count > 0) if (insertOrderCostDetailList.Count > 0)
fsql.Insert(insertOrderCostDetailList).ExecuteAffrows(); fsql.Insert(insertOrderCostDetailList).ExecuteAffrows();
}); });

Loading…
Cancel
Save