智慧保安后台管理-外网
Administrator
2021-11-17 7293f04d18fb2e882e152f962c3aa1d8fcb1f93e
src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java
@@ -33,7 +33,10 @@
import org.springblade.modules.exam.service.ExamPaperService;
import org.springblade.modules.exam.vo.ExamPaperSubjectVO;
import org.springblade.modules.exam.vo.ExamPaperVO;
import org.springblade.modules.exam.vo.ExamSubjectChoicesVO;
import org.springblade.modules.exam.wrapper.ExamPaperWrapper;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.training.entity.TrainExam;
import org.springblade.modules.training.entity.TrainingRegistration;
import org.springblade.modules.training.service.TrainingRegistrationService;
@@ -60,6 +63,9 @@
   private final TrainingRegistrationService trainingRegistrationService;
   private final IUserService userService;
   /**
@@ -194,8 +200,8 @@
   @GetMapping("/queryRandomSubject")
   @ApiOperationSupport(order = 8)
   @ApiOperation(value = "考试题目绑定", notes = "传入exam")
   public R<List> queryRandomSubject(@ApiParam(value = "主键集合") ExamPaper exam) {
      List<ExamPaperSubjectVO> subject = examPaperService.queryRandomSubject(exam);
   public R<List> queryRandomSubject(@ApiParam(value = "主键集合") ExamPaperVO exam) {
      List<ExamSubjectChoicesVO> subject = examPaperService.queryRandomSubject(exam);
      return R.data(subject);
   }
@@ -271,6 +277,16 @@
                  //审核通过,则生成准考证号
                  if (examPaper.getAuditStatus()==1) {
                     trainingRegistration.setAuditStatus(1);
                     //查询当前用户审核状态,如果异常,则审核不通过
                     User user = userService.getById(trainingRegistration.getUserId());
                     if (null!=user){
                        if (null!=user.getExaminationType() && !user.getExaminationType().equals("")){
                           if (user.getExaminationType().equals("1")){
                              //审核不通过
                              trainingRegistration.setAuditStatus(2);
                           }
                        }
                     }
                     //生成准考证号
                     trainingRegistration.setCandidateNo(getCandidateNo(examPaper));
                  }
@@ -327,6 +343,8 @@
         }
         if (month<=9){
            months = "0" + month;
         }else {
            months = String.valueOf(month);
         }
         if (day<=9){
            days = "0" + day;
@@ -341,8 +359,8 @@
            type = "m";
         }
         //获取考试名称前缀,去除数字,字母
         String examName
            = examPaper.getExamName().replaceAll("\\s*", "").replaceAll("[^(\\u4e00-\\u9fa5)]", "").substring(0,1);
//         String examName
//            = examPaper.getExamName().replaceAll("\\s*", "").replaceAll("[^(\\u4e00-\\u9fa5)]", "").substring(0,1);
         //前缀 = 年的最后两位  + 月份(两位) + 考试名称(中文拼音)首字母(去除数字,字母) + 考试类型 + 季度拼音首字母大写(春季就是 C)
//         String result = year
@@ -370,5 +388,16 @@
   }
   /**
    * 考试中页面刷新,1查询所有的答题信息,2查询所有的已答信息  3其他信息
    * @param examPaperVO 必须包含 scoreId
    * @return
    */
   @GetMapping("/getExamRefreshInfo")
   public R getExamRefreshInfo(ExamPaperVO examPaperVO){
      return R.data(examPaperService.getExamRefreshInfo(examPaperVO));
   }
}