|
|
|
@ -119,7 +119,7 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { |
|
|
|
|
tradeOrder.setStoreDiscountFinalCostPrice(storeDiscount.getFinalCostPrice()); |
|
|
|
|
if (storeDiscount.getDiscountType().equals(StoreDiscountActivityTypeEnum.type1.getNumber())) { |
|
|
|
|
// 未达到满减门槛
|
|
|
|
|
if (userDiscount.getDiscountCondition().compareTo(tradeOrder.getTradeAmount()) >= 0) { |
|
|
|
|
if (tradeOrder.getTradeAmount().compareTo(storeDiscount.getDiscountCondition()) < 0) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "满减优惠,未达到满减条件"); |
|
|
|
|
} else { |
|
|
|
|
tradeOrder.setStoreDiscountSatisfy(true); |
|
|
|
@ -155,7 +155,7 @@ public class BsTradeOrderServiceImpl implements BsTradeOrderService { |
|
|
|
|
tradeOrder.setUserDiscountType(userDiscount.getDiscountType()); |
|
|
|
|
tradeOrder.setUserDiscountPrice(userDiscount.getDiscountPrice()); |
|
|
|
|
if (userDiscount.getDiscountType().equals(UserDiscountTypeEnum.type1.getNumber())) { |
|
|
|
|
if (userDiscount.getDiscountCondition().compareTo(tradeOrder.getTradeAmount()) > 0) { |
|
|
|
|
if (tradeOrder.getTradeAmount().compareTo(userDiscount.getDiscountCondition()) < 0) { |
|
|
|
|
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "优惠券未达到满减门槛"); |
|
|
|
|
} |
|
|
|
|
tradeOrder.setUserDiscountActualPrice(userDiscount.getDiscountPrice()); |
|
|
|
|