智慧保安后台管理-外网项目备份
guoshilong
2024-01-20 5e3faa196ec93a8d1b983f50b3cd30d98c4e708a
返回完整部门名
3 files modified
33 ■■■■■ changed files
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 2 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 25 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/vo/UserVO.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -46,6 +46,7 @@
        <result column="soil" property="soil"/>
        <result column="reason_for_leav" property="reasonForLeav"/>
        <result column="accreditationStatus" property="accreditationStatus"/>
        <result column="ancestors" property="ancestors"/>
    </resultMap>
    <!--带坐标-->
@@ -58,6 +59,7 @@
        bud.unit_name,
        bud.permanent_residence_address as registered,
        bd.dept_name,
        bd.ancestors,
        CASE WHEN sar.audit_status is not null THEN sar.audit_status ELSE -1 END AS accreditationStatus
        from
        blade_user bu
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -196,6 +196,11 @@
            //机构名称拼接
            userVOS.forEach(userVO -> {
                if (null!=userVO.getDeptId()) {
                    List<String> deptNameList = SysCache.getDeptNames(userVO.getAncestors()+","+userVO.getDeptId());
                    userVO.setFullDeptName(getFullDeptName(deptNameList));
                    List<String> list = baseMapper.getDeptName(userVO.getDeptId());
                    if (list.size() > 1) {
                        if (null != list.get(1) && list.get(1) != "") {
@@ -213,12 +218,32 @@
                    if (list.size() == 1) {
                        userVO.setDeptName(list.get(0));
                    }
                }
            });
            return page.setRecords(userVOS);
        }
    }
    private String getFullDeptName(List<String> deptNameList) {
        String fullDeptName = "";
        if (deptNameList.size()>1){
            //多级
            if (StringUtil.isNotBlank(deptNameList.get(0))){
                //本市保安公司  xxx  xxx xxx
                String first = deptNameList.get(0);
                if (first.equals("本市保安公司") || first.equals("保安培训学校") || first.equals("自招保安单位") || first.equals("武装押运公司") || first.equals("分公司") || first.equals("其他")){
                    deptNameList.remove(0);
                    fullDeptName = StringUtil.join(deptNameList,",");
                }
            }
        }
        return fullDeptName;
    }
    @Override
    public IPage<UserVO> selectUserPage(IPage<UserVO> page, User user, Long deptId, String tenantId) {
        List<Long> deptIdList = SysCache.getDeptChildIds(deptId);
src/main/java/org/springblade/modules/system/vo/UserVO.java
@@ -190,4 +190,10 @@
    //证书申请状态
    private String accreditationStatus;
    //机构父级
    private String ancestors;
    //完整的机构
    private String fullDeptName;
}