智慧保安后台管理-外网
Administrator
2021-08-17 65a7eb1292898e73f46cf8b4878a22023bec6b5c
成绩查询接口修改
6 files modified
112 ■■■■ changed files
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java 19 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml 58 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/controller/TrainingRegistrationController.java 16 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/service/impl/TrainingRegistrationServiceImpl.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java
@@ -292,25 +292,22 @@
        //正式考试
        if (apply.getApplyExamType()==1){
            ApplyPaPerVO applyPaPerVO = baseMapper.getApplyInfo(apply);
            String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[0];
            String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[1];
            String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getEndTime()).split(" ")[1];
            applyPaPerVO.setStringTime(time+" "+startTime.substring(0,startTime.length()-3) +"-"+ endTime.substring(0,endTime.length()-3));
//            String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[0];
//            String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[1];
//            String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getEndTime()).split(" ")[1];
            applyPaPerVO.setStringTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()));
            return applyPaPerVO;
        }
        //模拟考试
        if (apply.getApplyExamType()==2){
            ApplyPaPerVO applyPaPerVO = baseMapper.getTrainApplyInfo(apply);
            String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[0];
            String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[1];
            String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getEndTime()).split(" ")[1];
            applyPaPerVO.setStringTime(time+" "+startTime.substring(0,startTime.length()-3) +"-"+ endTime.substring(0,endTime.length()-3));
//            String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[0];
//            String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[1];
//            String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getEndTime()).split(" ")[1];
            applyPaPerVO.setStringTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()));
            return applyPaPerVO;
        }
        return null;
    }
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.java
@@ -26,6 +26,15 @@
    List<ExamScoreVO> selectExamScorePage(IPage page, @Param("examScore") ExamScoreVO examScore);
    /**
     * 自定义分页-模拟考试
     *
     * @param page  分页
     * @param examScore 实体
     * @return
     */
    List<ExamScoreVO> selectTrainExamScorePage(IPage page, @Param("examScore") ExamScoreVO examScore);
    /**
     * 详情
     *
     * @param examScore 考试成绩信息对象
src/main/java/org/springblade/modules/exam/mapper/ExamScoreMapper.xml
@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.springblade.modules.exam.mapper.ExamScoreMapper">
    <!--考试成绩分页信息-->
    <!--考试成绩分页信息-正式考试-->
    <select id="selectExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO">
        SELECT
         es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId,
@@ -57,6 +57,62 @@
        </if>
    </select>
    <!--考试成绩分页信息-模拟考试-->
    <select id="selectTrainExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO">
        SELECT
         es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId,
         es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified,
         ke.exam_name examName,
         bu.real_name securityName,company,bu.account,
         str.is_exam isExam,
         bd.dept_name companyName
        FROM
            exam_score es
        left join
            blade_user bu
        on
            es.user_id = bu.id
        left join
            blade_dept bd
        on
            bd.id = es.company
        left join
            ksxt_exam ke
        on
            ke.id = es.exam_id
        left join
            sys_training_registration str
        on
            str.user_id = bu.id
        WHERE
            1=1
        <if test="examScore.examName!=null and  examScore.examName!=''">
            and ke.exam_name like concat('%', #{examScore.examName},'%')
        </if>
        <if test="examScore.companyName!=null and  examScore.companyName!=''">
            and bd.dept_name like concat('%', #{examScore.companyName},'%')
        </if>
        <if test="examScore.securityName!=null and  examScore.securityName!=''">
            and bu.real_name like concat('%', #{examScore.securityName},'%')
        </if>
        <if test="examScore.userId!=null and  examScore.userId!=''">
            and es.user_id = #{examScore.userId}
        </if>
        <if test="examScore.isExam!=null and  examScore.isExam!=''">
            and str.is_exam = #{examScore.isExam}
        </if>
        <if test="examScore.examType!=null and  examScore.examType!=''">
            and ke.exam_type = #{examScore.examType}
        </if>
        <if test="examScore.candidateNo!=null and  examScore.candidateNo!=''">
            and es.candidate_no = #{examScore.candidateNo}
        </if>
        <if test="examScore.qualified!=null">
            and es.qualified = #{examScore.qualified}
        </if>
    </select>
    <!--考试成绩详情信息-->
    <select id="selectExamScoreInfo" resultType="org.springblade.modules.exam.vo.ExamScoreVO">
        SELECT
src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
@@ -61,6 +61,14 @@
     */
    @Override
    public IPage<ExamScoreVO> selectExamScorePage(IPage<ExamScoreVO> page, ExamScoreVO examScore) {
        if (null!=examScore.getExamType()){
            if (examScore.getExamType()==1){
                return page.setRecords(baseMapper.selectExamScorePage(page, examScore));
            }
            if (examScore.getExamType()==2){
                return page.setRecords(baseMapper.selectTrainExamScorePage(page, examScore));
            }
        }
        return page.setRecords(baseMapper.selectExamScorePage(page, examScore));
    }
src/main/java/org/springblade/modules/training/controller/TrainingRegistrationController.java
@@ -95,7 +95,7 @@
            if (1==user.getIsTrain()){
                return R.data(201,"已报名,不能重复报名");
            }
            if (2==user.getIsTrain()){
            if (2==user.getIsTrain()  || -1==user.getIsTrain()){
                //已报名
                trainingRegistration.setCancel(1);
                //默认为未考试状态
@@ -174,7 +174,7 @@
                user.setIsTrain(1);
                userService.updateById(user);
            }else {
                if (user.getIsTrain()==2) {
                if (user.getIsTrain()==2 || -1==user.getIsTrain()) {
                    TrainingRegistration trainingRegistration1 = new TrainingRegistration();
                    trainingRegistration1.setCancel(1);
                    //默认为未考试状态
@@ -407,17 +407,17 @@
     */
    @PostMapping("/batchExam")
    public R batchExam(@RequestParam String ids,
                       @RequestParam String examTime,
                       String examTime,
                       @RequestParam Date startTime,
                       @RequestParam Date endTime){
                       Date endTime){
        if (!ids.equals("")){
            List<String> list = Arrays.asList(ids.split(","));
            if (list.size()>0){
                ExamPaper examPaper = new ExamPaper();
                examPaper.setExamTime(examTime);
//                examPaper.setExamTime(examTime);
                examPaper.setExamType(2);
                examPaper.setStartTime(startTime);
                examPaper.setEndTime(endTime);
//                examPaper.setEndTime(endTime);
                Calendar instance = Calendar.getInstance();
                instance.setTime(startTime);
                int year = instance.get(Calendar.YEAR);
@@ -444,10 +444,10 @@
            if (applyIds.size()>0){
                //生成考试
                ExamPaper examPaper = new ExamPaper();
                examPaper.setExamTime(examTime);
//                examPaper.setExamTime(examTime);
                examPaper.setExamType(2);
                examPaper.setStartTime(startTime);
                examPaper.setEndTime(endTime);
//                examPaper.setEndTime(endTime);
                Calendar instance = Calendar.getInstance();
                instance.setTime(startTime);
                int year = instance.get(Calendar.YEAR);
src/main/java/org/springblade/modules/training/service/impl/TrainingRegistrationServiceImpl.java
@@ -95,7 +95,7 @@
                        user.setIsTrain(1);
                        userService.updateById(user);
                    }else {
                        if (2 == user.getIsTrain()) {
                        if (2 == user.getIsTrain()  || -1==user.getIsTrain()) {
                            trainingRegistration.setIsExam(1);
                            trainingRegistration.setCancel(1);
                            trainingRegistration.setTrainingTime(new Date());