|
|
@@ -54,7 +54,7 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
|
|
|
|
|
|
public CouponServiceImpl(UserService userService, @Lazy ActivityService activityService,
|
|
|
ActivityStationService activityStationService, UserCouponSender userCouponSender,
|
|
|
- UserCouponService userCouponService) {
|
|
|
+ @Lazy UserCouponService userCouponService) {
|
|
|
this.userService = userService;
|
|
|
this.activityService = activityService;
|
|
|
this.activityStationService = activityStationService;
|
|
|
@@ -131,18 +131,15 @@ public class CouponServiceImpl extends ServiceImpl<CouponMapper, Coupon> impleme
|
|
|
|
|
|
//已领取的标识出来
|
|
|
long userId = StpUtil.getLoginIdAsLong();
|
|
|
- if (CommUtil.isNotEmptyAndNull(res)&&userId>0) {
|
|
|
+ if (CommUtil.isNotEmptyAndNull(res) && userId > 0) {
|
|
|
List<Long> couponIdList = res.stream().map(BaseEntity::getId).toList();
|
|
|
List<UserCoupon> list = userCouponService.lambdaQuery().eq(UserCoupon::getUserId, userId).in(UserCoupon::getCouponId, couponIdList).list();
|
|
|
if (CommUtil.isNotEmptyAndNull(list)) {
|
|
|
-
|
|
|
- List<Long> userCouponIdList = list.stream().map(UserCoupon::getCouponId).toList();
|
|
|
- res.forEach(coupon->{
|
|
|
- coupon.setCollected(userCouponIdList.contains(coupon.getId()));
|
|
|
- });
|
|
|
+ List<Long> userCouponIdList = list.stream().map(UserCoupon::getCouponId).toList();
|
|
|
+ res.forEach(coupon -> {
|
|
|
+ coupon.setCollected(userCouponIdList.contains(coupon.getId()));
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
return new PageBean<>(res);
|
|
|
}
|