Administrator
2021-07-27 bb99e8923e36dbbc2639fcc0a1a1191e2221277d
新增保安员查询接口(根据组织机构
4 files modified
35 ■■■■ changed files
src/main/java/org/springblade/modules/system/controller/UserController.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 9 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/IUserService.java 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java 9 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -321,8 +321,20 @@
    @GetMapping("/page-security")
    public R<IPage<UserVO>> pageSecurity(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) {
        user.setAccount("admin");
        bladeUser.setTenantId("000000");
        IPage<User> pages = userService.selectUserPageSecurity(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId()));
        return R.data(UserWrapper.build().pageVO(pages));
    }
    /**
     * 自定义用户列表(只有保安员)
     */
    @GetMapping("/page-security-unit")
    public List<User> pageSecurityUnit(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) {
        user.setAccount("admin");
        bladeUser.setTenantId("000000");
        List<User> pages = userService.selectUserPageSecurityUnit(Condition.getPage(query), user, deptId, (bladeUser.getTenantId().equals(BladeConstant.ADMIN_TENANT_ID) ? StringPool.EMPTY : bladeUser.getTenantId()));
        return pages;
    }
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -149,6 +149,9 @@
        <if test="user.nativeplace!=null and user.nativeplace != ''">
            and bu.nativeplace = #{user.nativeplace}
        </if>
        <if test="user.deptId!=null and user.deptId != ''">
            and bu.dept_id = #{user.deptId}
        </if>
        <if test="user.sex!=null and user.sex != ''">
            and bu.sex = #{user.sex}
        </if>
@@ -158,13 +161,13 @@
        <if test="user.hold!=null and user.hold != ''">
            and bu.hold = #{user.hold}
        </if> <if test="user.jurisdiction!=null and user.jurisdiction != ''">
        and bu.jurisdiction = #{user.jurisdiction}
    </if>
            and bu.jurisdiction = #{user.jurisdiction}
        </if>
        <if test="user.securitynumber!=null and user.securitynumber != ''">
            and bu.securitynumber = #{user.securitynumber}
        </if>
        <if test="deptIdList!=null and deptIdList.size>0">
            and id in (
            and bu.id in (
            SELECT
            user_id
            FROM
src/main/java/org/springblade/modules/system/service/IUserService.java
@@ -218,4 +218,9 @@
     * 自定义用户列表(只有保安员)
     */
    IPage<User> selectUserPageSecurity(IPage<User> page, User user, Long deptId, String s);
    /**
     * 自定义用户列表(只有保安员),根据保安员查
     */
    List<User> selectUserPageSecurityUnit(IPage<User> page, User user, Long deptId, String s);
}
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -438,5 +438,12 @@
        return page.setRecords(baseMapper.selectUserPageSecurity(page, user, deptIdList, tenantId));
    }
    /**
     * 自定义用户列表(只有保安员),根据保安员查
     */
    @Override
    public List<User> selectUserPageSecurityUnit(IPage<User> page, User user, Long deptId, String tenantId) {
        List<Long> deptIdList = SysCache.getDeptChildIds(deptId);
        return baseMapper.selectUserPageSecurity(page, user, deptIdList, tenantId);
    }
}