Commit 2041487a authored by nie'hong's avatar nie'hong

限制用户账号管理员数量

parent feaf1d19
...@@ -256,6 +256,7 @@ public class TUserController extends BaseController { ...@@ -256,6 +256,7 @@ public class TUserController extends BaseController {
map.put("is_deleted", false); map.put("is_deleted", false);
map.put("role_id", user.getRoleId()); map.put("role_id", user.getRoleId());
map.put("org_id", user.getOrgId()); map.put("org_id", user.getOrgId());
map.put("type", user.getType());
List<TUser> list = userService.getUserListByRole(map); List<TUser> list = userService.getUserListByRole(map);
if ("2".equals(user.getRoleId()) && list.size() >= 2) { if ("2".equals(user.getRoleId()) && list.size() >= 2) {
resultMap.put("resultCode", "400"); resultMap.put("resultCode", "400");
......
...@@ -145,7 +145,7 @@ ...@@ -145,7 +145,7 @@
select <include refid="Base_Column_List"/> select <include refid="Base_Column_List"/>
from t_user u from t_user u
left join t_user_role_link ur on u.id = ur.user_id left join t_user_role_link ur on u.id = ur.user_id
where u.org_id = #{org_id} and u.is_deleted = #{is_deleted} and ur.role_id =#{role_id} where u.org_id = #{org_id} and u.is_deleted = #{is_deleted} and ur.role_id =#{role_id} and u.type = #{type}
</select> </select>
<select id="getUserRole" resultType="cn.chnmuseum.party.model.TUser"> <select id="getUserRole" resultType="cn.chnmuseum.party.model.TUser">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment