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
ef15bd95
Commit
ef15bd95
authored
Sep 19, 2023
by
fangxinjiang
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/MVP1.5.8' into MVP1.5.8
parents
7881eb54
986c39ed
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
142 additions
and
25 deletions
+142
-25
SysMenu.java
...om/yifu/cloud/plus/v1/yifu/permission/entity/SysMenu.java
+5
-0
SysUserPermission.java
...oud/plus/v1/yifu/permission/entity/SysUserPermission.java
+5
-0
SysUserDeptVo.java
.../yifu/cloud/plus/v1/yifu/permission/vo/SysUserDeptVo.java
+6
-0
SysUserPermissionVo.java
...cloud/plus/v1/yifu/permission/vo/SysUserPermissionVo.java
+6
-5
SysMenuMapper.java
...m/yifu/cloud/plus/v1/permission/mapper/SysMenuMapper.java
+10
-0
SysUserPermissionMapper.java
...ud/plus/v1/permission/mapper/SysUserPermissionMapper.java
+8
-0
SysMenuServiceImpl.java
...d/plus/v1/permission/service/impl/SysMenuServiceImpl.java
+38
-2
SysRoleInfoServiceImpl.java
...us/v1/permission/service/impl/SysRoleInfoServiceImpl.java
+2
-1
SysUserPermissionServiceImpl.java
...permission/service/impl/SysUserPermissionServiceImpl.java
+34
-13
application.yml
...on/yifu-permission-biz/src/main/resources/application.yml
+6
-0
SysMenuMapper.xml
...ermission-biz/src/main/resources/mapper/SysMenuMapper.xml
+10
-0
SysUserPermissionMapper.xml
...biz/src/main/resources/mapper/SysUserPermissionMapper.xml
+12
-4
No files found.
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/entity/SysMenu.java
View file @
ef15bd95
...
@@ -140,4 +140,9 @@ public class SysMenu extends BaseEntity {
...
@@ -140,4 +140,9 @@ public class SysMenu extends BaseEntity {
@TableField
(
exist
=
false
)
@TableField
(
exist
=
false
)
private
List
<
String
>
columnIdList
;
private
List
<
String
>
columnIdList
;
/**
* 是否开关(0开、1关)
*/
@Schema
(
description
=
"是否开关(0开、1关)"
)
private
String
isOpen
;
}
}
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/entity/SysUserPermission.java
View file @
ef15bd95
...
@@ -88,4 +88,9 @@ public class SysUserPermission extends BaseEntity {
...
@@ -88,4 +88,9 @@ public class SysUserPermission extends BaseEntity {
@Schema
(
description
=
"删除状态(0是、1否)"
)
@Schema
(
description
=
"删除状态(0是、1否)"
)
private
String
deleteFlag
;
private
String
deleteFlag
;
/**
* 项目id
*/
@Schema
(
description
=
"项目id"
)
private
String
domainId
;
}
}
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/vo/SysUserDeptVo.java
View file @
ef15bd95
...
@@ -53,4 +53,10 @@ public class SysUserDeptVo implements Serializable {
...
@@ -53,4 +53,10 @@ public class SysUserDeptVo implements Serializable {
@Schema
(
description
=
"登录名"
)
@Schema
(
description
=
"登录名"
)
private
String
loginName
;
private
String
loginName
;
/**
* 项目id
*/
@Schema
(
description
=
"项目id"
)
private
String
domainId
;
}
}
\ No newline at end of file
yifu-permission/yifu-permission-api/src/main/java/com/yifu/cloud/plus/v1/yifu/permission/vo/SysUserPermissionVo.java
View file @
ef15bd95
...
@@ -31,8 +31,8 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
...
@@ -31,8 +31,8 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
* 登录账号
* 登录账号
*/
*/
@NotBlank
(
message
=
"登录账号 不能为空"
)
@NotBlank
(
message
=
"登录账号 不能为空"
)
@Length
(
max
=
10
,
message
=
"登录账号 不能超过1
0 个字符"
)
@Length
(
max
=
20
,
message
=
"登录账号 不能超过2
0 个字符"
)
@ExcelAttribute
(
name
=
"登录账号"
,
isNotEmpty
=
true
,
errorInfo
=
"登录账号 不能为空"
,
maxLength
=
1
0
)
@ExcelAttribute
(
name
=
"登录账号"
,
isNotEmpty
=
true
,
errorInfo
=
"登录账号 不能为空"
,
maxLength
=
2
0
)
@Schema
(
description
=
"登录账号"
)
@Schema
(
description
=
"登录账号"
)
@ExcelProperty
(
"登录账号"
)
@ExcelProperty
(
"登录账号"
)
private
String
empLoginName
;
private
String
empLoginName
;
...
@@ -55,16 +55,17 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
...
@@ -55,16 +55,17 @@ public class SysUserPermissionVo extends RowIndex implements Serializable {
/**
/**
* 权限类型
* 权限类型
*/
*/
@NotBlank
(
message
=
"权限类型 不能为空"
)
@Length
(
max
=
8
,
message
=
"权限类型 不能超过8 个字符"
)
@Length
(
max
=
8
,
message
=
"权限类型 不能超过8 个字符"
)
@ExcelAttribute
(
name
=
"权限类型"
,
maxLength
=
8
)
@ExcelAttribute
(
name
=
"权限类型"
,
isNotEmpty
=
true
,
errorInfo
=
"权限类型 不能为空"
,
maxLength
=
8
)
@Schema
(
description
=
"权限类型"
)
@Schema
(
description
=
"权限类型"
)
@ExcelProperty
(
"权限类型"
)
@ExcelProperty
(
"权限类型"
)
private
String
permissionType
;
private
String
permissionType
;
/**
/**
* 名称
* 名称
*/
*/
@Length
(
max
=
20
,
message
=
"名称 不能超过2
0 个字符"
)
@Length
(
max
=
20
0
,
message
=
"名称 不能超过20
0 个字符"
)
@ExcelAttribute
(
name
=
"名称"
,
maxLength
=
20
)
@ExcelAttribute
(
name
=
"名称"
,
maxLength
=
20
0
)
@Schema
(
description
=
"名称"
)
@Schema
(
description
=
"名称"
)
@ExcelProperty
(
"名称"
)
@ExcelProperty
(
"名称"
)
private
String
name
;
private
String
name
;
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysMenuMapper.java
View file @
ef15bd95
...
@@ -32,6 +32,16 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
...
@@ -32,6 +32,16 @@ public interface SysMenuMapper extends BaseMapper<SysMenu> {
*/
*/
long
selectMenuId
(
@Param
(
"modelId"
)
String
modelId
);
long
selectMenuId
(
@Param
(
"modelId"
)
String
modelId
);
/**
* 判断是否存在此菜单视图
*
* @param modelId 表单id
* @Author: huyc
* @Date: 2023/8/30 14:20
* @return
*/
long
selectViewId
(
@Param
(
"viewId"
)
String
viewId
,
@Param
(
"modelId"
)
String
modelId
);
/**
/**
* 判断是否存在此字段
* 判断是否存在此字段
*
*
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/mapper/SysUserPermissionMapper.java
View file @
ef15bd95
...
@@ -77,6 +77,14 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
...
@@ -77,6 +77,14 @@ public interface SysUserPermissionMapper extends BaseMapper<SysUserPermission> {
*/
*/
IPage
<
SysUserDeptVo
>
selectSettleVO
(
Page
<
SysUserDeptVo
>
page
,
@Param
(
"name"
)
String
name
);
IPage
<
SysUserDeptVo
>
selectSettleVO
(
Page
<
SysUserDeptVo
>
page
,
@Param
(
"name"
)
String
name
);
/**
* 根据名项目编码查询id
* 项目权限
* @param code 编码
* @return
*/
String
selectSettleByCode
(
@Param
(
"code"
)
String
code
);
/**
/**
* 根据名称或者编码查询数据
* 根据名称或者编码查询数据
* 商机权限
* 商机权限
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysMenuServiceImpl.java
View file @
ef15bd95
...
@@ -55,13 +55,23 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
...
@@ -55,13 +55,23 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
if
(
menuIdCount
<
1
)
{
if
(
menuIdCount
<
1
)
{
return
R
.
failed
(
"表单ID填写错误,请确认"
);
return
R
.
failed
(
"表单ID填写错误,请确认"
);
}
}
//唯一性校验--表单ID唯一
//判断view id是否填写正确并且要属于modeleID
long
viewIdCount
=
baseMapper
.
selectViewId
(
menu
.
getViewId
(),
menu
.
getModelId
());
if
(
viewIdCount
<
1
)
{
return
R
.
failed
(
"视图ID不存在或者不属于填写的表单id,请确认"
);
}
//唯一性校验--视图ID唯一
long
modelCount
=
baseMapper
.
selectCount
(
Wrappers
.<
SysMenu
>
query
().
lambda
()
long
modelCount
=
baseMapper
.
selectCount
(
Wrappers
.<
SysMenu
>
query
().
lambda
()
.
eq
(
SysMenu:
:
get
ModelId
,
menu
.
getModel
Id
())
.
eq
(
SysMenu:
:
get
ViewId
,
menu
.
getView
Id
())
.
eq
(
SysMenu:
:
getDeleteStatus
,
CommonConstants
.
ONE_STRING
));
.
eq
(
SysMenu:
:
getDeleteStatus
,
CommonConstants
.
ONE_STRING
));
if
(
modelCount
>
0
)
{
if
(
modelCount
>
0
)
{
return
R
.
failed
(
"已存在对应菜单的权限维度"
);
return
R
.
failed
(
"已存在对应菜单的权限维度"
);
}
}
//是否开关为是的话,modelId只能有一个
boolean
errorFlag
=
isOpenCheck
(
menu
);
if
(
errorFlag
)
{
return
R
.
failed
(
"只能存在一个开关状态为开的表单ID"
);
}
//判断菜单是否为一级菜单
//判断菜单是否为一级菜单
if
(
Common
.
isNotNull
(
menu
.
getMenuName
())
&&
Common
.
isEmpty
(
menu
.
getMenuNameParent
()))
{
if
(
Common
.
isNotNull
(
menu
.
getMenuName
())
&&
Common
.
isEmpty
(
menu
.
getMenuNameParent
()))
{
//一级菜单的上级菜单id为0
//一级菜单的上级菜单id为0
...
@@ -86,6 +96,11 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
...
@@ -86,6 +96,11 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
@Override
@Override
public
R
<
Boolean
>
updateMenu
(
SysMenu
menu
)
{
public
R
<
Boolean
>
updateMenu
(
SysMenu
menu
)
{
//是否开关为是的话,modelId只能有一个
boolean
errorFlag
=
isOpenCheck
(
menu
);
if
(
errorFlag
)
{
return
R
.
failed
(
"只能存在一个开关状态为开的表单ID"
);
}
//错误信息
//错误信息
StringBuilder
errorStr
=
new
StringBuilder
();
StringBuilder
errorStr
=
new
StringBuilder
();
//权限维度
//权限维度
...
@@ -118,4 +133,25 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
...
@@ -118,4 +133,25 @@ public class SysMenuServiceImpl extends ServiceImpl<SysMenuMapper, SysMenu> impl
}
}
}
}
public
boolean
isOpenCheck
(
SysMenu
menu
)
{
if
(
Common
.
isNotNull
(
menu
.
getIsOpen
())
&&
CommonConstants
.
ZERO_STRING
.
equals
(
menu
.
getIsOpen
()))
{
if
(
Common
.
isNotNull
(
menu
.
getId
()))
{
long
modelCount
=
baseMapper
.
selectCount
(
Wrappers
.<
SysMenu
>
query
().
lambda
()
.
eq
(
SysMenu:
:
getModelId
,
menu
.
getModelId
())
.
eq
(
SysMenu:
:
getDeleteStatus
,
CommonConstants
.
ONE_STRING
)
.
eq
(
SysMenu:
:
getIsOpen
,
CommonConstants
.
ZERO_STRING
)
.
ne
(
SysMenu:
:
getId
,
menu
.
getId
()));
return
modelCount
>
0
;
}
else
{
long
modelCount
=
baseMapper
.
selectCount
(
Wrappers
.<
SysMenu
>
query
().
lambda
()
.
eq
(
SysMenu:
:
getModelId
,
menu
.
getModelId
())
.
eq
(
SysMenu:
:
getDeleteStatus
,
CommonConstants
.
ONE_STRING
)
.
eq
(
SysMenu:
:
getIsOpen
,
CommonConstants
.
ZERO_STRING
));
return
modelCount
>
0
;
}
}
else
{
return
false
;
}
}
}
}
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysRoleInfoServiceImpl.java
View file @
ef15bd95
...
@@ -83,7 +83,8 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo
...
@@ -83,7 +83,8 @@ public class SysRoleInfoServiceImpl extends ServiceImpl<SysRoleInfoMapper, SysRo
vo
.
setResList
(
resList
);
vo
.
setResList
(
resList
);
}
}
List
<
TreeNode
<
String
>>
collect
=
sysMenuMapper
List
<
TreeNode
<
String
>>
collect
=
sysMenuMapper
.
selectList
(
Wrappers
.<
SysMenu
>
lambdaQuery
()
.
selectList
(
Wrappers
.<
SysMenu
>
lambdaQuery
().
eq
(
SysMenu:
:
getDeleteStatus
,
CommonConstants
.
ONE_STRING
)
.
eq
(
SysMenu:
:
getPermissionStatus
,
CommonConstants
.
ZERO_STRING
)
.
orderByAsc
(
SysMenu:
:
getCreateTime
)).
stream
()
.
orderByAsc
(
SysMenu:
:
getCreateTime
)).
stream
()
.
map
(
getNodeFunction
()).
collect
(
Collectors
.
toList
());
.
map
(
getNodeFunction
()).
collect
(
Collectors
.
toList
());
List
<
Tree
<
String
>>
tree
=
TreeUtil
.
build
(
collect
,
CommonConstants
.
ZERO_STRING
);
List
<
Tree
<
String
>>
tree
=
TreeUtil
.
build
(
collect
,
CommonConstants
.
ZERO_STRING
);
...
...
yifu-permission/yifu-permission-biz/src/main/java/com/yifu/cloud/plus/v1/permission/service/impl/SysUserPermissionServiceImpl.java
View file @
ef15bd95
...
@@ -67,7 +67,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -67,7 +67,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
.
eq
(
SysUserPermission:
:
getEmpLoginName
,
user
.
getUsername
())
.
eq
(
SysUserPermission:
:
getEmpLoginName
,
user
.
getUsername
())
.
eq
(
SysUserPermission:
:
getCode
,
sysUserPermission
.
getCode
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
.
eq
(
SysUserPermission:
:
getCode
,
sysUserPermission
.
getCode
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isEmpty
(
permission
))
{
if
(
Common
.
isEmpty
(
permission
))
{
return
R
.
failed
(
"
只有自己有权限的维度才可新增
"
);
return
R
.
failed
(
"
操作人仅可对本账号有权限的数据新增账号
"
);
}
}
}
}
if
(
CommonConstants
.
SIX_STRING
.
equals
(
sysUserPermission
.
getPermissionType
())
if
(
CommonConstants
.
SIX_STRING
.
equals
(
sysUserPermission
.
getPermissionType
())
...
@@ -77,7 +77,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -77,7 +77,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
.
eq
(
SysUserPermission:
:
getPermissionType
,
sysUserPermission
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getPermissionType
,
sysUserPermission
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getName
,
sysUserPermission
.
getName
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
.
eq
(
SysUserPermission:
:
getName
,
sysUserPermission
.
getName
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
permission
))
{
if
(
Common
.
isNotNull
(
permission
))
{
return
R
.
failed
(
"系统中已经存在对应
的名称权限维度
"
);
return
R
.
failed
(
"系统中已经存在对应
名称的权限类型
"
);
}
}
}
else
{
}
else
{
permission
=
this
.
getOne
(
Wrappers
.<
SysUserPermission
>
query
().
lambda
()
permission
=
this
.
getOne
(
Wrappers
.<
SysUserPermission
>
query
().
lambda
()
...
@@ -85,7 +85,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -85,7 +85,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
.
eq
(
SysUserPermission:
:
getPermissionType
,
sysUserPermission
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getPermissionType
,
sysUserPermission
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getCode
,
sysUserPermission
.
getCode
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
.
eq
(
SysUserPermission:
:
getCode
,
sysUserPermission
.
getCode
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
permission
))
{
if
(
Common
.
isNotNull
(
permission
))
{
return
R
.
failed
(
"系统中已经存在对应
的编码的权限维度
"
);
return
R
.
failed
(
"系统中已经存在对应
编码的权限类型
"
);
}
}
}
}
this
.
save
(
sysUserPermission
);
this
.
save
(
sysUserPermission
);
...
@@ -158,7 +158,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -158,7 +158,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
if
(
CommonConstants
.
ONE_STRING
.
equals
(
user
.
getId
()))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
user
.
getId
()))
{
iPage
=
baseMapper
.
selectContractVO
(
page
,
searchVo
.
getName
());
iPage
=
baseMapper
.
selectContractVO
(
page
,
searchVo
.
getName
());
}
else
{
}
else
{
iPage
=
baseMapper
.
selectContractSimpleVO
(
page
,
searchVo
.
getN
ame
(),
searchVo
.
getName
(),
searchVo
.
getType
());
iPage
=
baseMapper
.
selectContractSimpleVO
(
page
,
user
.
getUsern
ame
(),
searchVo
.
getName
(),
searchVo
.
getType
());
}
}
}
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
()))
{
//部门&&收入归属权限
//部门&&收入归属权限
...
@@ -168,7 +168,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -168,7 +168,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
if
(
CommonConstants
.
ONE_STRING
.
equals
(
user
.
getId
()))
{
if
(
CommonConstants
.
ONE_STRING
.
equals
(
user
.
getId
()))
{
iPage
=
baseMapper
.
selectSettleVO
(
page
,
searchVo
.
getName
());
iPage
=
baseMapper
.
selectSettleVO
(
page
,
searchVo
.
getName
());
}
else
{
}
else
{
iPage
=
baseMapper
.
selectContractSimpleVO
(
page
,
searchVo
.
getN
ame
(),
searchVo
.
getName
(),
searchVo
.
getType
());
iPage
=
baseMapper
.
selectContractSimpleVO
(
page
,
user
.
getUsern
ame
(),
searchVo
.
getName
(),
searchVo
.
getType
());
}
}
}
}
return
iPage
;
return
iPage
;
...
@@ -259,6 +259,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -259,6 +259,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
YifuUser
user
=
SecurityUtils
.
getUser
();
YifuUser
user
=
SecurityUtils
.
getUser
();
SysUserPermission
permission
;
SysUserPermission
permission
;
List
<
SysUserInfo
>
userInfo
;
List
<
SysUserInfo
>
userInfo
;
String
domainId
;
try
{
try
{
// 执行数据插入操作 组装
// 执行数据插入操作 组装
...
@@ -291,15 +292,26 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -291,15 +292,26 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
insert
.
setPermissionType
(
typeMap
.
get
(
excel
.
getPermissionType
()));
insert
.
setPermissionType
(
typeMap
.
get
(
excel
.
getPermissionType
()));
}
}
//部门权限的时候是否含下级必填
if
(
CommonConstants
.
EIGHT_STRING
.
equals
(
insert
.
getPermissionType
())
&&
Common
.
isEmpty
(
excel
.
getIsContains
()))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"权限类型为部门权限时,是否含下级部门必填"
,
excel
));
continue
;
}
//登录账号+维度+唯一标识唯一
//登录账号+维度+唯一标识唯一
StringBuilder
flag
=
new
StringBuilder
();
StringBuilder
flag
=
new
StringBuilder
();
flag
.
append
(
excel
.
getEmpLoginName
());
flag
.
append
(
excel
.
getEmpLoginName
());
flag
.
append
(
"_"
);
flag
.
append
(
"_"
);
flag
.
append
(
insert
.
getPermissionType
());
flag
.
append
(
insert
.
getPermissionType
());
flag
.
append
(
"_"
);
flag
.
append
(
"_"
);
flag
.
append
(
excel
.
getCode
());
if
(
CommonConstants
.
SIX_STRING
.
equals
(
insert
.
getPermissionType
())
||
CommonConstants
.
SEVEN_STRING
.
equals
(
insert
.
getPermissionType
()))
{
flag
.
append
(
excel
.
getName
());
}
else
{
flag
.
append
(
excel
.
getCode
());
}
if
(
null
!=
uniqueMap
.
get
(
flag
.
toString
()))
{
if
(
null
!=
uniqueMap
.
get
(
flag
.
toString
()))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"导表中已经存在该登录名对应的权限
维度
的名称或者编码!"
,
excel
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"导表中已经存在该登录名对应的权限
类型
的名称或者编码!"
,
excel
));
continue
;
continue
;
}
else
{
}
else
{
uniqueMap
.
put
(
flag
.
toString
(),
CommonConstants
.
ONE_STRING
);
uniqueMap
.
put
(
flag
.
toString
(),
CommonConstants
.
ONE_STRING
);
...
@@ -317,7 +329,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -317,7 +329,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
count
=
baseMapper
.
selectDictByName
(
excel
.
getName
(),
"line"
);
count
=
baseMapper
.
selectDictByName
(
excel
.
getName
(),
"line"
);
}
}
if
(
count
<
1
)
{
if
(
count
<
1
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"不存在对应
维度
的名称信息"
,
excel
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"不存在对应
权限类型
的名称信息"
,
excel
));
continue
;
continue
;
}
}
permission
=
this
.
getOne
(
Wrappers
.<
SysUserPermission
>
query
().
lambda
()
permission
=
this
.
getOne
(
Wrappers
.<
SysUserPermission
>
query
().
lambda
()
...
@@ -325,14 +337,15 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -325,14 +337,15 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
.
eq
(
SysUserPermission:
:
getPermissionType
,
insert
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getPermissionType
,
insert
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getName
,
excel
.
getName
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
.
eq
(
SysUserPermission:
:
getName
,
excel
.
getName
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
permission
))
{
if
(
Common
.
isNotNull
(
permission
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"系统中已经存在该用户对应的名称
权限维度
"
,
excel
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"系统中已经存在该用户对应的名称
的权限类型
"
,
excel
));
continue
;
continue
;
}
}
insert
.
setCode
(
null
);
}
else
{
}
else
{
//判断对应维度的编码是否存在
//判断对应维度的编码是否存在
Integer
count
=
this
.
checkExit
(
insert
.
getPermissionType
(),
excel
.
getCode
());
Integer
count
=
this
.
checkExit
(
insert
.
getPermissionType
(),
excel
.
getCode
());
if
(
count
<
1
)
{
if
(
count
<
1
)
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"不存在对应
维度
的编码信息"
,
excel
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"不存在对应
权限类型
的编码信息"
,
excel
));
continue
;
continue
;
}
}
permission
=
this
.
getOne
(
Wrappers
.<
SysUserPermission
>
query
().
lambda
()
permission
=
this
.
getOne
(
Wrappers
.<
SysUserPermission
>
query
().
lambda
()
...
@@ -340,7 +353,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -340,7 +353,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
.
eq
(
SysUserPermission:
:
getPermissionType
,
insert
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getPermissionType
,
insert
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getCode
,
excel
.
getCode
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
.
eq
(
SysUserPermission:
:
getCode
,
excel
.
getCode
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
permission
))
{
if
(
Common
.
isNotNull
(
permission
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"系统中已经存在该用户对应的编码的权限
维度
"
,
excel
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"系统中已经存在该用户对应的编码的权限
类型
"
,
excel
));
continue
;
continue
;
}
}
}
}
...
@@ -354,10 +367,18 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -354,10 +367,18 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
.
eq
(
SysUserPermission:
:
getPermissionType
,
insert
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getPermissionType
,
insert
.
getPermissionType
())
.
eq
(
SysUserPermission:
:
getCode
,
excel
.
getCode
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
.
eq
(
SysUserPermission:
:
getCode
,
excel
.
getCode
()).
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isEmpty
(
permission
))
{
if
(
Common
.
isEmpty
(
permission
))
{
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"
只有自己有权限的维度才可导入
"
,
excel
));
errorMessageList
.
add
(
new
ErrorMessage
(
excel
.
getRowIndex
(),
"
操作人仅可对本账号有权限的数据新增账号
"
,
excel
));
continue
;
continue
;
}
}
}
}
//项目权限的时候赋值项目id
if
(
CommonConstants
.
FIVE_STRING
.
equals
(
insert
.
getPermissionType
()))
{
domainId
=
baseMapper
.
selectSettleByCode
(
insert
.
getCode
());
insert
.
setDomainId
(
domainId
);
}
if
(!
CommonConstants
.
EIGHT_STRING
.
equals
(
insert
.
getPermissionType
()))
{
insert
.
setIsContains
(
null
);
}
// 插入数据
// 插入数据
insertExcel
(
insert
);
insertExcel
(
insert
);
}
}
...
@@ -369,7 +390,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
...
@@ -369,7 +390,7 @@ public class SysUserPermissionServiceImpl extends ServiceImpl<SysUserPermissionM
/**
/**
* 插入excel bad record
* 插入excel bad record
*/
*/
private
void
insertExcel
(
SysUserPermission
insert
)
{
private
void
insertExcel
(
SysUserPermission
insert
)
{
//转化是否含下级
//转化是否含下级
if
(
Common
.
isNotNull
(
insert
.
getIsContains
()))
{
if
(
Common
.
isNotNull
(
insert
.
getIsContains
()))
{
if
(
CommonConstants
.
IS_TRUE
.
equals
(
insert
.
getIsContains
()))
{
if
(
CommonConstants
.
IS_TRUE
.
equals
(
insert
.
getIsContains
()))
{
...
...
yifu-permission/yifu-permission-biz/src/main/resources/application.yml
View file @
ef15bd95
...
@@ -31,6 +31,12 @@ mybatis-plus:
...
@@ -31,6 +31,12 @@ mybatis-plus:
spring
:
spring
:
application
:
application
:
name
:
@
artifactId@
name
:
@
artifactId@
servlet
:
multipart
:
#所有上传文件最大大小
max-request-size
:
100MB
#单个文件最大大小
max-file-size
:
50MB
#swagger 文档 https://springdoc.org/
#swagger 文档 https://springdoc.org/
### OpenAPI3 注解
### OpenAPI3 注解
# OpenAPI 3 注解位置
# OpenAPI 3 注解位置
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysMenuMapper.xml
View file @
ef15bd95
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
<result
property=
"createName"
column=
"CREATE_NAME"
/>
<result
property=
"createName"
column=
"CREATE_NAME"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
/>
<result
property=
"createTime"
column=
"CREATE_TIME"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
/>
<result
property=
"updateTime"
column=
"UPDATE_TIME"
/>
<result
property=
"isOpen"
column=
"IS_OPEN"
/>
</resultMap>
</resultMap>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
a.ID,
a.ID,
...
@@ -46,6 +47,8 @@
...
@@ -46,6 +47,8 @@
a.BU_ID,
a.BU_ID,
a.LINE_ID,
a.LINE_ID,
a.DEPT_ID,
a.DEPT_ID,
a.IS_OPEN,
a.VIEW_ID,
a.CREATE_TIME
a.CREATE_TIME
</sql>
</sql>
<sql
id=
"sysMenu_where"
>
<sql
id=
"sysMenu_where"
>
...
@@ -83,6 +86,13 @@
...
@@ -83,6 +86,13 @@
WHERE a.fd_id = #{modelId}
WHERE a.fd_id = #{modelId}
</select>
</select>
<select
id=
"selectViewId"
resultType=
"java.lang.Long"
>
SELECT
count(1)
FROM modeling_app_collection_view a
WHERE a.fd_model_id = #{modelId} and a.fd_id = #{viewId}
</select>
<select
id=
"selectColumnList"
resultType=
"java.lang.String"
>
<select
id=
"selectColumnList"
resultType=
"java.lang.String"
>
SELECT
SELECT
a.fd_column
a.fd_column
...
...
yifu-permission/yifu-permission-biz/src/main/resources/mapper/SysUserPermissionMapper.xml
View file @
ef15bd95
...
@@ -35,6 +35,7 @@
...
@@ -35,6 +35,7 @@
<resultMap
id=
"nameAndCodeMap"
type=
"com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo"
>
<resultMap
id=
"nameAndCodeMap"
type=
"com.yifu.cloud.plus.v1.yifu.permission.vo.SysUserDeptVo"
>
<result
property=
"name"
column=
"name"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"code"
column=
"code"
/>
<result
property=
"code"
column=
"code"
/>
<result
property=
"domainId"
column=
"domainId"
/>
</resultMap>
</resultMap>
<resultMap
id=
"dictMap"
type=
"com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo"
>
<resultMap
id=
"dictMap"
type=
"com.yifu.cloud.plus.v1.yifu.permission.vo.SysDictVo"
>
...
@@ -156,7 +157,7 @@
...
@@ -156,7 +157,7 @@
<select
id=
"selectSettleVO"
resultMap=
"nameAndCodeMap"
>
<select
id=
"selectSettleVO"
resultMap=
"nameAndCodeMap"
>
SELECT
SELECT
a.fd_3a37fe508071fe code,a.fd_3a2b38c61ef9aa name
a.fd_3a37fe508071fe code,a.fd_3a2b38c61ef9aa name
,a.fd_id domainId
from ekp_24a8e6a7fc143bb8c48a a
from ekp_24a8e6a7fc143bb8c48a a
where 1=1
where 1=1
<if
test=
"name != null and name.trim() != ''"
>
<if
test=
"name != null and name.trim() != ''"
>
...
@@ -164,12 +165,19 @@
...
@@ -164,12 +165,19 @@
</if>
</if>
</select>
</select>
<!--根据项目编码查询id-->
<select
id=
"selectSettleByCode"
resultType=
"java.lang.String"
>
SELECT
a.fd_id
from ekp_24a8e6a7fc143bb8c48a a where a.fd_3a37fe508071fe = #{code} limit 1
</select>
<select
id=
"selectContractSimpleVO"
resultMap=
"nameAndCodeMap"
>
<select
id=
"selectContractSimpleVO"
resultMap=
"nameAndCodeMap"
>
SELECT
SELECT
a.NAME,
a.NAME,
a.CODE
a.CODE
from sys_user_permission a
from sys_user_permission a
where a.EMP_LOGIN_NAME = #{loginName} and a.PERMISSION_TYPE = #{type}
where a.EMP_LOGIN_NAME = #{loginName} and a.PERMISSION_TYPE = #{type}
and a.PERMISSION_STATUS = '0'
<if
test=
"name != null and name.trim() != ''"
>
<if
test=
"name != null and name.trim() != ''"
>
AND (a.NAME like concat('%',#{name},'%') or a.CODE like concat('%',#{name},'%'))
AND (a.NAME like concat('%',#{name},'%') or a.CODE like concat('%',#{name},'%'))
</if>
</if>
...
@@ -187,11 +195,11 @@
...
@@ -187,11 +195,11 @@
<select
id=
"selectQuotationVO"
resultMap=
"nameAndCodeMap"
>
<select
id=
"selectQuotationVO"
resultMap=
"nameAndCodeMap"
>
SELECT
SELECT
a.fd_3b04b9dc64a9f4 code,a.fd_3b04b9d
aa0c25e
name
a.fd_3b04b9dc64a9f4 code,a.fd_3b04b9d
8688cfa
name
from ekp_fd1449d265845e087bf2 a
from ekp_fd1449d265845e087bf2 a
where 1=1
where 1=1
<if
test=
"name != null and name.trim() != ''"
>
<if
test=
"name != null and name.trim() != ''"
>
AND (a.fd_3b04b9dc64a9f4 like concat('%',#{name},'%') or a.fd_3b04b9d
aa0c25e
like concat('%',#{name},'%'))
AND (a.fd_3b04b9dc64a9f4 like concat('%',#{name},'%') or a.fd_3b04b9d
8688cfa
like concat('%',#{name},'%'))
</if>
</if>
</select>
</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