7/29
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package com.yxt.portal.apiadmin;
|
||||
|
||||
/**
|
||||
* @author wangpengfei
|
||||
* @date 2024/7/26 17:26
|
||||
*/
|
||||
public class SysAuthorizeGroupRest {
|
||||
}
|
||||
@@ -580,14 +580,14 @@ public class SysUserRest {
|
||||
|
||||
SysRole sysRole=new SysRole();
|
||||
sysRole.setCode("");
|
||||
sysRole.setName("系统管理员");
|
||||
sysRole.setName("单位管理员");
|
||||
sysRole.setSort(0);
|
||||
sysRole.setType(1);
|
||||
sysRole.setOrgSid(sysOrg.getSid());
|
||||
sysRole.setDataRuleId("1");
|
||||
sysRoleService.save(sysRole);
|
||||
// List<SysMenu> sysMenus=sysMenuService.list(new QueryWrapper<SysMenu>().eq("sourceSid",dto.getSourceSid()));
|
||||
List<SysMenu> sysMenus=sysMenuService.list(new QueryWrapper<SysMenu>().eq("sourceSid","d936f1ba-03c3-11ec-bf08-48452053aa33"));
|
||||
List<SysMenu> sysMenus=sysMenuService.list(new QueryWrapper<SysMenu>().eq("sourceSid",dto.getSourceSid()));
|
||||
// List<SysMenu> sysMenus=sysMenuService.list(new QueryWrapper<SysMenu>().eq("sourceSid","d936f1ba-03c3-11ec-bf08-48452053aa33"));
|
||||
List<SysRoleAuthorize> sysRoleAuthorizes=new ArrayList<>();
|
||||
for (SysMenu sysMenu : sysMenus) {
|
||||
SysRoleAuthorize sysRoleAuthorize=new SysRoleAuthorize();
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yxt.portal.biz.sysauthorizegroup;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.yxt.common.core.domain.BaseEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@ApiModel(value = "权限组表", description = "权限组表")
|
||||
@TableName("sys_authorize_group")
|
||||
@Data
|
||||
public class SysAuthorizeGroup extends BaseEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
||||
@ApiModelProperty("权限组名")
|
||||
private String groupName;
|
||||
|
||||
@ApiModelProperty("菜单sid")
|
||||
private String menuSid;
|
||||
|
||||
@ApiModelProperty("资源")
|
||||
private String sourceSid;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package com.yxt.portal.biz.sysauthorizegroup;
|
||||
|
||||
|
||||
import com.yxt.common.core.dto.Dto;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
|
||||
@ApiModel(value = "权限组表 数据传输对象", description = "权限组表 数据传输对象")
|
||||
@Data
|
||||
public class SysAuthorizeGroupDto implements Dto {
|
||||
|
||||
|
||||
private static final long serialVersionUID = -8143707488992909267L;
|
||||
@ApiModelProperty(value = "菜单名称", required = true)
|
||||
@NotBlank(message = "菜单名称不能为空")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("菜单路由路径(VUE)")
|
||||
private String menuUrl;
|
||||
|
||||
@ApiModelProperty("菜单对应的前端页面路径")
|
||||
private String pageUrl;
|
||||
|
||||
@ApiModelProperty("菜单图标地址")
|
||||
private String iconUrl;
|
||||
|
||||
@ApiModelProperty(value = "资源sid", required = true)
|
||||
@NotBlank(message = "资源不能为空")
|
||||
private String sourceSid;
|
||||
|
||||
@ApiModelProperty(value = "是否显示,默认为1显示,0为不显示", required = true)
|
||||
@NotBlank(message = "是否显示不能为空")
|
||||
private String isShow;
|
||||
|
||||
@ApiModelProperty("排序号")
|
||||
private Integer sortNo;
|
||||
|
||||
@ApiModelProperty(value = "上级sid", example = "0", required = true)
|
||||
@NotBlank(message = "上级菜单不能为空")
|
||||
private String pSid;
|
||||
|
||||
@ApiModelProperty(value = "前端页面路径重定向", required = false)
|
||||
private Integer pageUrlRedirect;
|
||||
|
||||
@ApiModelProperty("前端页面名称(vue组件名)")
|
||||
private String pageName;
|
||||
|
||||
@ApiModelProperty(value = "前端页面别名", required = false)
|
||||
private String pageAliasName;
|
||||
|
||||
@ApiModelProperty("菜单类型(0左侧当行菜单,1页面中功能)")
|
||||
private String menuType="0";
|
||||
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remarks;
|
||||
private String cid;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yxt.portal.biz.sysauthorizegroup;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.yxt.portal.biz.sysmenu.SysMenuTreeVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SysMenuMapper.java <br/>
|
||||
* Class: com.yxt.anrui.portal.biz.sysmenu.SysMenuMapper <br/>
|
||||
* Description: 菜单表. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:28 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SysAuthorizeGroupMapper extends BaseMapper<SysAuthorizeGroup> {
|
||||
|
||||
|
||||
List<SysAuthorizeGroupVo> getGroupByOrgSid(@Param("orgSid") String orgSid,@Param("sourceSid") String sourceSid);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.yxt.portal.biz.sysmenu.SysMenuMapper">
|
||||
<!-- <where> ${ew.sqlSegment} </where>-->
|
||||
<!-- ${ew.customSqlSegment} -->
|
||||
|
||||
<!--将该资源下的所有一级菜单列表-->
|
||||
<select id="getGroupByOrgSid" resultType="com.yxt.portal.biz.sysmenu.SysMenuTreeVo">
|
||||
SELECT *
|
||||
FROM sys_authorize_group gr
|
||||
LEFT JOIN sys_org_authorize au ON gr.sid = au.ahthorizeGroupSid
|
||||
WHERE source.sid = #{sourceSid} AND menu.psid='0' and menu.isDelete!=1
|
||||
ORDER BY menu.sortNo ASC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.yxt.portal.biz.sysauthorizegroup;
|
||||
|
||||
|
||||
import com.yxt.common.core.query.Query;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@ApiModel(value = "权限组表 查询条件 功能菜单设置查询用", description = "权限组表 查询条件 功能菜单设置查询用")
|
||||
@Data
|
||||
public class SysAuthorizeGroupQuery implements Query {
|
||||
|
||||
|
||||
@ApiModelProperty("资源sid")
|
||||
private String sourceSid;
|
||||
private String orgSid;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.yxt.portal.biz.sysauthorizegroup;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.yxt.common.base.service.MybatisBaseService;
|
||||
import com.yxt.common.base.utils.PagerUtil;
|
||||
import com.yxt.common.core.query.PagerQuery;
|
||||
import com.yxt.common.core.vo.PagerVo;
|
||||
import com.yxt.portal.biz.sysmenu.SysMenuTreeVo;
|
||||
import com.yxt.portal.biz.sysroleauthorize.SysMenuRoleVo;
|
||||
import com.yxt.portal.biz.syssource.SysSourceService;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SysMenuService.java <br/>
|
||||
* Class: com.yxt.user.biz.sysmenu.SysMenuService <br/>
|
||||
* Description: 菜单表 业务逻辑. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:28 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@Service
|
||||
public class SysAuthorizeGroupService extends MybatisBaseService<SysAuthorizeGroupMapper, SysAuthorizeGroup> {
|
||||
|
||||
|
||||
|
||||
|
||||
public List<SysAuthorizeGroupVo> getGroupByOrgSid(SysAuthorizeGroupQuery query) {
|
||||
|
||||
return baseMapper.getGroupByOrgSid(query.getOrgSid(),query.getSourceSid());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.yxt.portal.biz.sysauthorizegroup;
|
||||
|
||||
|
||||
import com.yxt.common.core.vo.Vo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Project: anrui_portal(门户建设) <br/>
|
||||
* File: SysMenuVo.java <br/>
|
||||
* Class: com.yxt.anrui.portal.api.sysmenu.SysMenuVo <br/>
|
||||
* Description: 菜单表 视图数据对象. <br/>
|
||||
* Copyright: Copyright (c) 2011 <br/>
|
||||
* Company: https://gitee.com/liuzp315 <br/>
|
||||
* Makedate: 2021-08-03 00:24:28 <br/>
|
||||
*
|
||||
* @author liupopo
|
||||
* @version 1.0
|
||||
* @since 1.0
|
||||
*/
|
||||
@ApiModel(value = "菜单表 视图数据对象", description = "菜单表 视图数据对象")
|
||||
@Data
|
||||
public class SysAuthorizeGroupVo implements Vo {
|
||||
|
||||
|
||||
@ApiModelProperty("菜单名称")
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty("菜单路由路径(VUE)")
|
||||
private String menuUrl;
|
||||
|
||||
@ApiModelProperty("菜单对应的前端页面路径")
|
||||
private String pageUrl;
|
||||
|
||||
@ApiModelProperty("菜单图标地址")
|
||||
private String iconUrl;
|
||||
|
||||
@ApiModelProperty("资源sid")
|
||||
private String sourceSid;
|
||||
|
||||
@ApiModelProperty("是否显示,默认为1显示,0为不显示")
|
||||
private String isShow;
|
||||
|
||||
@ApiModelProperty("排序号")
|
||||
private Integer sortNo;
|
||||
|
||||
@ApiModelProperty("上级sid")
|
||||
private String pSid;
|
||||
@ApiModelProperty("上级名称")
|
||||
private String pName;
|
||||
@ApiModelProperty("sid")
|
||||
private String sid;
|
||||
|
||||
@ApiModelProperty("前端页面路径重定向")
|
||||
private Integer pageUrlRedirect;
|
||||
|
||||
@ApiModelProperty("前端页面名称(vue组件名)")
|
||||
private String pageName;
|
||||
|
||||
@ApiModelProperty("前端页面别名")
|
||||
private String pageAliasName;
|
||||
|
||||
@ApiModelProperty("菜单类型(0左侧当行菜单,1页面中功能)")
|
||||
private String menuType;
|
||||
@ApiModelProperty("子菜单")
|
||||
private List<SysAuthorizeGroupVo> children;
|
||||
@ApiModelProperty("是否选中,1:未选中,0:选中")
|
||||
private String checked;
|
||||
@ApiModelProperty("资源名称")
|
||||
private String sourceName;
|
||||
private String cid;
|
||||
}
|
||||
@@ -72,7 +72,7 @@
|
||||
(select name from sys_menu where sid=menu.pSid) as pName
|
||||
FROM sys_menu menu
|
||||
left join sys_source source on source.sid = menu.sourceSid
|
||||
where menu.pSid = #{sid}
|
||||
where menu.pSid = #{sid} and menu.menu.menuType !='2'
|
||||
ORDER BY menu.sortNo ASC
|
||||
</select>
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
end as menuTypeValue,
|
||||
menu.isShow,
|
||||
menu.cId as cId,
|
||||
(select name from sys_menu where sid=menu.pSid) as pName
|
||||
if(menu.pSid=0,'顶级菜单','' )as pName
|
||||
FROM sys_menu menu
|
||||
LEFT JOIN sys_source source ON menu.sourceSid = source.sid
|
||||
WHERE source.sid = #{sourceSid} AND menu.psid='0' and menu.isDelete!=1
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
select sr.sid,sr.name
|
||||
from sys_user_role sur
|
||||
left join sys_role sr on sur.roleSid = sr.sid
|
||||
where sur.userSid = #{sid} order by dataRuleId
|
||||
where sur.userSid = #{sid} and sr.sid is not null order by dataRuleId
|
||||
</select>
|
||||
<select id="selectByUser" resultType="java.lang.String">
|
||||
select roleSid
|
||||
|
||||
@@ -758,7 +758,7 @@ public class SysStaffinfoService extends MybatisBaseService<SysStaffinfoMapper,
|
||||
}
|
||||
//更新员工的关联的部门信息
|
||||
SysStaffOrgDto sysStaffOrgDto = dto.getSysStaffOrg();
|
||||
SysStaffOrg sysStaffOrg = sysStaffOrgService.getOrgByStaffSidn(sid);
|
||||
SysStaffOrg sysStaffOrg = sysStaffOrgService.getOrgByStaffSidn(sid,dto.getSysStaffOrg().getOrgSid());
|
||||
BeanUtil.copyProperties(sysStaffOrgDto,sysStaffOrg);
|
||||
sysStaffOrg.setManageType(dto.getSysStaffOrg().getManageType());
|
||||
sysStaffOrgService.updateById(sysStaffOrg);
|
||||
|
||||
@@ -91,8 +91,8 @@ public interface SysStaffOrgMapper extends BaseMapper<SysStaffOrg> {
|
||||
|
||||
@Select("select * from sys_staff_org where staffSid=#{sid} and orgSidPath = #{path} ")
|
||||
SysStaffOrg getOrgByStaffSidAndPath(@Param("sid") String sid, @Param("path") String path);
|
||||
@Select("select * from sys_staff_org where staffSid=#{sid} ")
|
||||
SysStaffOrg getOrgByStaffSidn(@Param("sid") String sid);
|
||||
@Select("select * from sys_staff_org where staffSid=#{sid} and orgSid=#{orgSid}")
|
||||
SysStaffOrg getOrgByStaffSidn(@Param("sid") String sid,@Param("orgSid") String orgSid);
|
||||
@Select("select * from sys_staff_org where staffSid=#{sid}")
|
||||
List<SysStaffOrg> getOrgByStaffSidList(String sid);
|
||||
|
||||
|
||||
@@ -229,8 +229,8 @@ public class SysStaffOrgService extends MybatisBaseService<SysStaffOrgMapper, Sy
|
||||
public SysStaffOrg getOrgByStaffSidAndPath(String sid, String path) {
|
||||
return baseMapper.getOrgByStaffSidAndPath(sid, path);
|
||||
}
|
||||
public SysStaffOrg getOrgByStaffSidn(String sid) {
|
||||
return baseMapper.getOrgByStaffSidn(sid);
|
||||
public SysStaffOrg getOrgByStaffSidn(String sid,String orgSid) {
|
||||
return baseMapper.getOrgByStaffSidn(sid,orgSid);
|
||||
}
|
||||
|
||||
public List<SysStaffOrg> getOrgByStaffSidList(String sid) {
|
||||
|
||||
@@ -137,6 +137,7 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
||||
qw.eq("role.sid", query.getRoleSid());
|
||||
}
|
||||
qw.ne("USER.isDelete","1");
|
||||
// qw.apply("c.orgSidPath like (%"+query.getOrgSid()+")");
|
||||
qw.like("c.orgSidPath",query.getOrgSid());
|
||||
// qw.eq("b.sourceSid",query.getSourceSid());
|
||||
// if (StringUtils.isNotBlank(query.getName())) {
|
||||
@@ -1698,7 +1699,10 @@ public class SysUserService extends MybatisBaseService<SysUserMapper, SysUser> {
|
||||
public ResultBean<String> selectPrivilegeLevel(PrivilegeQuery query) {
|
||||
ResultBean<String> rb = ResultBean.fireFail();
|
||||
String defalutId = "";
|
||||
List<String> roleIdList = sysUserRoleService.selectRoleSid(query.getUserSid(),query.getOrgPath());
|
||||
String orgSidPath = query.getOrgPath();
|
||||
orgSidPath = orgSidPath + "/";
|
||||
int i1 = orgSidPath.indexOf("/");
|
||||
List<String> roleIdList = sysUserRoleService.selectRoleSid(query.getUserSid(),query.getOrgPath().substring(0,i1));
|
||||
roleIdList.removeAll(Collections.singleton(null));
|
||||
if (!roleIdList.isEmpty()) {
|
||||
for (int i = 0; i < roleIdList.size(); i++) {
|
||||
|
||||
@@ -59,7 +59,9 @@
|
||||
</delete>
|
||||
|
||||
<select id="selectRoleSid" resultType="java.lang.String">
|
||||
select distinct dataRuleId from sys_user_role a left join sys_role b on a.roleSid =b.sid where userSid = #{userSid} and b.orgSid =#{orgSid} order by dataRuleId limit 1
|
||||
select distinct dataRuleId from sys_user_role a
|
||||
left join sys_role b on a.roleSid =b.sid
|
||||
where userSid = #{userSid} and b.orgSid =#{orgSid} order by dataRuleId limit 1
|
||||
</select>
|
||||
|
||||
<select id="selectByUserSids" resultType="java.lang.String">
|
||||
|
||||
Reference in New Issue
Block a user