Browse Source

Merge branch 'dev-v5.2'

he2802 3 years ago
parent
commit
d7b8092f61

+ 8 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserSubscribeServiceImpl.java

@@ -194,6 +194,14 @@ public class UserSubscribeServiceImpl extends ServiceImpl<UserSubscribeMapper, U
         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;//时间戳