|
|
@@ -189,11 +189,20 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
|
|
|
if(token!=null){
|
|
|
throw new CustomException("请勿频繁操作");
|
|
|
}
|
|
|
- redisCache.setCacheObject(redsKey, redsKey, 3, TimeUnit.SECONDS);
|
|
|
+ redisCache.setCacheObject(redsKey, redsKey, 4, TimeUnit.SECONDS);
|
|
|
UserSubscribe add = BeanUtil.toBean(bo, UserSubscribe.class);
|
|
|
if(Validator.isEmpty(add.getOrderGoodsId())){
|
|
|
throw new CustomException("缺失订单商品ID");
|
|
|
}
|
|
|
+ ExamApplyQueryBo applyQueryBo = new ExamApplyQueryBo();
|
|
|
+ applyQueryBo.setUserId(bo.getUserId());
|
|
|
+ //查询剩余考试次数
|
|
|
+ Integer residueSubscribeNext = examApplyMapper.residueSubscribeNext(applyQueryBo);
|
|
|
+ if (residueSubscribeNext == null || residueSubscribeNext < 1){
|
|
|
+ throw new CustomException("考试次数不足");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//判断当前时间是否超过了选择时间
|
|
|
Date date = new Date();
|
|
|
Long times = add.getApplySiteExamTime()*1000;//时间戳
|