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
08a59dd6
Commit
08a59dd6
authored
Sep 11, 2023
by
huyuchen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
菜单权限修改
parent
af55c4dd
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
77 additions
and
13 deletions
+77
-13
SysUserPermission.java
...oud/plus/v1/yifu/permission/entity/SysUserPermission.java
+1
-1
SysUserInfoController.java
.../plus/v1/permission/controller/SysUserInfoController.java
+12
-0
SysUserPermissionController.java
...v1/permission/controller/SysUserPermissionController.java
+8
-8
SysUserInfoMapper.java
...fu/cloud/plus/v1/permission/mapper/SysUserInfoMapper.java
+7
-2
SysUserPermissionMapper.java
...ud/plus/v1/permission/mapper/SysUserPermissionMapper.java
+8
-0
SysUserInfoService.java
.../cloud/plus/v1/permission/service/SysUserInfoService.java
+2
-0
SysUserInfoServiceImpl.java
...us/v1/permission/service/impl/SysUserInfoServiceImpl.java
+11
-1
SysUserPermissionServiceImpl.java
...permission/service/impl/SysUserPermissionServiceImpl.java
+6
-1
SysUserInfoMapper.xml
...ssion-biz/src/main/resources/mapper/SysUserInfoMapper.xml
+15
-0
SysUserPermissionMapper.xml
...biz/src/main/resources/mapper/SysUserPermissionMapper.xml
+7
-0
No files found.
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/entity/SysUserPermission.java
View file @
08a59dd6
...
...
@@ -52,7 +52,7 @@ public class SysUserPermission extends BaseEntity {
private
String
empDept
;
/**
* 权限类型
* 权限类型
客户、商机、报价单、
* 1客户权限;2商机;3报价单;4合同;5项目;6BU;7条线;8部门;9收入归属
*/
@Schema
(
description
=
"权限类型"
)
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/controller/SysUserInfoController.java
View file @
08a59dd6
...
...
@@ -154,4 +154,16 @@ public class SysUserInfoController {
return
R
.
ok
(
sysUserInfoService
.
testPermission
(
menuId
,
userId
));
}
/**
* 简单分页查询
*
* @param page 分页对象
* @param code 新权限-账号管理表
* @return
*/
@Operation
(
description
=
"根据编码或者登录名简单分页查询"
)
@GetMapping
(
"/getUserByCodeOrLoginName"
)
public
R
<
IPage
<
SysUserInfo
>>
getUserByCodeOrLoginName
(
Page
<
SysUserInfo
>
page
,
String
code
)
{
return
new
R
<>(
sysUserInfoService
.
getUserByCodeOrLoginName
(
page
,
code
));
}
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/controller/SysUserPermissionController.java
View file @
08a59dd6
...
...
@@ -42,7 +42,7 @@ public class SysUserPermissionController {
* @param sysUserPermission 新权限-用户权限表
* @return
*/
@Operation
(
description
=
"简单分页查询"
)
@Operation
(
summary
=
"简单分页查询"
,
description
=
"简单分页查询"
)
@GetMapping
(
"/page"
)
public
R
<
IPage
<
SysUserPermission
>>
getSysUserPermissionPage
(
Page
<
SysUserPermission
>
page
,
SysUserPermissionSearchVo
sysUserPermission
)
{
return
new
R
<>(
sysUserPermissionService
.
getSysUserPermissionPage
(
page
,
sysUserPermission
));
...
...
@@ -66,7 +66,7 @@ public class SysUserPermissionController {
* @param sysUserPermission 新权限-用户权限表
* @return R
*/
@Operation
(
description
=
"新增用户权限表:hasPermission('permission_sysuserpermission_add')"
)
@Operation
(
summary
=
"新增用户权限表"
,
description
=
"新增用户权限表:hasPermission('permission_sysuserpermission_add')"
)
@SysLog
(
"新增用户权限表"
)
@PostMapping
(
"/savePermission"
)
@PreAuthorize
(
"@pms.hasPermission('permission_sysuserpermission_add')"
)
...
...
@@ -80,7 +80,7 @@ public class SysUserPermissionController {
* @param sysUserPermissionList 用户权限表list
* @return R
*/
@Operation
(
description
=
"修改用户权限表:hasPermission('permission_sysuserpermission_edit')"
)
@Operation
(
summary
=
"修改用户权限表"
,
description
=
"修改用户权限表:hasPermission('permission_sysuserpermission_edit')"
)
@SysLog
(
"修改用户权限表"
)
@PostMapping
(
"/updatePermission"
)
@PreAuthorize
(
"@pms.hasPermission('permission_sysuserpermission_edit')"
)
...
...
@@ -97,7 +97,7 @@ public class SysUserPermissionController {
* @param idList
* @return R
*/
@Operation
(
description
=
"通过id删除用户权限表:hasPermission('permission_sysuserpermission_del')"
)
@Operation
(
summary
=
"通过id删除用户权限表"
,
description
=
"通过id删除用户权限表:hasPermission('permission_sysuserpermission_del')"
)
@SysLog
(
"通过id删除用户权限表"
)
@PostMapping
(
"/deleteByIds"
)
@PreAuthorize
(
"@pms.hasPermission('permission_sysuserpermission_del')"
)
...
...
@@ -112,7 +112,7 @@ public class SysUserPermissionController {
* @date 2023-08-29 14:49:40
**/
@SneakyThrows
@Operation
(
description
=
"批量新增用户权限表 hasPermission('permission_sysuserpermission-batch-import')"
)
@Operation
(
summary
=
"批量新增用户权限表"
,
description
=
"批量新增用户权限表 hasPermission('permission_sysuserpermission-batch-import')"
)
@SysLog
(
"批量新增用户权限表"
)
@PostMapping
(
"/importListAdd"
)
@PreAuthorize
(
"@pms.hasPermission('permission_sysuserpermission-batch-import')"
)
...
...
@@ -126,7 +126,7 @@ public class SysUserPermissionController {
* @author hyc
* @date 2023-08-29 14:49:40
**/
@Operation
(
description
=
"导出用户权限表"
)
@Operation
(
summary
=
"导出用户权限表"
,
description
=
"导出用户权限表"
)
@PostMapping
(
"/export"
)
@SysLog
(
"批量导出用户权限表"
)
public
void
export
(
HttpServletResponse
response
,
@RequestBody
SysUserPermissionSearchVo
searchVo
)
{
...
...
@@ -140,7 +140,7 @@ public class SysUserPermissionController {
* @param searchVo 新权限-用户权限表
* @return
*/
@Operation
(
description
=
"根据名称,编码模糊搜索"
)
@Operation
(
summary
=
"根据名称,编码模糊搜索"
,
description
=
"根据名称,编码模糊搜索"
)
@GetMapping
(
"/customerPage"
)
public
R
<
IPage
<
SysUserDeptVo
>>
getNameCodePage
(
Page
<
SysUserDeptVo
>
page
,
SysUserDeptVo
searchVo
)
{
return
new
R
<>(
sysUserPermissionService
.
getNameCodePage
(
page
,
searchVo
));
...
...
@@ -152,7 +152,7 @@ public class SysUserPermissionController {
* @param type 字典类型
* @return
*/
@Operation
(
description
=
"根据类型查询字典值"
)
@Operation
(
summary
=
"根据类型查询字典值"
,
description
=
"根据类型查询字典值"
)
@PostMapping
(
"/selectDictByType"
)
public
R
<
List
<
SysDictVo
>>
selectDictByType
(
@RequestParam
String
type
)
{
return
new
R
<>(
sysUserPermissionService
.
selectDictByType
(
type
));
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysUserInfoMapper.java
View file @
08a59dd6
...
...
@@ -62,6 +62,11 @@ public interface SysUserInfoMapper extends BaseMapper<SysUserInfo> {
**/
int
getAuthByUserIdAndMenuId
(
@Param
(
"menuId"
)
String
menuId
,
@Param
(
"userId"
)
String
userId
);
/**
* @Description: 根据编码或者登录名简单分页查询
* @Author: huyc
* @Date: 2023/9/11 10:00
* @return:
**/
IPage
<
SysUserInfo
>
getUserByCodeOrLoginName
(
Page
<
SysUserInfo
>
page
,
@Param
(
"code"
)
String
code
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysUserPermissionMapper.java
View file @
08a59dd6
...
...
@@ -109,6 +109,14 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
*/
List
<
SysDictVo
>
selectDictByType
(
@Param
(
"type"
)
String
type
);
/**
* 根据类型查询字典值
*
* @param type 类型
* @return
*/
List
<
SysDictVo
>
selectDictByTypeOne
(
@Param
(
"type"
)
String
type
,
@Param
(
"userId"
)
String
userId
);
/**
* 根据类型和名称判断字典值是否存在
*
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/SysUserInfoService.java
View file @
08a59dd6
...
...
@@ -77,4 +77,6 @@ public interface SysUserInfoService extends IService<SysUserInfo> {
**/
String
testPermission
(
String
menuId
,
String
userId
);
IPage
<
SysUserInfo
>
getUserByCodeOrLoginName
(
Page
<
SysUserInfo
>
page
,
String
code
);
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserInfoServiceImpl.java
View file @
08a59dd6
...
...
@@ -34,7 +34,6 @@ import com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserInfo;
import
com.yifu.cloud.plus.v1.yifu.permission.entity.SysUserRoleRes
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSaveVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserInfoSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserRoleResSearchVo
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.log4j.Log4j2
;
import
org.springframework.stereotype.Service
;
...
...
@@ -222,4 +221,15 @@ public class SysUserInfoServiceImpl extends ServiceImpl<SysUserInfoMapper, SysUs
return
""
;
}
/**
* 新权限-账号管理表简单分页查询
*
* @param code
* @return
*/
@Override
public
IPage
<
SysUserInfo
>
getUserByCodeOrLoginName
(
Page
<
SysUserInfo
>
page
,
String
code
)
{
return
baseMapper
.
getUserByCodeOrLoginName
(
page
,
code
);
}
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserPermissionServiceImpl.java
View file @
08a59dd6
...
...
@@ -181,7 +181,12 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
@Override
public
List
<
SysDictVo
>
selectDictByType
(
String
type
)
{
return
baseMapper
.
selectDictByType
(
type
);
YifuUser
user
=
SecurityUtils
.
getUser
();
if
(
"permission"
.
equals
(
type
)
&&
!
CommonConstants
.
ONE_STRING
.
equals
(
user
.
getId
()))
{
return
baseMapper
.
selectDictByTypeOne
(
type
,
CommonConstants
.
ZERO_STRING
);
}
else
{
return
baseMapper
.
selectDictByType
(
type
);
}
}
@Override
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserInfoMapper.xml
View file @
08a59dd6
...
...
@@ -193,4 +193,19 @@
) a
</select>
<select
id=
"getUserByCodeOrLoginName"
resultMap=
"sysUserInfoMap"
>
SELECT
a.fd_id,
a.fd_name,
a.fd_login_name,
a.fd_dept_name
from FROM sys_user_info a
<where>
1=1
<if
test=
"code != null and code != ''"
>
AND (a.fd_login_name like concat('%',#{code},'%') or a.fd_name like concat('%',#{code},'%'))
</if>
</where>
order by a.CREATE_TIME desc
</select>
</mapper>
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserPermissionMapper.xml
View file @
08a59dd6
...
...
@@ -212,6 +212,13 @@
where a.dict_type = #{type}
</select>
<select
id=
"selectDictByTypeOne"
resultMap=
"dictMap"
>
SELECT
a.dict_id as id,a.name
from permission_type a
where a.dict_type = #{type} and a.user_id = #{userId}
</select>
<!--针对BU归属和条线类型时的存在判断-->
<select
id=
"selectDictByName"
resultType=
"java.lang.Integer"
>
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