...
|
...
|
@@ -165,22 +165,24 @@ public class ChargeService { |
|
|
private void calculateCouponIfNeed(ChargeContext chargeContext) {
|
|
|
ChargeParam chargeParam = chargeContext.getChargeParam();
|
|
|
List<String> couponCodes = chargeParam.getCouponCodes();
|
|
|
if (CollectionUtils.isEmpty(couponCodes)) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
switch (chargeParam.getChargeStage()) {
|
|
|
case PAYMENT:
|
|
|
case PAYMENT: {
|
|
|
//自动匹配
|
|
|
calculateRecommendedCoupons( chargeContext);
|
|
|
calculateRecommendedCoupons(chargeContext);
|
|
|
break;
|
|
|
}
|
|
|
case SELECT_COUPON:
|
|
|
calculateSelectCoupons(chargeContext);
|
|
|
break;
|
|
|
case COMPUTE:
|
|
|
case SUBMIT:
|
|
|
case SUBMIT: {
|
|
|
if (CollectionUtils.isEmpty(couponCodes)) {
|
|
|
return;
|
|
|
}
|
|
|
calculateSpecifiedCoupons(chargeContext);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
throw new UfoServiceException(500, "unknown chargeStage " + chargeParam.getChargeStage());
|
|
|
}
|
...
|
...
|
|