Merge branch 'dev-coupon-recommend' into test6.9.6
Showing
1 changed file
with
8 additions
and
6 deletions
@@ -165,22 +165,24 @@ public class ChargeService { | @@ -165,22 +165,24 @@ public class ChargeService { | ||
165 | private void calculateCouponIfNeed(ChargeContext chargeContext) { | 165 | private void calculateCouponIfNeed(ChargeContext chargeContext) { |
166 | ChargeParam chargeParam = chargeContext.getChargeParam(); | 166 | ChargeParam chargeParam = chargeContext.getChargeParam(); |
167 | List<String> couponCodes = chargeParam.getCouponCodes(); | 167 | List<String> couponCodes = chargeParam.getCouponCodes(); |
168 | - if (CollectionUtils.isEmpty(couponCodes)) { | ||
169 | - return; | ||
170 | - } | ||
171 | 168 | ||
172 | switch (chargeParam.getChargeStage()) { | 169 | switch (chargeParam.getChargeStage()) { |
173 | - case PAYMENT: | 170 | + case PAYMENT: { |
174 | //自动匹配 | 171 | //自动匹配 |
175 | - calculateRecommendedCoupons( chargeContext); | 172 | + calculateRecommendedCoupons(chargeContext); |
176 | break; | 173 | break; |
174 | + } | ||
177 | case SELECT_COUPON: | 175 | case SELECT_COUPON: |
178 | calculateSelectCoupons(chargeContext); | 176 | calculateSelectCoupons(chargeContext); |
179 | break; | 177 | break; |
180 | case COMPUTE: | 178 | case COMPUTE: |
181 | - case SUBMIT: | 179 | + case SUBMIT: { |
180 | + if (CollectionUtils.isEmpty(couponCodes)) { | ||
181 | + return; | ||
182 | + } | ||
182 | calculateSpecifiedCoupons(chargeContext); | 183 | calculateSpecifiedCoupons(chargeContext); |
183 | break; | 184 | break; |
185 | + } | ||
184 | default: | 186 | default: |
185 | throw new UfoServiceException(500, "unknown chargeStage " + chargeParam.getChargeStage()); | 187 | throw new UfoServiceException(500, "unknown chargeStage " + chargeParam.getChargeStage()); |
186 | } | 188 | } |
-
Please register or login to post a comment