智慧保安后台管理-外网-验收版本
Administrator
2021-09-13 0d99d26f39e055ee17fdbf2c5cbd1daf695c4310
报名新增,报名查询,报名清册,培训报名,培训报名查询修改
11 files modified
327 ■■■■ changed files
src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.java 17 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.xml 121 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/vo/ApplyVO.java 21 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherController.java 14 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/controller/InformationController.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/IInformationService.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 61 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml 45 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/vo/TrainingRegistrationVo.java 20 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.java
@@ -29,6 +29,15 @@
    List<ApplyVO> selectApplyPage(IPage page, @Param("apply") ApplyVO apply);
    /**
     * 自定义分页
     *
     * @param page  分页
     * @param apply 实体
     * @return
     */
    List<ApplyVO> selectApplyPageStatis(IPage page, @Param("apply") ApplyVO apply);
    /**
     * 详情
     *
     * @param apply 考试报名信息对象
@@ -95,14 +104,14 @@
     * @param id 考试id
     * @return
     */
    int getApplyDeatailNum(Long id);
    int getApplyDeatailNum(@Param("id") Long id);
    /**
     * 查询已报名的的人信息集合
     * @param id 考试id
     * @return
     */
    List<ApplyVO> getApplyDetailList(Long id);
    List<ApplyVO> getApplyDetailList(@Param("id") Long id);
    /**
     * 查询保安员个人报名信息
@@ -117,14 +126,14 @@
     * @param id 考试id
     * @return
     */
    int getTrainDeatailNum(Long id);
    int getTrainDeatailNum(@Param("id") Long id);
    /**
     * 查询已培训报名的的人信息集合
     * @param id 考试id
     * @return
     */
    List<ApplyVO> getTrainDetailList(Long id);
    List<ApplyVO> getTrainDetailList(@Param("id") Long id);
    /**
     * 查询报名信息,取最新的一条(即当前userId,)applyId最大的一条记录
src/main/java/org/springblade/modules/apply/mapper/ApplyMapper.xml
@@ -9,6 +9,7 @@
            sa.examination_type examinationType,sa.examination_mx examinationMx,
            ke.total_score paperScore,ke.exam_type examType,ke.start_time examTime,ke.exam_name examName,
            bu.real_name realName,bu.is_apply isApply, ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING(bu.cardid,7,4),0) age,
            bu.sex,bu.phone,bu.nativePlace,
            bd.dept_name deptName,bu.cardid idCardNo,"保安证" applyCard
        FROM
            sys_apply sa
@@ -17,7 +18,12 @@
        on
            sa.exam_id = ke.id
        left join
            blade_user bu
            (
                select * from blade_user where 1=1
                <if test="apply.deptId!=null and  apply.deptId!=''">
                    and dept_id = #{apply.deptId}
                </if>
            ) bu
        on
            sa.user_id = bu.id
        left join
@@ -27,8 +33,26 @@
        WHERE
            1=1
            and is_exam = 1
            and sa.apply_status = 2
        <if test="apply.applyStatus==2">
            and sa.exam_id is null
            and bu.is_apply = 1
            and sa.apply_status = 2
        </if>
        <if test="apply.applyStatus==4">
            and sa.apply_status = 4
        </if>
        <if test="apply.applyStatus==1">
            and
            (
             sa.exam_id is null
            and bu.is_apply = 1
            and sa.apply_status = 2
            )
            or
            (
             sa.apply_status = 4
            )
        </if>
        <if test="apply.realName!=null and  apply.realName!=''">
            and bu.real_name like concat('%', #{apply.realName},'%')
        </if>
@@ -38,24 +62,95 @@
        <if test="apply.userId!=null and  apply.userId!=''">
            and sa.user_id like concat('%', #{apply.userId},'%')
        </if>
        <if test="apply.idCardNo!=null and  apply.idCardNo!=''">
            and bu.cardid like concat('%', #{apply.idCardNo},'%')
        </if>
        <if test="apply.examinationType!=null and  apply.examinationType!=''">
            and sa.examination_type = #{apply.examinationType}
        </if>
        <if test="apply.deptId!=null and  apply.deptId!=''">
            and bu.dept_id = #{apply.deptId}
        </if>
        <if test="apply.applyStatus==2">
            and exam_id is null
        <if test="apply.applyExamType!=null">
            and apply_exam_type = #{apply.applyExamType}
        </if>
        <if test="apply.examId!=null">
            and sa.exam_id = #{apply.examId}
        </if>
        <if test="apply.beginTime!=null and apply.beginTime!=''">
            and sa.apply_time &gt;= #{apply.beginTime}
        </if>
        <if test="apply.overTime!=null and apply.overTime!=''">
            and sa.apply_time &lt;= #{apply.overTime}
        </if>
    </select>
    <!--考试报名分页信息 清册-->
    <select id="selectApplyPageStatis" resultType="org.springblade.modules.apply.vo.ApplyVO">
        SELECT
            sa.id,sa.apply_status applyStatus,sa.user_id userId,sa.candidate_no candidateNo,apply_time,exam_id examId,
            sa.examination_type examinationType,sa.examination_mx examinationMx,
            ke.total_score paperScore,ke.exam_type examType,ke.start_time examTime,ke.exam_name examName,
            bu.real_name realName,bu.is_apply isApply, ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING(bu.cardid,7,4),0) age,
            bu.sex,bu.phone,bu.nativePlace,
            bd.dept_name deptName,bu.cardid idCardNo,"保安证" applyCard
        FROM
            sys_apply sa
        left join
            ksxt_exam ke
        on
            sa.exam_id = ke.id
        left join
            (
                select * from blade_user where 1=1
                <if test="apply.deptId!=null and  apply.deptId!=''">
                    and dept_id = #{apply.deptId}
                </if>
            ) bu
        on
            sa.user_id = bu.id
        left join
            blade_dept bd
        on
            bd.id = bu.dept_id
        WHERE
            1=1
        <if test="apply.applyStatus==3">
            and sa.apply_status = 2
        </if>
        <if test="apply.applyStatus==4">
            and sa.apply_status = 4
            and bu.is_apply = 2
        </if>
        <if test="apply.realName!=null and  apply.realName!=''">
            and bu.real_name like concat('%', #{apply.realName},'%')
        </if>
        <if test="apply.deptName!=null and  apply.deptName!=''">
            and bd.dept_name like concat('%', #{apply.deptName},'%')
        </if>
        <if test="apply.userId!=null and  apply.userId!=''">
            and sa.user_id like concat('%', #{apply.userId},'%')
        </if>
        <if test="apply.idCardNo!=null and  apply.idCardNo!=''">
            and bu.cardid like concat('%', #{apply.idCardNo},'%')
        </if>
        <if test="apply.examinationType!=null and  apply.examinationType!=''">
            and sa.examination_type = #{apply.examinationType}
        </if>
        <if test="apply.deptId!=null and  apply.deptId!=''">
            and bu.dept_id = #{apply.deptId}
        </if>
        <if test="apply.applyExamType!=null">
            and apply_exam_type = #{apply.applyExamType}
        </if>
        <if test="apply.examId!=null">
            and sa.exam_id = #{apply.examId}
        </if>
        <if test="apply.beginTime!=null and apply.beginTime!=''">
            and sa.apply_time &gt;= #{apply.beginTime}
        </if>
        <if test="apply.overTime!=null and apply.overTime!=''">
            and sa.apply_time &lt;= #{apply.overTime}
        </if>
    </select>
@@ -291,10 +386,8 @@
        sa.user_id = bu.id
        WHERE
        1=1
        and is_exam = 1
        and sa.apply_status = 2
        and bu.is_apply = 1
        and sa.exam_id is not null
        and sa.exam_id = #{id}
    </select>
    <!-- 查询培训考试人数-->
@@ -309,10 +402,8 @@
        sr.user_id = bu.id
        WHERE
        1=1
        and is_exam = 1
        and sr.cancel = 1
        and bu.is_train = 1
        and sr.train_exam_id is not null
        and sr.train_exam_id = #{id}
    </select>
    <!--查询已报名的的人信息集合-->
@@ -338,10 +429,8 @@
        bd.id = bu.dept_id
        WHERE
        1=1
        and is_exam = 1
        and sa.apply_status = 2
        and bu.is_apply = 1
        and sa.exam_id is not null
        and sa.exam_id  = #{id}
    </select>
    <!--查询已培训报名的的人信息集合-->
@@ -367,10 +456,8 @@
        bd.id = bu.dept_id
        WHERE
        1=1
        and is_exam = 1
        and sr.cancel = 1
        and bu.is_train = 1
        and sr.train_exam_id is not null
        and sr.train_exam_id = #{id}
    </select>
src/main/java/org/springblade/modules/apply/service/impl/ApplyServiceImpl.java
@@ -65,6 +65,11 @@
     */
    @Override
    public IPage<ApplyVO> selectApplyPage(IPage<ApplyVO> page, ApplyVO apply) {
        if (null!=apply.getApplyStatus()){
            if(apply.getApplyStatus()==3){
                return page.setRecords(baseMapper.selectApplyPageStatis(page,apply));
            }
        }
        return page.setRecords(baseMapper.selectApplyPage(page, apply));
    }
