Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
e4c74ca8
Commit
e4c74ca8
authored
Oct 27, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜单权限修改
parent
28f45f22
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
51 additions
and
3 deletions
+51
-3
SysMenu.java
...om/yifu/cloud/plus/v1/yifu/permission/entity/SysMenu.java
+6
-0
SysUserPermissionMapper.java
...ud/plus/v1/permission/mapper/SysUserPermissionMapper.java
+16
-0
SysUserPermissionServiceImpl.java
...permission/service/impl/SysUserPermissionServiceImpl.java
+10
-3
SysMenuMapper.xml
...ermission-biz/src/main/resources/mapper/SysMenuMapper.xml
+2
-0
SysUserPermissionMapper.xml
...biz/src/main/resources/mapper/SysUserPermissionMapper.xml
+17
-0
No files found.
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/entity/SysMenu.java
View file @
e4c74ca8
...
...
@@ -133,6 +133,12 @@ public class SysMenu extends BaseEntity {
@Schema
(
description
=
"部门权限id"
)
private
String
deptId
;
/**
* 二级指标归属id
*/
@Schema
(
description
=
"二级指标归属id"
)
private
String
twoLevelId
;
/**
* 权限idList
*/
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysUserPermissionMapper.java
View file @
e4c74ca8
...
...
@@ -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: 查找当前用户的所有权限
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserPermissionServiceImpl.java
View file @
e4c74ca8
...
...
@@ -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"
);
}
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysMenuMapper.xml
View file @
e4c74ca8
...
...
@@ -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>
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserPermissionMapper.xml
View file @
e4c74ca8
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment