智慧保安后台管理-外网-验收版本
tangzy
2021-07-26 a05af1da676dac2cb8a952a38f40d93be626cbf7
1.装备管理
6 files modified
89 ■■■■■ changed files
src/main/java/org/springblade/common/config/BladeConfiguration.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/controller/UserController.java 10 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.java 4 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml 58 ●●●●● 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 8 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/config/BladeConfiguration.java
@@ -66,6 +66,10 @@
        secureRegistry.excludePathPatterns("/recordk/**");
        secureRegistry.excludePathPatterns("/jurisdiction/**");
        secureRegistry.excludePathPatterns("/permit/**");
        secureRegistry.excludePathPatterns("/car/**");
        secureRegistry.excludePathPatterns("/gun/**");
        secureRegistry.excludePathPatterns("/equipage/**");
        secureRegistry.excludePathPatterns("/blade-user/**");
        return secureRegistry;
    }
src/main/java/org/springblade/modules/system/controller/UserController.java
@@ -315,4 +315,14 @@
        return R.data(userService.selectUserSearch(user, query));
    }
    /**
     * 自定义用户列表(只有保安员)
     */
    @GetMapping("/page-security")
    public R<IPage<UserVO>> pageSecurity(@ApiIgnore User user, Query query, Long deptId, BladeUser bladeUser) {
        user.setAccount("admin");
        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));
    }
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.java
@@ -67,4 +67,8 @@
     * @return
     */
    User getUserInfoByIdCardNo(String idCardNo);
    /**
     * 自定义用户列表(只有保安员)
     */
    List<User> selectUserPageSecurity(IPage<User> page, @Param("user") User user, @Param("deptIdList") List<Long> deptIdList, @Param("tenantId") String tenantId);
}
src/main/java/org/springblade/modules/system/mapper/UserMapper.xml
@@ -120,5 +120,63 @@
        blade_user
        where cardid = #{param1}
    </select>
    <!--保安员列表-->
    <select id="selectUserPageSecurity" resultMap="userResultMap">
        select
        bu.*
        from
        blade_user bu
        left join
        blade_dept bd
        on
        bu.dept_id = bd.id
        where
        bu.is_deleted = 0
        and
        bd.dept_category = 1
        <if test="user.tenantId!=null and user.tenantId != ''">
            and bu.tenant_id = #{user.tenantId}
        </if>
        <if test="user.account!=null and user.account != ''">
            and bu.account != #{user.account}
        </if>
        <if test="user.realName!=null and user.realName != ''">
            and bu.real_name like concat(concat('%', #{user.realName}),'%')
        </if>
        <if test="user.userType!=null and user.userType != ''">
            and bu.user_type = #{user.userType}
        </if>
        <if test="user.nativeplace!=null and user.nativeplace != ''">
            and bu.nativeplace = #{user.nativeplace}
        </if>
        <if test="user.sex!=null and user.sex != ''">
            and bu.sex = #{user.sex}
        </if>
        <if test="user.status!=null and user.status != ''">
            and bu.status = #{user.status}
        </if>
        <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>
        <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 (
            SELECT
            user_id
            FROM
            blade_user_dept
            WHERE
            dept_id IN
            <foreach collection="deptIdList" index="index" item="item" open="(" separator="," close=")">
                #{item}
            </foreach>
            )
        </if>
        ORDER BY bu.id
    </select>
</mapper>
src/main/java/org/springblade/modules/system/service/IUserService.java
@@ -19,6 +19,7 @@
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.springblade.core.mp.base.BaseService;
import org.springblade.core.mp.support.Query;
import org.springblade.modules.auth.enums.UserEnum;
@@ -213,4 +214,8 @@
     * @return
     */
    User getUserInfoByIdCardNo(String idCardNo);
    /**
     * 自定义用户列表(只有保安员)
     */
    IPage<User> selectUserPageSecurity(IPage<User> page, User user, Long deptId, String s);
}
src/main/java/org/springblade/modules/system/service/impl/UserServiceImpl.java
@@ -431,4 +431,12 @@
    public User getUserInfoByIdCardNo(String idCardNo) {
        return baseMapper.getUserInfoByIdCardNo(idCardNo);
    }
    @Override
    public IPage<User> selectUserPageSecurity(IPage<User> page, User user, Long deptId, String tenantId) {
        List<Long> deptIdList = SysCache.getDeptChildIds(deptId);
        return page.setRecords(baseMapper.selectUserPageSecurity(page, user, deptIdList, tenantId));
    }
}