|
@@ -3,6 +3,8 @@ package com.qs.mp.web.controller.api.channel;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
+import com.qs.mp.admin.domain.CouponChannel;
|
|
|
+import com.qs.mp.admin.service.ICouponChannelService;
|
|
|
import com.qs.mp.channel.domain.ChannelCouponVerifyLog;
|
|
|
import com.qs.mp.channel.service.IChannelCouponVerifyLogService;
|
|
|
import com.qs.mp.channel.service.IChannelService;
|
|
@@ -56,6 +58,9 @@ public class ChannelCouponVerifyController extends BaseApiController {
|
|
|
@Autowired
|
|
|
private MapperFacade mapperFacade;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ICouponChannelService couponChannelService;
|
|
|
+
|
|
|
/**
|
|
|
* 优惠券查询
|
|
|
*
|
|
@@ -102,7 +107,13 @@ public class ChannelCouponVerifyController extends BaseApiController {
|
|
|
.eq(UserCouponChannel::getUserCouponId, userCoupon.getId())
|
|
|
.eq(UserCouponChannel::getChannelId, channelId));
|
|
|
if (null == couponChannel) {
|
|
|
- result = error("无权核销该券");
|
|
|
+
|
|
|
+ int count = couponChannelService.count(new LambdaQueryWrapper<CouponChannel>()
|
|
|
+ .eq(CouponChannel::getCouponId, userCoupon.getCouponId())
|
|
|
+ .eq(CouponChannel::getChannelId, channelId));
|
|
|
+ if (count <= 0) {
|
|
|
+ result = error("无权核销该券");
|
|
|
+ }
|
|
|
}
|
|
|
return result;
|
|
|
}
|