Commit e4c74ca8 authored by huyuchen's avatar huyuchen

菜单权限修改

parent 28f45f22
......@@ -133,6 +133,12 @@ public class SysMenu extends BaseEntity {
@Schema(description = "部门权限id")
private String deptId;
/**
* 二级指标归属id
*/
@Schema(description = "二级指标归属id")
private String twoLevelId;
/**
* 权限idList
*/
......
......@@ -109,6 +109,14 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
*/
IPage<SysUserDeptVo> selectDeptVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据名称或者编码查询数据
* 二级指标归属权限
* @param name 名称
* @return
*/
IPage<SysUserDeptVo> selectTwoGsVO(Page<SysUserDeptVo> page, @Param("name") String name);
/**
* 根据类型查询字典值
*
......@@ -181,6 +189,14 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
*/
Integer selectDeptCount(@Param("name") String name);
/**
* 根据名称或者编码查询数据
* 部门&&收入归属权限
* @param name 名称
* @return
*/
Integer selectTwoGsCount(@Param("name") String name);
/**
* @param userId
* @Description: 查找当前用户的所有权限
......
......@@ -163,6 +163,9 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
} else if (CommonConstants.EIGHT_STRING.equals(searchVo.getType()) || CommonConstants.NINE_STRING.equals(searchVo.getType())) {
//部门&&收入归属权限
iPage = baseMapper.selectDeptVO(page, searchVo.getName());
} else if (CommonConstants.TEN_STRING.equals(searchVo.getType()) ) {
//二级指标归属权限
iPage = baseMapper.selectTwoGsVO(page, searchVo.getName());
} else {
//项目权限
if (Common.isNotNull(user.getId()) && CommonConstants.ZERO_STRING.equals(user.getSystemFlag())) {
......@@ -305,7 +308,8 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
flag.append(insert.getPermissionType());
flag.append("_");
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType()) ||
CommonConstants.SEVEN_STRING.equals(insert.getPermissionType())) {
CommonConstants.SEVEN_STRING.equals(insert.getPermissionType()) ||
CommonConstants.TEN_STRING.equals(insert.getPermissionType())) {
flag.append(excel.getName());
} else {
flag.append(excel.getCode());
......@@ -317,14 +321,17 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
uniqueMap.put(flag.toString(), CommonConstants.ONE_STRING);
}
//BU和条线的时候用名称判断,其他用编码判断
//BU、条线、二级指标归属的时候用名称判断,其他用编码判断
//判断此登录名是否已经存在此权限维度
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType())
|| CommonConstants.SEVEN_STRING.equals(insert.getPermissionType())) {
|| CommonConstants.SEVEN_STRING.equals(insert.getPermissionType())
|| CommonConstants.TEN_STRING.equals(insert.getPermissionType())) {
//判断对应维度的名称是否存在
Integer count;
if (CommonConstants.SIX_STRING.equals(insert.getPermissionType())) {
count = baseMapper.selectDictByName(excel.getName(), "bu");
} else if (CommonConstants.TEN_STRING.equals(insert.getPermissionType())) {
count = baseMapper.selectTwoGsCount(excel.getName());
} else {
count = baseMapper.selectDictByName(excel.getName(), "line");
}
......
......@@ -22,6 +22,7 @@
<result property="buId" column="BU_ID"/>
<result property="lineId" column="LINE_ID"/>
<result property="deptId" column="DEPT_ID"/>
<result property="twoLevelId" column="TWO_LEVEL_ID"/>
<result property="createBy" column="CREATE_BY"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="createName" column="CREATE_NAME"/>
......@@ -48,6 +49,7 @@
a.LINE_ID,
a.DEPT_ID,
a.IS_OPEN,
a.TWO_LEVEL_ID,
a.VIEW_ID,
a.CREATE_TIME
</sql>
......
......@@ -207,6 +207,16 @@
</if>
</select>
<select id="selectTwoGsVO" resultMap="nameAndCodeMap">
SELECT
a.fd_3b1235d8f35c6c name
from ekp_793f0c590104b7ebd460 a
where 1 = 1
<if test="name != null and name.trim() != ''">
AND a.fd_3b1235d8f35c6c like concat('%',#{name},'%')
</if>
</select>
<!--根据部门编码查询id-->
<select id="selectSettleByCode" resultType="java.lang.String">
SELECT
......@@ -281,6 +291,13 @@
where a.fd_is_available = '1' and fd_org_type = 2 and a.fd_no = #{name}
</select>
<select id="selectTwoGsCount" resultType="java.lang.Integer">
SELECT
count(1)
from ekp_793f0c590104b7ebd460 a
where a.fd_3b1235d8f35c6c = #{name}
</select>
<!-- 查找当前用户的所有权限 -->
<select id="getUserPermissionByUserId" resultMap="sysUserPermissionMap">
select
......
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