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