| | |
| | | |
| | | UserCouponVo userCouponVo = new UserCouponVo(); |
| | | // 获取用户所有优惠券 |
| | | List<XpAppUserCoupon> couponList = xpAppUserCouponService.list(new LambdaQueryWrapper<XpAppUserCoupon>().eq(dto.getUserCouponId()!=null,XpAppUserCoupon::getId, dto.getUserCouponId()).eq(XpAppUserCoupon::getStatus, 1).eq(XpAppUserCoupon::getAppUserId,dto.getUserId()).apply("(FIND_IN_SET({0}, open_city_id) or open_city_id='0')", dto.getOpenCityId()) ); |
| | | List<XpAppUserCoupon> couponList = xpAppUserCouponService.list(new LambdaQueryWrapper<XpAppUserCoupon>() |
| | | .eq(dto.getUserCouponId()!=null,XpAppUserCoupon::getId, dto.getUserCouponId()).eq(XpAppUserCoupon::getStatus, 1) |
| | | .eq(XpAppUserCoupon::getAppUserId,dto.getUserId())); |
| | | if(couponList.isEmpty()){ |
| | | return R.ok(userCouponVo); |
| | | } |
| | |
| | | // phone = JSONObject.parseObject(data.toString()).getString("mobile"); |
| | | // } |
| | | XpAppUserCoupon coupon = xpAppUserCouponService.getById(couponId); |
| | | if(uid.equals(coupon.getAppUserId().toString())){ |
| | | if(Long.valueOf(uid).equals(coupon.getAppUserId())){ |
| | | XpAppUserCouponListVo vo = new XpAppUserCouponListVo(); |
| | | vo.setCouponId(coupon.getId().toString()); |
| | | vo.setTitle(coupon.getCouponName()); |