智慧保安后台管理-外网-验收版本
1.用户新增角色关联持证字段
2.新增接口,考试开始,修改考试的状态为考试中
3.考试查询接口修改
7 files modified
79 ■■■■■ changed files
src/main/java/org/springblade/modules/apply/controller/ApplyController.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/service/ApplyService.java 7 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java 28 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/vo/ExamPaperVO.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 13 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/controller/ApplyController.java
@@ -573,4 +573,16 @@
        return applyService.getSecurityApplyDetail(apply);
    }
    /**
     * 修改考试状态
     * @param apply 报名信息,包含userId,applyid
     * @return
     */
    @PostMapping("/updateApplyStatus")
    public void updateApplyStatus(@RequestBody ApplyVO apply){
        applyService.updateApplyStatus(apply);
    }
}
src/main/java/org/springblade/modules/apply/service/ApplyService.java
@@ -102,4 +102,11 @@
     * @return
     */
    ApplyVO getSecurityApplyDetail(ApplyVO apply);
    /**
     * 修改考试状态
     * @param apply 报名信息,包含userId,applyid
     * @return
     */
    void updateApplyStatus(ApplyVO apply);
}
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java
@@ -23,6 +23,8 @@
import org.springblade.modules.exam.service.ExamPaperService;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.training.entity.TrainingRegistration;
import org.springblade.modules.training.service.TrainingRegistrationService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -42,6 +44,8 @@
    private final ExamPaperService examPaperService;
    private final IUserService userService;
    private final TrainingRegistrationService trainingRegistrationService;
    /**
     * 自定义分页数据
@@ -395,4 +399,28 @@
    public ApplyVO getSecurityApplyDetail(ApplyVO apply) {
        return baseMapper.getSecurityApplyDetail(apply);
    }
    /**
     * 修改考试状态
     * @param apply 报名信息,包含userId,applyid
     * @return
     */
    @Override
    public void updateApplyStatus(ApplyVO apply) {
        //正式考
        if (apply.getExamType()==1){
            //考试中
            apply.setIsExam(3);
            baseMapper.updateById(apply);
        }
        //模拟考
        if (apply.getExamType()==2){
            TrainingRegistration trainingRegistration = new TrainingRegistration();
            trainingRegistration.setId(apply.getId());
            //考试中
            trainingRegistration.setIsExam(3);
            trainingRegistrationService.updateById(trainingRegistration);
        }
    }
}
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
@@ -134,8 +134,8 @@
    <!--查询考试人员考试信息-->
    <select id="getExamDetail" resultType="org.springblade.modules.exam.vo.ExamPaperVO">
        (select
            ke.id,ke.exam_name examName,
            sa.candidate_no candidateNo,
            ke.id,ke.exam_name examName,ke.exam_type examType,
            sa.candidate_no candidateNo,sa.id applyId,
            bu.real_name realName,bu.sex,bu.cardid idCardNo
        from
            ksxt_exam ke
@@ -156,8 +156,8 @@
        union all
        (select
            ke.id,ke.exam_name examName,
            str.candidate_no candidateNo,
            ke.id,ke.exam_name examName,ke.exam_type examType,
            str.candidate_no candidateNo,str.id applyId,
            bu.real_name realName,bu.sex,bu.cardid idCardNo
        from
            ksxt_exam ke
src/main/java/org/springblade/modules/exam/vo/ExamPaperVO.java
@@ -31,4 +31,9 @@
     * 性别 1 男  2 女
     */
    private Integer sex;
    /**
     * 考试 id
     */
    private Long applyId;
}
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -170,6 +170,19 @@
    //@PreAuth(RoleConstant.HAS_ROLE_ADMIN)
    public R submit(@Valid @RequestBody User user) throws Exception {
        CacheUtil.clear(USER_CACHE);
        //查询角色
        if (null!=user.getRoleId()){
            Role role = new Role();
            role.setId(Long.parseLong(user.getRoleId()));
            Role one = roleService.getOne(Condition.getQueryWrapper(role));
            if (one.getRoleAlias().equals("保安")){
                user.setHold("1");
            }
            if (one.getRoleAlias().equals("未持证保安")){
                user.setHold("2");
            }
        }
        return R.status(userService.submit(user));
    }
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -105,6 +105,9 @@
        <if test="user.securitynumber!=null and user.securitynumber != ''">
            and bu.securitynumber = #{user.securitynumber}
        </if>
        <if test="user.examinationType!=null and user.examinationType != ''">
            and bu.examination_type = #{user.examinationType}
        </if>
        <if test="deptIdList!=null and deptIdList.size>0">
            and bu.id in (
            SELECT
@@ -155,6 +158,9 @@
        <if test="user.securitynumber!=null and user.securitynumber != ''">
            and securitynumber = #{user.securitynumber}
        </if>
        <if test="user.examinationType!=null and user.examinationType != ''">
            and examination_type = #{user.examinationType}
        </if>
        <if test="deptIdList!=null and deptIdList.size>0">
            and id in (
            SELECT