| | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.dsh.activity.entity.Coupon; |
| | | import com.dsh.activity.entity.CouponStore; |
| | | import com.dsh.activity.entity.UserCoupon; |
| | | import com.dsh.activity.feignclient.model.CouponStuAvailableVo; |
| | | import com.dsh.activity.model.CouponListVo; |
| | | import com.dsh.activity.service.CouponStoreService; |
| | | import com.dsh.activity.service.ICouponService; |
| | | import com.dsh.activity.service.UserCouponService; |
| | | import com.dsh.activity.util.ResultUtil; |
| | |
| | | public class UserCouponController { |
| | | |
| | | @Autowired |
| | | private UserCouponService uconService; |
| | | |
| | | @Autowired |
| | | private ICouponService cService; |
| | | |
| | | @Autowired |
| | |
| | | |
| | | @Autowired |
| | | private UserCouponService userCouponService; |
| | | |
| | | |
| | | @Autowired |
| | | private CouponStoreService csServie; |
| | | |
| | | |
| | | |
| | |
| | | |
| | | List<CouponStuAvailableVo> availableVos = new ArrayList<>(); |
| | | |
| | | List<UserCoupon> list = uconService.list(new QueryWrapper<UserCoupon>() |
| | | List<UserCoupon> list = userCouponService.list(new QueryWrapper<UserCoupon>() |
| | | .eq("userId", appUserId) |
| | | .eq("status",1)); |
| | | if (list.size() > 0){ |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("/userCoupon/queryCouponOfStore") |
| | | public List<Integer> getCouponStoreIds(@RequestBody Integer couponId){ |
| | | try { |
| | | List<Integer> storeIds = new ArrayList<>(); |
| | | List<CouponStore> list = csServie.list(new QueryWrapper<CouponStore>() |
| | | .eq("couponId",couponId)); |
| | | if (list.size() > 0 ){ |
| | | storeIds = list.stream().map(CouponStore::getStoreId).collect(Collectors.toList()); |
| | | } |
| | | return storeIds; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | } |