Commit e4c74ca8 authored by huyuchen's avatar huyuchen

菜单权限修改

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