Merge remote-tracking branch 'origin/master'
This commit is contained in:
		@@ -407,10 +407,12 @@ export default {
 | 
			
		||||
      // 表单校验
 | 
			
		||||
      rules: {
 | 
			
		||||
        userName: [
 | 
			
		||||
          { required: true,
 | 
			
		||||
          {
 | 
			
		||||
            required: true,
 | 
			
		||||
            pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
 | 
			
		||||
            message: "请输入正确的手机号码",
 | 
			
		||||
            trigger: "blur" }
 | 
			
		||||
            trigger: "blur"
 | 
			
		||||
          }
 | 
			
		||||
        ],
 | 
			
		||||
        nickName: [
 | 
			
		||||
          { required: true, message: "用户昵称不能为空", trigger: "blur" }
 | 
			
		||||
 
 | 
			
		||||
@@ -1,6 +1,8 @@
 | 
			
		||||
package com.ruoyi.project.system.controller;
 | 
			
		||||
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import com.ruoyi.project.common.SchoolCommon;
 | 
			
		||||
import org.springframework.beans.factory.annotation.Autowired;
 | 
			
		||||
import org.springframework.security.access.prepost.PreAuthorize;
 | 
			
		||||
import org.springframework.validation.annotation.Validated;
 | 
			
		||||
@@ -51,6 +53,9 @@ public class SysUserController extends BaseController
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private TokenService tokenService;
 | 
			
		||||
 | 
			
		||||
    @Autowired
 | 
			
		||||
    private SchoolCommon schoolCommon;
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 获取用户列表
 | 
			
		||||
     */
 | 
			
		||||
@@ -101,10 +106,25 @@ public class SysUserController extends BaseController
 | 
			
		||||
    public AjaxResult getInfo(@PathVariable(value = "userId", required = false) Long userId)
 | 
			
		||||
    {
 | 
			
		||||
        AjaxResult ajax = AjaxResult.success();
 | 
			
		||||
        if(schoolCommon.isSchool()==true)
 | 
			
		||||
        {
 | 
			
		||||
            ajax.put("roles", roleService.selectYeyRoleAll());
 | 
			
		||||
            ajax.put("posts", postService.selectYeyPostAll());
 | 
			
		||||
        }else {
 | 
			
		||||
            ajax.put("roles", roleService.selectRoleAll());
 | 
			
		||||
            ajax.put("posts", postService.selectPostAll());
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (StringUtils.isNotNull(userId))
 | 
			
		||||
        {
 | 
			
		||||
            if (schoolCommon.isSchool()==true)
 | 
			
		||||
            {
 | 
			
		||||
                ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId));
 | 
			
		||||
                ajax.put("postIds", postService.selectYeyPostListByUserId(userId));
 | 
			
		||||
                ajax.put("roleIds", roleService.selectYeyRoleListByUserId(userId));
 | 
			
		||||
            }else {
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            ajax.put(AjaxResult.DATA_TAG, userService.selectUserById(userId));
 | 
			
		||||
            ajax.put("postIds", postService.selectPostListByUserId(userId));
 | 
			
		||||
            ajax.put("roleIds", roleService.selectRoleListByUserId(userId));
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,9 @@ public interface SysPostMapper
 | 
			
		||||
     */
 | 
			
		||||
    public List<SysPost> selectPostAll();
 | 
			
		||||
 | 
			
		||||
    //查询所有幼儿园岗位
 | 
			
		||||
    public List<SysPost> selectYeyPostAll();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 通过岗位ID查询岗位信息
 | 
			
		||||
     * 
 | 
			
		||||
@@ -33,6 +36,8 @@ public interface SysPostMapper
 | 
			
		||||
     */
 | 
			
		||||
    public SysPost selectPostById(Long postId);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据用户ID获取岗位选择框列表
 | 
			
		||||
     * 
 | 
			
		||||
@@ -41,6 +46,9 @@ public interface SysPostMapper
 | 
			
		||||
     */
 | 
			
		||||
    public List<Integer> selectPostListByUserId(Long userId);
 | 
			
		||||
 | 
			
		||||
    //根据用户id获取幼儿园岗位
 | 
			
		||||
    public List<Integer> selectYeyPostListByUserId(Long userId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询用户所属岗位组
 | 
			
		||||
     * 
 | 
			
		||||
 
 | 
			
		||||
@@ -33,6 +33,9 @@ public interface SysRoleMapper
 | 
			
		||||
     */
 | 
			
		||||
    public List<SysRole> selectRoleAll();
 | 
			
		||||
 | 
			
		||||
    //查询所有幼儿园角色
 | 
			
		||||
    public List<SysRole> selectYeyRoleAll();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据用户ID获取角色选择框列表
 | 
			
		||||
     * 
 | 
			
		||||
@@ -41,6 +44,9 @@ public interface SysRoleMapper
 | 
			
		||||
     */
 | 
			
		||||
    public List<Integer> selectRoleListByUserId(Long userId);
 | 
			
		||||
 | 
			
		||||
    //根据用户ID获取幼儿园角色
 | 
			
		||||
    public List<Integer> selectYeyRoleListByUserId(Long userId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 通过角色ID查询角色
 | 
			
		||||
     * 
 | 
			
		||||
 
 | 
			
		||||
@@ -25,6 +25,9 @@ public interface ISysPostService
 | 
			
		||||
     */
 | 
			
		||||
    public List<SysPost> selectPostAll();
 | 
			
		||||
 | 
			
		||||
    //查询所有幼儿园岗位
 | 
			
		||||
    public List<SysPost> selectYeyPostAll();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 通过岗位ID查询岗位信息
 | 
			
		||||
     * 
 | 
			
		||||
@@ -41,6 +44,9 @@ public interface ISysPostService
 | 
			
		||||
     */
 | 
			
		||||
    public List<Integer> selectPostListByUserId(Long userId);
 | 
			
		||||
 | 
			
		||||
    //根据用户id获取幼儿园岗位
 | 
			
		||||
    public List<Integer> selectYeyPostListByUserId(Long userId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验岗位名称
 | 
			
		||||
     * 
 | 
			
		||||
 
 | 
			
		||||
@@ -34,6 +34,13 @@ public interface ISysRoleService
 | 
			
		||||
     */
 | 
			
		||||
    public List<SysRole> selectRoleAll();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询所有幼儿园用途标识角色
 | 
			
		||||
     *
 | 
			
		||||
     * @return 角色列表
 | 
			
		||||
     */
 | 
			
		||||
    public List<SysRole> selectYeyRoleAll();
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据用户ID获取角色选择框列表
 | 
			
		||||
     * 
 | 
			
		||||
@@ -42,6 +49,9 @@ public interface ISysRoleService
 | 
			
		||||
     */
 | 
			
		||||
    public List<Integer> selectRoleListByUserId(Long userId);
 | 
			
		||||
 | 
			
		||||
    //根据用户id获取幼儿园角色选择框
 | 
			
		||||
    public List<Integer> selectYeyRoleListByUserId(Long userId);
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 通过角色ID查询角色
 | 
			
		||||
     * 
 | 
			
		||||
 
 | 
			
		||||
@@ -48,6 +48,12 @@ public class SysPostServiceImpl implements ISysPostService
 | 
			
		||||
        return postMapper.selectPostAll();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<SysPost> selectYeyPostAll()
 | 
			
		||||
    {
 | 
			
		||||
        return postMapper.selectYeyPostAll();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 通过岗位ID查询岗位信息
 | 
			
		||||
     * 
 | 
			
		||||
@@ -71,6 +77,12 @@ public class SysPostServiceImpl implements ISysPostService
 | 
			
		||||
        return postMapper.selectPostListByUserId(userId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<Integer> selectYeyPostListByUserId(Long userId)
 | 
			
		||||
    {
 | 
			
		||||
        return postMapper.selectYeyPostListByUserId(userId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 校验岗位名称是否唯一
 | 
			
		||||
     * 
 | 
			
		||||
 
 | 
			
		||||
@@ -85,6 +85,16 @@ public class SysRoleServiceImpl implements ISysRoleService
 | 
			
		||||
        return roleMapper.selectRoleAll();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 查询所有幼儿园角色
 | 
			
		||||
     *
 | 
			
		||||
     * @return 角色列表
 | 
			
		||||
     */
 | 
			
		||||
    public List<SysRole> selectYeyRoleAll()
 | 
			
		||||
    {
 | 
			
		||||
        return roleMapper.selectYeyRoleAll();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 根据用户ID获取角色选择框列表
 | 
			
		||||
     * 
 | 
			
		||||
@@ -96,6 +106,13 @@ public class SysRoleServiceImpl implements ISysRoleService
 | 
			
		||||
        return roleMapper.selectRoleListByUserId(userId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    //根据用户id获取幼儿园角色
 | 
			
		||||
    @Override
 | 
			
		||||
    public List<Integer> selectYeyRoleListByUserId(Long userId)
 | 
			
		||||
    {
 | 
			
		||||
        return selectYeyRoleListByUserId(userId);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * 通过角色ID查询角色
 | 
			
		||||
     * 
 | 
			
		||||
 
 | 
			
		||||
@@ -42,6 +42,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		||||
		<include refid="selectPostVo"/>
 | 
			
		||||
	</select>
 | 
			
		||||
 | 
			
		||||
	<select id="selectYeyPostAll" resultMap="SysPostResult">
 | 
			
		||||
		<include refid="selectPostVo"/>
 | 
			
		||||
		where purp = '1'
 | 
			
		||||
	</select>
 | 
			
		||||
	
 | 
			
		||||
	<select id="selectPostById" parameterType="Long" resultMap="SysPostResult">
 | 
			
		||||
		<include refid="selectPostVo"/>
 | 
			
		||||
		where post_id = #{postId}
 | 
			
		||||
@@ -55,6 +60,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		||||
	    where u.user_id = #{userId}
 | 
			
		||||
	</select>
 | 
			
		||||
 | 
			
		||||
	<select id="selectYeyPostListByUserId" parameterType="Long" resultType="Integer">
 | 
			
		||||
		select p.post_id
 | 
			
		||||
        from sys_post p
 | 
			
		||||
	        left join sys_user_post up on up.post_id = p.post_id
 | 
			
		||||
	        left join sys_user u on u.user_id = up.user_id
 | 
			
		||||
	    where p.purp = '1' and u.user_id = #{userId}
 | 
			
		||||
	</select>
 | 
			
		||||
	
 | 
			
		||||
	<select id="selectPostsByUserName" parameterType="String" resultMap="SysPostResult">
 | 
			
		||||
		select p.post_id, p.post_name, p.post_code
 | 
			
		||||
		from sys_post p
 | 
			
		||||
 
 | 
			
		||||
@@ -60,6 +60,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		||||
		<include refid="selectRoleVo"/>
 | 
			
		||||
	</select>
 | 
			
		||||
 | 
			
		||||
	<select id="selectYeyRoleAll" resultMap="SysRoleResult">
 | 
			
		||||
		<include refid="selectRoleVo"/>
 | 
			
		||||
		where r.purpose = '1'
 | 
			
		||||
	</select>
 | 
			
		||||
	
 | 
			
		||||
	<select id="selectRoleListByUserId" parameterType="Long" resultType="Integer">
 | 
			
		||||
		select r.role_id
 | 
			
		||||
        from sys_role r
 | 
			
		||||
@@ -68,6 +73,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 | 
			
		||||
	    where u.user_id = #{userId}
 | 
			
		||||
	</select>
 | 
			
		||||
 | 
			
		||||
	<select id="selectYeyRoleListByUserId" parameterType="Long" resultType="Integer">
 | 
			
		||||
		select r.role_id
 | 
			
		||||
        from sys_role r
 | 
			
		||||
	        left join sys_user_role ur on ur.role_id = r.role_id
 | 
			
		||||
	        left join sys_user u on u.user_id = ur.user_id
 | 
			
		||||
	    where r.purpose = '1' and u.user_id = #{userId}
 | 
			
		||||
	</select>
 | 
			
		||||
	
 | 
			
		||||
	<select id="selectRoleById" parameterType="Long" resultMap="SysRoleResult">
 | 
			
		||||
		<include refid="selectRoleVo"/>
 | 
			
		||||
		where r.role_id = #{roleId}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user