智慧保安后台管理-外网项目备份
Administrator
2021-09-27 345d17cf82e1bbc1fbfbeec10193c2bed59cd674
注册登录,车辆,装备,枪支,招聘,培训考试修改
21 files modified
237 ■■■■ changed files
src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/mapper/CarMapper.xml 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/mapper/EquipageMapper.xml 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/mapper/GunMapper.xml 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/vo/CarVo.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/equipage/vo/EquipageVo.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml 56 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recruitment/mapper/RecruitmentMapper.xml 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/recruitment/vo/RecruitmentVo.java 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/DeptController.java 11 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/DeptMapper.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml 37 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/IDeptService.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/DeptServiceImpl.java 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 8 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml 14 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/training/vo/TrainingRegistrationVo.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/auth/endpoint/BladeTokenEndPoint.java
@@ -88,11 +88,13 @@
        ITokenGranter granter = TokenGranterBuilder.getGranter(grantType);
        UserInfo userInfo = granter.grant(tokenParameter);
        if (userInfo == null || userInfo.getUser() == null && s.equals("0")) {
            return authInfo.set("error_description", "用户未审核");
        }
        if (userInfo == null || userInfo.getUser() == null && s.equals("2")) {
            return authInfo.set("error_description", "审核不通过");
        if (null!=s && s.equals("")) {
            if (s.equals("0")) {
                return authInfo.set("error_description", "用户未审核");
            }
            if (s.equals("2")) {
                return authInfo.set("error_description", "审核不通过");
            }
        }
        if (userInfo == null || userInfo.getUser() == null ) {
            return authInfo.set("error_code", HttpServletResponse.SC_BAD_REQUEST).set("error_description", "用户名或密码不正确");
src/main/java/org/springblade/modules/equipage/mapper/CarMapper.xml
@@ -12,8 +12,19 @@
            blade_dept bt
        ON
            sc.dept_id = bt.id
        left join
            sys_information si
        on
            si.departmentid = bt.id
        left join
            sys_jurisdiction sj
        on
            sj.id = si.jurisdiction
        WHERE
            1=1
        <if test="car.jurisdiction!=null and car.jurisdiction!='' and car.jurisdiction!='1372091709474910209'">
            and (sj.id = #{car.jurisdiction} or sj.parent_id = #{car.jurisdiction})
        </if>
        <if test="car.tenantName!=null and  car.tenantName!=''">
            and bt.dept_name like concat('%', #{car.tenantName},'%')
        </if>
src/main/java/org/springblade/modules/equipage/mapper/EquipageMapper.xml
@@ -12,8 +12,19 @@
            blade_dept bt
        ON
            se.dept_id = bt.id
        left join
        sys_information si
        on
        si.departmentid = bt.id
        left join
        sys_jurisdiction sj
        on
        sj.id = si.jurisdiction
        WHERE
            1=1
        <if test="equipage.jurisdiction!=null and equipage.jurisdiction!='' and equipage.jurisdiction!='1372091709474910209'">
            and (sj.id = #{equipage.jurisdiction} or sj.parent_id = #{equipage.jurisdiction})
        </if>
        <if test="equipage.tenantName!=null and  equipage.tenantName!=''">
            and bt.dept_name like concat('%', #{equipage.tenantName},'%')
        </if>
src/main/java/org/springblade/modules/equipage/mapper/GunMapper.xml
@@ -12,8 +12,19 @@
            blade_dept bt
        ON
            sg.dept_id = bt.id
        left join
        sys_information si
        on
        si.departmentid = bt.id
        left join
        sys_jurisdiction sj
        on
        sj.id = si.jurisdiction
        WHERE
            1=1
        <if test="gun.jurisdiction!=null and gun.jurisdiction!='' and gun.jurisdiction!='1372091709474910209'">
            and (sj.id = #{gun.jurisdiction} or sj.parent_id = #{gun.jurisdiction})
        </if>
        <if test="gun.tenantName!=null and  gun.tenantName!=''">
            and bt.dept_name like concat('%', #{gun.tenantName},'%')
        </if>
src/main/java/org/springblade/modules/equipage/vo/CarVo.java
@@ -15,4 +15,9 @@
     * 保安单位名称
     */
    private String tenantName;
    /**
     * 辖区
     */
    private String jurisdiction;
}
src/main/java/org/springblade/modules/equipage/vo/EquipageVo.java
@@ -12,4 +12,10 @@
public class EquipageVo extends Equipage implements Serializable {
    private String tenantName;
    /**
     * 辖区
     */
    private String jurisdiction;
}
src/main/java/org/springblade/modules/exam/controller/ExamPaperController.java
@@ -260,6 +260,7 @@
        FtpUtil.sqlFileUpload(s1);
        //查询当前考试已报名的人员培训报名数据集合
        List<TrainingRegistration> trainingRegistrations = examPaperService.getTrainList(examPaper.getId());
//        System.out.println("trainingRegistrations = " + trainingRegistrations);
        if (trainingRegistrations.size()>0) {
            trainingRegistrations.forEach(trainingRegistration -> {
                //生成准考证号
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.java
@@ -81,7 +81,7 @@
     * @param id 考试id
     * @return
     */
    List<TrainingRegistration> getTrainList(Long id);
    List<TrainingRegistration> getTrainList(@Param("id") Long id);
    /**
     * 使用考试名称匹配考试信息
src/main/java/org/springblade/modules/exam/mapper/ExamPaperMapper.xml
@@ -225,6 +225,7 @@
        and bu.is_train = 1
        and str.is_exam = 1
        and str.cancel = 1
        and str.train_exam_id = #{id}
    </select>
    <!--使用考试名称匹配考试信息-->
src/main/java/org/springblade/modules/information/mapper/InformationMapper.xml
@@ -61,15 +61,46 @@
        IFNULL(C.pnum ,0) as pnum
        FROM
        sys_information i
        LEFT JOIN ( SELECT COUNT( * ) AS znum, dept_id FROM blade_user WHERE
        ( role_id = '1412226235153731586' OR role_id = '1416733602219110402' ) AND
        status=1 GROUP BY dept_id ) A ON A.dept_id = i.departmentid
        LEFT JOIN ( SELECT COUNT( * ) AS cnum, dept_id FROM blade_user WHERE
        ( role_id = '1412226235153731586' OR role_id = '1416733602219110402' ) AND
        status=1 AND hold=1 GROUP BY dept_id ) B ON B.dept_id = i.departmentid
        LEFT JOIN ( SELECT COUNT( * ) AS pnum, dept_id FROM blade_user WHERE role_id = '1412226235153731586' AND
        status=1 AND dispatch=0 GROUP BY dept_id ) C ON C.dept_id = i.departmentid
        LEFT JOIN
        (
        SELECT COUNT( * ) AS znum, dept_id FROM blade_user
        WHERE 1=1
        and role_id = '1412226235153731586'
        and is_deleted = 0
        AND status=1
        GROUP BY dept_id
        ) A
        ON A.dept_id = i.departmentid
        LEFT JOIN
        (
        SELECT COUNT( * ) AS cnum, dept_id FROM blade_user
        WHERE 1=1
        and role_id = '1412226235153731586'
        and is_deleted = 0
        AND status=1
        AND hold=1
        GROUP BY dept_id
        ) B
        ON B.dept_id = i.departmentid
        LEFT JOIN
        (
        SELECT COUNT( * ) AS pnum, dept_id FROM blade_user
        WHERE 1=1
        and is_deleted = 0
        and role_id = '1412226235153731586'
        AND status=1
        AND dispatch=0
        GROUP BY dept_id
        ) C
        ON C.dept_id = i.departmentid
        left join
        sys_jurisdiction sj
        on
        sj.id = i.jurisdiction
        where 1=1
        <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'">
            and (sj.id=#{information.jurisdiction} or sj.parent_id=#{information.jurisdiction})
        </if>
        <if test="information.enterprisename!=null and information.enterprisename!=''">
            and i.enterpriseName like concat(concat('%', #{information.enterprisename}),'%')
        </if>
@@ -78,9 +109,6 @@
        </if>
        <if test="information.stats!=null and information.stats!=''">
            and i.stats=#{information.stats}
        </if>
        <if test="information.jurisdiction!=null and information.jurisdiction!='' and information.jurisdiction!='1372091709474910209'">
            and i.jurisdiction=#{information.jurisdiction}
        </if>
        <if test="information.departmentid!=null and information.departmentid!=''">
            and i.departmentid=#{information.departmentid}
@@ -150,11 +178,11 @@
        FROM
        (
        SELECT departmentid, jurisdiction FROM sys_information GROUP BY departmentid, jurisdiction ) H
        LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE u.examination_type = 0 and role_id =
        LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE (u.examination_type = 0 or
        u.examination_type is null) and role_id =
        '1412226235153731586' AND `status` = 1 AND is_deleted = 0 GROUP BY u.dept_id
        ) A ON H.departmentid = A.dept_id
        LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE (u.examination_type = 1 or
        u.examination_type is null ) and role_id = '1412226235153731586' AND `status` = 1 AND is_deleted = 0 GROUP BY
        LEFT JOIN ( SELECT COUNT(*) AS num, u.dept_id FROM blade_user u WHERE u.examination_type = 1  and role_id = '1412226235153731586' AND `status` = 1 AND is_deleted = 0 GROUP BY
        u.dept_id
        ) B ON H.departmentid = B.dept_id where 1=1
        <if test="jurisdiction!=null and jurisdiction!='' and jurisdiction!='1372091709474910209'">
src/main/java/org/springblade/modules/recruitment/mapper/RecruitmentMapper.xml
@@ -12,8 +12,19 @@
            blade_dept bt
        ON
            sr.dept_id = bt.id
        left join
            sys_information si
        on
            si.departmentid = bt.id
        left join
            sys_jurisdiction sj
        on
            sj.id = si.jurisdiction
        WHERE
            1=1
        <if test="recruitment.jurisdiction!=null and recruitment.jurisdiction!='' and recruitment.jurisdiction!='1372091709474910209'">
            and (sj.id = #{recruitment.jurisdiction} or sj.parent_id = #{recruitment.jurisdiction})
        </if>
        <if test="recruitment.tenantName!=null and  recruitment.tenantName!=''">
            and bt.dept_name like concat('%', #{recruitment.tenantName},'%')
        </if>
src/main/java/org/springblade/modules/recruitment/vo/RecruitmentVo.java
@@ -11,5 +11,13 @@
@Data
public class RecruitmentVo extends Recruitment implements Serializable {
    /**
     * 部门名称
     */
    private String tenantName;
    /**
     * 辖区
     */
    private String jurisdiction;
}
src/main/java/org/springblade/modules/system/controller/DeptController.java
@@ -130,6 +130,17 @@
        return R.data(tree);
    }
    /**
     * 懒加载获取部门树形结构,根据辖区查询
     */
    @GetMapping("/lazy-tree-jurisdiction")
    @ApiOperationSupport(order = 5)
    @ApiOperation(value = "懒加载树形结构", notes = "树形结构")
    public R<List<DeptVO>> lazyTreeJurisdiction(String jurisdiction, Long parentId) {
        List<DeptVO> tree = deptService.lazyTreeJurisdiction(jurisdiction,parentId);
        return R.data(tree);
    }
    /**
     * 懒加载获取部门树形结构(包含用户数据)
src/main/java/org/springblade/modules/system/mapper/DeptMapper.java
@@ -146,4 +146,9 @@
                                                      @Param("deptId") Long deptId,
                                                      @Param("jurisdiction")String jurisdiction);
    /**
     * 懒加载获取部门树形结构,根据辖区查询
     */
    List<DeptVO> lazyTreeJurisdiction(@Param("jurisdiction")String jurisdiction,
                                      @Param("deptId")Long parentId);
}
src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
@@ -618,4 +618,41 @@
    <select id="selDeptList" resultType="org.springblade.common.vo.DeptVo">
        select id ,dept_name deptName from blade_dept where is_deleted=0
    </select>
    <!--懒加载获取部门树形结构,根据辖区查询-->
    <select id="lazyTreeJurisdiction" resultMap="treeNodeResultMap" >
        SELECT
        DISTINCT
        dept.id,
        dept.parent_id,
        dept.dept_name AS title,
        dept.id AS "value",
        dept.id AS "key",
        (
        SELECT
        CASE WHEN count(1) > 0 THEN 1 ELSE 0 END
        FROM
        blade_dept
        WHERE
        parent_id = dept.id and is_deleted = 0
        ) AS "has_children"
        FROM
        blade_dept dept
        left join
        sys_information si
        on
        si.departmentid = dept.id
        left join
        sys_jurisdiction sj
        on
        sj.id = si.jurisdiction
        WHERE
        dept.is_deleted = 0
        <if test="param2!=null and param2!=0">
            and dept.parent_id = #{param2}
        </if>
        <if test="param1!=null and param1!='' and param1!='1372091709474910209'">
            and (sj.id = #{param1} or sj.parent_id = #{param1})
        </if>
    </select>
</mapper>
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -186,6 +186,7 @@
          and account = #{param2}
          and password = #{param3}
          and is_deleted = 0
          and status = 1
    </select>
    <select id="exportUser" resultType="org.springblade.modules.system.excel.UserExcel">
@@ -331,12 +332,17 @@
            blade_dept bd
            on
            bu.dept_id = bd.id
            left join
            blade_role br
            on
            br.id = bu.role_id
            where
            bu.is_deleted = 0
            and bu.status = 1
            and bu.examination_type != 1
            and (bu.examination_type != 1 or bu.examination_type is null)
            and (hold = 2 or hold = 3)
            and bd.id = #{user.deptId}
            and br.role_alias = '保安'
            <if test="user.examType==1">
                and bu.is_apply != 1
            </if>
src/main/java/org/springblade/modules/system/service/IDeptService.java
@@ -158,4 +158,9 @@
     * @return
     */
    List<TreeNodes> lazyTreeUsers(Integer type,Long deptId);
    /**
     * 懒加载获取部门树形结构,根据辖区查询
     */
    List<DeptVO> lazyTreeJurisdiction(String jurisdiction, Long parentId);
}
src/main/java/org/springblade/modules/system/service/impl/DeptServiceImpl.java
@@ -300,4 +300,13 @@
    public List<DeptVo> selDeptList() {
        return baseMapper.selDeptList();
    }
    /**
     * 懒加载获取部门树形结构,根据辖区查询
     */
    @Override
    public List<DeptVO> lazyTreeJurisdiction(String jurisdiction, Long parentId) {
        return ForestNodeMerger.merge(baseMapper.lazyTreeJurisdiction(jurisdiction,parentId));
    }
}
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -105,10 +105,10 @@
        if (Func.isNotEmpty(user.getPassword())) {
            user.setPassword(DigestUtil.encrypt(user.getPassword()));
        }
//        Integer userCount = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, tenantId).eq(User::getAccount, user.getAccount()));
//        if (userCount > 0 && Func.isEmpty(user.getId())) {
//            throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
//        }
        Integer userCount = baseMapper.selectCount(Wrappers.<User>query().lambda().eq(User::getTenantId, tenantId).eq(User::getAccount, user.getAccount()));
        if (userCount > 0 && Func.isEmpty(user.getId())) {
            throw new ServiceException(StringUtil.format("当前用户 [{}] 已存在!", user.getAccount()));
        }
        boolean b = save(user) && submitUserDept(user);
        String rtime = null;
        if (null != user.getRtime()) {
src/main/java/org/springblade/modules/training/mapper/TrainingRegistrationMapper.xml
@@ -32,7 +32,9 @@
            ke.id = sr.train_exam_id
        WHERE
            1=1
        and is_exam = 1
        <if test="trainingRegistration.isExam!=null">
            and is_exam = #{trainingRegistration.isExam}
        </if>
        <if test="trainingRegistration.trainingUnitId!=null and  trainingRegistration.trainingUnitId!=''">
            and sr.training_unit_id = #{trainingRegistration.trainingUnitId}
        </if>
@@ -54,13 +56,11 @@
        <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.cancel!=null">
            and sr.cancel = #{trainingRegistration.cancel}
        </if>
        <if test="trainingRegistration.cancel==2">
            and sr.cancel = 2
            and bu.is_train = 2
        <if test="trainingRegistration.isTrain!=null">
            and bu.is_train = #{trainingRegistration.isTrain}
        </if>
    </select>
src/main/java/org/springblade/modules/training/vo/TrainingRegistrationVo.java
@@ -104,4 +104,9 @@
     * 培训考试结束时间
     */
    private Date endTime;
    /**
     * 是否培训报名
     */
    private Integer isTrain;
}