|
@@ -5,9 +5,11 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.ym.mec.auth.api.client.SysUserFeignService;
|
|
|
import com.ym.mec.auth.api.entity.SysUser;
|
|
|
import com.ym.mec.biz.dal.dao.TempLittleArtistTrainingCampUserRelationDao;
|
|
|
+import com.ym.mec.biz.dal.entity.Student;
|
|
|
import com.ym.mec.biz.dal.entity.SysConfig;
|
|
|
import com.ym.mec.biz.dal.entity.TempLittleArtistTrainingCampUserRelation;
|
|
|
import com.ym.mec.biz.dal.vo.TempCampUserQualificationsVo;
|
|
|
+import com.ym.mec.biz.service.StudentService;
|
|
|
import com.ym.mec.biz.service.SysConfigService;
|
|
|
import com.ym.mec.biz.service.TempLittleArtistTrainingCampService;
|
|
|
import com.ym.mec.biz.service.TempLittleArtistTrainingCampUserRelationService;
|
|
@@ -46,6 +48,9 @@ public class TempLittleArtistTrainingCampUserRelationServiceImpl extends Service
|
|
|
@Autowired
|
|
|
private RedissonClient redissonClient;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private StudentService studentService;
|
|
|
+
|
|
|
@Override
|
|
|
public TempLittleArtistTrainingCampUserRelationDao getDao() {
|
|
|
return this.baseMapper;
|
|
@@ -60,6 +65,13 @@ public class TempLittleArtistTrainingCampUserRelationServiceImpl extends Service
|
|
|
@Override
|
|
|
public void add(Integer campId) {
|
|
|
SysUser user = getUser();
|
|
|
+
|
|
|
+ //只有VIP报名
|
|
|
+ Student student = studentService.get(user.getId());
|
|
|
+ if (student == null || student.getMembershipEndTime() == null ||student.getMembershipEndTime().compareTo(new Date()) < 0) {
|
|
|
+ throw new BizException("仅团练宝学员可报名");
|
|
|
+ }
|
|
|
+
|
|
|
RBucket<Object> addCamp = redissonClient.getBucket("TEMP:CAMP_ADD:" + user.getId());
|
|
|
if (!addCamp.trySet(1, 10, TimeUnit.SECONDS)) {
|
|
|
throw new BizException("正在登记训练营,请勿重复提交");
|