|
@@ -6,9 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.DateUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
import com.zhongzheng.common.utils.ServletUtils;
|
|
import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
|
|
import com.zhongzheng.modules.exam.bo.ExamNumberGoodsQueryBo;
|
|
-import com.zhongzheng.modules.exam.vo.ExamApplySiteTimeVo;
|
|
|
|
-import com.zhongzheng.modules.exam.vo.ExamApplySiteVo;
|
|
|
|
-import com.zhongzheng.modules.exam.vo.ExamNumberGoodsVo;
|
|
|
|
|
|
+import com.zhongzheng.modules.exam.vo.*;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
import io.swagger.annotations.ApiModelProperty;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
@@ -20,7 +18,6 @@ import com.zhongzheng.modules.exam.bo.ExamApplyQueryBo;
|
|
import com.zhongzheng.modules.exam.bo.ExamApplyEditBo;
|
|
import com.zhongzheng.modules.exam.bo.ExamApplyEditBo;
|
|
import com.zhongzheng.modules.exam.domain.ExamApply;
|
|
import com.zhongzheng.modules.exam.domain.ExamApply;
|
|
import com.zhongzheng.modules.exam.mapper.ExamApplyMapper;
|
|
import com.zhongzheng.modules.exam.mapper.ExamApplyMapper;
|
|
-import com.zhongzheng.modules.exam.vo.ExamApplyVo;
|
|
|
|
import com.zhongzheng.modules.exam.service.IExamApplyService;
|
|
import com.zhongzheng.modules.exam.service.IExamApplyService;
|
|
|
|
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
@@ -171,4 +168,43 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
|
|
examApplyVo.setGoodsId(array);
|
|
examApplyVo.setGoodsId(array);
|
|
return examApplyVo;
|
|
return examApplyVo;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public ExamUserApplyVo subscribe(ExamApplyQueryBo bo) {
|
|
|
|
+ Integer countGradePeriod = baseMapper.countGradePeriod(bo);
|
|
|
|
+ if (countGradePeriod < 1){
|
|
|
|
+ throw new IllegalArgumentException("学时审核未通过,不可以报名参加考试");
|
|
|
|
+ }
|
|
|
|
+ Integer countSubscribe = baseMapper.countSubscribe(bo);
|
|
|
|
+ if (countSubscribe > 1){
|
|
|
|
+ throw new IllegalArgumentException("考试已通过,不需要重考");
|
|
|
|
+ }
|
|
|
|
+ Integer countHaveSubscribe = baseMapper.countHaveSubscribe(bo);
|
|
|
|
+ if (countSubscribe > 1){
|
|
|
|
+ throw new IllegalArgumentException("您所报考的专业,已经预约成功,您可在“我的-我的考试预约”中查询详情");
|
|
|
|
+ }
|
|
|
|
+ ExamUserApplyVo examUserApplyVo = baseMapper.selectExamUserApplyVo(bo);
|
|
|
|
+ if (examUserApplyVo == null){
|
|
|
|
+ throw new IllegalArgumentException("商品无考试计划,无需预约考试");
|
|
|
|
+ }
|
|
|
|
+ return examUserApplyVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Long subscribeNext(ExamApplyQueryBo bo) {
|
|
|
|
+ Integer countHaveSubscribeNext = baseMapper.countHaveSubscribeNext(bo);
|
|
|
|
+ if (bo.getApplyStatus() == 1 && countHaveSubscribeNext > 0){
|
|
|
|
+ throw new IllegalArgumentException("系统检索到您不符合【非补考学员】的报名条件,请重新选择!");
|
|
|
|
+ }
|
|
|
|
+ //查询剩余考试次数
|
|
|
|
+ Integer residueSubscribeNext = baseMapper.residueSubscribeNext(bo);
|
|
|
|
+ if (residueSubscribeNext < 1){
|
|
|
|
+ return 3L;
|
|
|
|
+ }
|
|
|
|
+ Integer beforeSubscribeNext = baseMapper.beforeSubscribeNext(bo);
|
|
|
|
+ if (beforeSubscribeNext > 0){
|
|
|
|
+ return 1L;
|
|
|
|
+ }
|
|
|
|
+ return 2L;
|
|
|
|
+ }
|
|
}
|
|
}
|