|
|
@@ -7,7 +7,9 @@ import com.dk.common.infrastructure.enums.ErrorCodeEnum;
|
|
|
import com.dk.common.model.pojo.PageList;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
+import com.dk.oauth.entity.UserLogin;
|
|
|
import com.dk.oauth.infrastructure.convert.integral.CouponReceiveConvert;
|
|
|
+import com.dk.oauth.mapper.UserMapper;
|
|
|
import com.dk.oauth.mapper.integral.CouponMapper;
|
|
|
import com.dk.oauth.mapper.integral.CouponSendMapper;
|
|
|
import com.dk.oauth.mapper.integral.CouponUseMapper;
|
|
|
@@ -59,6 +61,9 @@ public class CouponReceiveService extends BaseService<CouponReceive> {
|
|
|
//优惠券
|
|
|
private CouponMapper couponMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private UserMapper userMapper;
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* @desc : 条件查询
|
|
|
@@ -78,6 +83,15 @@ public class CouponReceiveService extends BaseService<CouponReceive> {
|
|
|
*/
|
|
|
@Transactional(rollbackFor = {Exception.class})
|
|
|
public ResponseResultVO<?> insert(CouponReceiveVO couponReceiveVO) {
|
|
|
+
|
|
|
+ // 限制助力链接发出本人不可给自己助力 2024/08/01 刘尧
|
|
|
+ UserLogin userLogin = userMapper.selectById(couponReceiveVO.getUserIdForm());
|
|
|
+
|
|
|
+ if (userLogin.getUserWxid().equals(couponReceiveVO.getUserWxid())){
|
|
|
+ //助力链接发出者不能为自己助力
|
|
|
+ throw new BaseBusinessException(ErrorCodeEnum.USER_POWER_OWN.getCode(), ErrorCodeEnum.USER_POWER_OWN.getMessage());
|
|
|
+ }
|
|
|
+
|
|
|
//region 查询7日内已进行过优惠券助力
|
|
|
List<CouponReceiveResponse> couponReceiveResponses = couponReceiveMapper.selectByCond(new CouponReceiveQuery().setUserWxid(couponReceiveVO.getUserWxid()).setAssistFlag(true));
|
|
|
if (couponReceiveResponses != null && couponReceiveResponses.size() > 0) {
|