Browse Source

订单核算条件变更为sku利润绝对值不超过1

yijia
shanji 2 years ago
parent
commit
178e9c79c3
  1. 16
      BBWYB.Server.Business/Order/OrderBusiness.cs

16
BBWYB.Server.Business/Order/OrderBusiness.cs

@ -744,11 +744,17 @@ namespace BBWYB.Server.Business
throw new BusinessException("未查询到订单");
if (order.OrderState != Enums.OrderState.)
throw new BusinessException("订单状态不正确,只有待核算的订单才允许核算");
var orderCost = fsql.Select<OrderCost>(orderId).ToOne();
if (orderCost == null)
throw new BusinessException("未查询到订单成本");
if (Math.Abs(orderCost.Profit ?? 0) > 1M)
throw new BusinessException("订单利润绝对值不能大于1");
//var orderCost = fsql.Select<OrderCost>(orderId).ToOne();
//if (orderCost == null)
// throw new BusinessException("未查询到订单成本");
//if (Math.Abs(orderCost.Profit ?? 0) > 1M)
// throw new BusinessException("订单利润绝对值不能大于1");
var orderSkuCostList = fsql.Select<OrderSkuCost>().Where(o => o.OrderId == orderId).ToList();
if (orderSkuCostList.Count() == 0)
throw new BusinessException("未查询到订单sku成本");
if (orderSkuCostList.Any(osc => Math.Abs(osc.Profit ?? 0) > 1))
throw new BusinessException("订单sku利润绝对值不能大于1");
fsql.Transaction(() =>
{

Loading…
Cancel
Save