src/main/java/org/springblade/modules/apply/vo/ApplyVO.java
@@ -119,4 +119,25 @@
     * 培训考试结束时间
     */
    private Date endTime;
    /**
     * 开始时间
     */
    private String beginTime;
    /**
     * 结束时间
     */
    private String overTime;
    /**
     * 电话
     */
    private String phone;
    /**
     * 籍贯
     */
    private String nativePlace;
}
src/main/java/org/springblade/modules/dispatcher/controller/DispatcherController.java
@@ -130,10 +130,20 @@
        dispatcher.setStatus(1);
        Boolean status = dispatcherService.updateById(dispatcher);
        //用户状态改变
        //查询当前用户的派遣记录,是否存在多条未结束派遣的
        Dispatcher dispatcher1 = new Dispatcher();
        dispatcher1.setUserIds(dispatcher.getUserIds());
        List<Dispatcher> dispatcherList = dispatcherService.list(Condition.getQueryWrapper(dispatcher1));
        User user = new User();
        if (dispatcherList.size()<1){
            //用户状态改变
            user.setDispatch("1");
        }else {
            //用户状态改变
            user.setDispatch("0");
        }
        user.setId(Long.parseLong(dispatcher.getUserIds()));
        user.setDispatch("1");
        userService.updateById(user);
        //内网同步
src/main/java/org/springblade/modules/information/controller/InformationController.java
@@ -121,6 +121,15 @@
        return R.data(pages);
    }
    /**
     * 培训公司信息查询,下拉
     */
    @GetMapping("/train-unit-tree")
    public List<InformationVO> trainUnitTree(InformationVO information) {
        List<InformationVO> pages = informationService.trainUnitTree(information);
        return pages;
    }
    /**
     * 新增
src/main/java/org/springblade/modules/information/service/IInformationService.java
@@ -72,4 +72,9 @@
     * @return
     */
    void importInfor(List<InforExcel> data, Boolean isCovered);
    /**
     * 培训公司信息查询,下拉
     */
    List<InformationVO> trainUnitTree(InformationVO information);
}
src/main/java/org/springblade/modules/information/service/impl/InformationServiceImpl.java
@@ -139,6 +139,15 @@
        return page.setRecords(baseMapper.securityPage(page, information));
    }
    /**
     * 培训公司信息查询,下拉
     */
    @Override
    public List<InformationVO> trainUnitTree(InformationVO information) {
        return baseMapper.securityPage(null, information);
    }
    @Override
    public void importInfor(List<InforExcel> data, Boolean isCovered) {
        data.forEach(InforExcel -> {
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -276,7 +276,7 @@
            and bu.dept_id = #{user.deptId}
        </if>
        <if test="user.isApply!=null">
            and sa.is_apply = #{user.isApply}
            and bu.is_apply = #{user.isApply}
        </if>
        <if test="user.roleId!=null and user.roleId != ''">
            and bu.role_id = #{user.roleId}
@@ -298,17 +298,50 @@
    <!--保安员列表树 安员列表树,帅选无保安证,下拉tree-->
<!--    <select id="getSecurityApplyTree" resultType="org.springblade.modules.system.node.TreeNode">-->
<!--        (-->
<!--            select #{user.deptId} as id,-->
<!--                bd2.dept_name as name,-->
<!--                0 as parentId-->
<!--                from blade_user bu2-->
<!--                left join-->
<!--                blade_dept bd2-->
<!--                on -->
<!--                bu2.dept_id = bd2.id-->
<!--        )-->
<!--        union all-->
<!--        (-->
<!--            select-->
<!--                distinct-->
<!--                bu.id,-->
<!--                bu.real_name as name,-->
<!--                #{user.deptId} parentId-->
<!--            from-->
<!--                blade_user bu-->
<!--            left join-->
<!--            blade_dept bd-->
<!--            on-->
<!--            bu.dept_id = bd.id-->
<!--            where-->
<!--            bu.is_deleted = 0-->
<!--            and bu.status = 1-->
<!--            and bu.examination_type != 1-->
<!--            and (hold = 2 or hold = 3)-->
<!--            and bd.id = #{user.deptId}-->
<!--            <if test="user.examType==1">-->
<!--                and bu.is_apply != 1-->
<!--            </if>-->
<!--            <if test="user.examType==2">-->
<!--                and bu.is_train != 1-->
<!--            </if>-->
<!--        )-->
<!--    </select>    -->
    <!--保安员列表树 安员列表树,帅选无保安证,下拉tree-->
    <select id="getSecurityApplyTree" resultType="org.springblade.modules.system.node.TreeNode">
        (
            select #{user.deptId} as id,
                '全部' as name,
                0 as parentId
                from blade_user
        )
        union all
        (
            select
                distinct
                bu.id,
@@ -332,7 +365,6 @@
            <if test="user.examType==2">
                and bu.is_train != 1
            </if>
        )
    </select>
@@ -397,6 +429,7 @@
    <select id="getUserDetails" resultType="org.springblade.modules.system.vo.UserVO">
        select
        bu.*,
        ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING( cardid,7,4),0) age,
        bd.dept_name deptName
         from
        blade_user bu
@@ -404,7 +437,9 @@
        blade_dept bd
        on
        bu.dept_id = bd.id
        where bu.id = #{user.id}
        where
        1=1
        and bu.id = #{user.id}
    </select>
    <!--获取派遣信息-->
src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml
@@ -5,10 +5,11 @@
    <!--报名培训分页信息-->
    <select id="selectTrainingRegistrationPage" resultType="org.springblade.modules.training.vo.TrainingRegistrationVo">
        SELECT
            sr.*,
            sr.id,sr.training_time trainingTime,sr.user_id userId,sr.cancel,
            bt.dept_name AS deptName,
            bt0.dept_name AS trainUnitName,
            bu.real_name realName,bu.phone,bu.cardid idCardNo,
            bu.real_name realName,bu.cardid idCardNo,ifnull(DATE_FORMAT(NOW(), '%Y') - SUBSTRING(bu.cardid,7,4),0) age,
            bu.sex,bu.phone,bu.nativePlace,
            ke.start_time trainExamTime,if(ke.audit_status=1,ke.exam_name,"") trainExamName,
            ke.exam_type examType,sr.audit_status auditStatus,
            "保安证" applyCard
@@ -19,7 +20,12 @@
        ON
            sr.training_unit_id = bt0.id
        left join
            blade_user bu
            (
                select * from blade_user where 1=1
                <if test="trainingRegistration.deptId!=null and  trainingRegistration.deptId!=''">
                    and dept_id = #{trainingRegistration.deptId}
                </if>
            ) bu
        on
            sr.user_id = bu.id
        LEFT JOIN
@@ -32,7 +38,21 @@
            ke.id = sr.train_exam_id
        WHERE
            1=1
        and is_exam = 1
        <if test="trainingRegistration.cancel==1">
            and sr.cancel = 1
            and bu.is_train = 1
        </if>
        <if test="trainingRegistration.cancel==2">
            and sr.cancel = 2
        </if>
        <if test="trainingRegistration.cancel==11">
            and (
            sr.cancel = 2
            )
            or
            (sr.cancel = 1
            and bu.is_train = 1)
        </if>
        <if test="trainingRegistration.trainingUnitId!=null and  trainingRegistration.trainingUnitId!=''">
            and sr.training_unit_id = #{trainingRegistration.trainingUnitId}
        </if>
@@ -41,6 +61,12 @@
        </if>
        <if test="trainingRegistration.userId!=null and  trainingRegistration.userId!=''">
            and sr.user_id = #{trainingRegistration.userId}
        </if>
        <if test="trainingRegistration.deptId!=null and  trainingRegistration.deptId!=''">
            and bu.dept_id = #{trainingRegistration.deptId}
        </if>
        <if test="trainingRegistration.idCardNo!=null and  trainingRegistration.idCardNo!=''">
            and bu.cardid like concat('%', #{trainingRegistration.idCardNo},'%')
        </if>
        <if test="trainingRegistration.auditStatus!=null and trainingRegistration.auditStatus!=0">
            and sr.audit_status = #{trainingRegistration.auditStatus}
@@ -51,14 +77,13 @@
        <if test="trainingRegistration.realName!=null and  trainingRegistration.realName!=''">
            and bu.real_name like concat('%', #{trainingRegistration.realName},'%')
        </if>
        <if test="trainingRegistration.cancel==1">
            and sr.cancel = 1
            and bu.is_train = 1
        <if test="trainingRegistration.beginTime!=null and trainingRegistration.beginTime!=''">
            and sr.training_time &gt;= #{trainingRegistration.beginTime}
        </if>
        <if test="trainingRegistration.cancel==2">
            and sr.cancel = 2
            and bu.is_train = 2
        <if test="trainingRegistration.overTime!=null and trainingRegistration.overTime!=''">
            and sr.training_time &lt;= #{trainingRegistration.overTime}
        </if>
        and is_exam = 1
    </select>
    <!--报名培训详情信息-->
src/main/java/org/springblade/modules/training/vo/TrainingRegistrationVo.java
@@ -104,4 +104,24 @@
     * 培训考试结束时间
     */
    private Date endTime;
    /**
     * 年龄
     */
    private Integer age;
    /**
     * 开始时间
     */
    private String beginTime;
    /**
     * 结束时间
     */
    private String overTime;
    /**
     * 籍贯
     */
    private String nativePlace;
}