|
@@ -3,10 +3,12 @@ package com.iamberry.wechat.service.thanksgiving;
|
|
|
import com.iamberry.wechat.core.entity.coupon.CouponItem;
|
|
|
import com.iamberry.wechat.core.entity.coupon.CouponItemDto;
|
|
|
import com.iamberry.wechat.core.entity.coupon.CouponType;
|
|
|
+import com.iamberry.wechat.core.entity.giftCard.UserMachineInfo;
|
|
|
import com.iamberry.wechat.core.entity.thanksgiving.ThanksGiving;
|
|
|
import com.iamberry.wechat.face.thanksgiving.ThanksGivingService;
|
|
|
import com.iamberry.wechat.service.mapper.CouponItemMapper;
|
|
|
import com.iamberry.wechat.service.mapper.CouponTypeMapper;
|
|
|
+import com.iamberry.wechat.service.mapper.MemberMapper;
|
|
|
import com.iamberry.wechat.service.mapper.ThanksGivingMapper;
|
|
|
import com.iamberry.wechat.tools.StrUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -30,6 +32,8 @@ public class ThanksGivingServiceImpl implements ThanksGivingService {
|
|
|
private CouponItemMapper couponItemMapper;
|
|
|
@Autowired
|
|
|
private CouponTypeMapper couponTypeMapper;
|
|
|
+ @Autowired
|
|
|
+ private MemberMapper memberMapper;
|
|
|
/**
|
|
|
* 获取集合
|
|
|
* @param thanksGiving
|
|
@@ -93,6 +97,7 @@ public class ThanksGivingServiceImpl implements ThanksGivingService {
|
|
|
throw new RuntimeException("创建优惠券失败");
|
|
|
}
|
|
|
|
|
|
+ //修改领取状态
|
|
|
thanksGiving.setCouponItemId(uuidStr);
|
|
|
thanksGiving.setThanksGivingStatus(2);
|
|
|
thanksGiving.setThanksGivingTime(new Date());
|
|
@@ -100,6 +105,12 @@ public class ThanksGivingServiceImpl implements ThanksGivingService {
|
|
|
if(flag < 1){
|
|
|
throw new RuntimeException("修改领取状态失败");
|
|
|
}
|
|
|
+
|
|
|
+ //修改会员信息,变成vip会员
|
|
|
+ flag = memberMapper.updateUserIsVip(thanksGiving.getThanksGivingOpenId());
|
|
|
+ if(flag < 1){
|
|
|
+ throw new RuntimeException("注册成为VIP会员状态失败");
|
|
|
+ }
|
|
|
return flag;
|
|
|
}
|
|
|
|