Merge branch 'dev-coupon-recommend' into test6.9.6
Showing
1 changed file
with
5 additions
and
2 deletions
@@ -226,8 +226,11 @@ public class ChargeService { | @@ -226,8 +226,11 @@ public class ChargeService { | ||
226 | .collect(Collectors.toList()); | 226 | .collect(Collectors.toList()); |
227 | 227 | ||
228 | if (CollectionUtils.isNotEmpty(betterShippingCouponMatchResults)) { | 228 | if (CollectionUtils.isNotEmpty(betterShippingCouponMatchResults)) { |
229 | - //存在金额 >= 运费的券,按照金额从小到大的顺序 | ||
230 | - betterShippingCouponMatchResults.sort(Comparator.comparing(result -> result.getUserCouponsBo().getCouponAmount())); | 229 | + //存在金额 >= 运费的券,按照 从小到大,过期先用 排序 |
230 | + betterShippingCouponMatchResults.sort( | ||
231 | + Comparator.comparing((CouponMatchResult result) -> result.getUserCouponsBo().getCouponAmount()) | ||
232 | + .thenComparing((CouponMatchResult result) -> result.getUserCouponsBo().getEndTime()) | ||
233 | + ); | ||
231 | 234 | ||
232 | betterCouponMatchResults = new LinkedList<>(activityCouponMatchResults); | 235 | betterCouponMatchResults = new LinkedList<>(activityCouponMatchResults); |
233 | betterCouponMatchResults.addAll(betterShippingCouponMatchResults); | 236 | betterCouponMatchResults.addAll(betterShippingCouponMatchResults); |
-
Please register or login to post a comment