Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zh-baseversion-project
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
王浩
zh-baseversion-project
Commits
f19dae16
Commit
f19dae16
authored
Aug 09, 2024
by
lizhichao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
所属企业 改为string;deptid 改为String
parent
485129a4
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
54 additions
and
54 deletions
+54
-54
SysDeptController.java
...a/com/zehong/web/controller/system/SysDeptController.java
+5
-5
TreeSelect.java
...c/main/java/com/zehong/common/core/domain/TreeSelect.java
+4
-4
SysDept.java
...in/java/com/zehong/common/core/domain/entity/SysDept.java
+6
-6
SysRole.java
...in/java/com/zehong/common/core/domain/entity/SysRole.java
+3
-3
SysUser.java
...in/java/com/zehong/common/core/domain/entity/SysUser.java
+3
-3
SysRoleDept.java
...m/src/main/java/com/zehong/system/domain/SysRoleDept.java
+3
-3
SysUserPost.java
...m/src/main/java/com/zehong/system/domain/SysUserPost.java
+3
-3
SysDeptMapper.java
...src/main/java/com/zehong/system/mapper/SysDeptMapper.java
+7
-7
SysRoleDeptMapper.java
...main/java/com/zehong/system/mapper/SysRoleDeptMapper.java
+1
-1
ISysDeptService.java
.../main/java/com/zehong/system/service/ISysDeptService.java
+5
-5
SysDeptServiceImpl.java
...va/com/zehong/system/service/impl/SysDeptServiceImpl.java
+10
-10
SysRoleServiceImpl.java
...va/com/zehong/system/service/impl/SysRoleServiceImpl.java
+1
-1
SysUserServiceImpl.java
...va/com/zehong/system/service/impl/SysUserServiceImpl.java
+2
-2
SysUserMapper.xml
...system/src/main/resources/mapper/system/SysUserMapper.xml
+1
-1
No files found.
zh-baseversion-admin/src/main/java/com/zehong/web/controller/system/SysDeptController.java
View file @
f19dae16
...
...
@@ -49,14 +49,14 @@ public class SysDeptController extends BaseController
* 查询部门列表(排除节点)
*/
@GetMapping
(
"/list/exclude/{deptId}"
)
public
AjaxResult
excludeChild
(
@PathVariable
(
value
=
"deptId"
,
required
=
false
)
Lo
ng
deptId
)
public
AjaxResult
excludeChild
(
@PathVariable
(
value
=
"deptId"
,
required
=
false
)
Stri
ng
deptId
)
{
List
<
SysDept
>
depts
=
deptService
.
selectDeptList
(
new
SysDept
());
Iterator
<
SysDept
>
it
=
depts
.
iterator
();
while
(
it
.
hasNext
())
{
SysDept
d
=
(
SysDept
)
it
.
next
();
if
(
d
.
getDeptId
()
.
intValue
()
==
deptId
if
(
d
.
getDeptId
()
==
deptId
||
ArrayUtils
.
contains
(
StringUtils
.
split
(
d
.
getAncestors
(),
","
),
deptId
+
""
))
{
it
.
remove
();
...
...
@@ -69,7 +69,7 @@ public class SysDeptController extends BaseController
* 根据部门编号获取详细信息
*/
@GetMapping
(
value
=
"/{deptId}"
)
public
AjaxResult
getInfo
(
@PathVariable
Lo
ng
deptId
)
public
AjaxResult
getInfo
(
@PathVariable
Stri
ng
deptId
)
{
return
AjaxResult
.
success
(
deptService
.
selectDeptById
(
deptId
));
}
...
...
@@ -128,7 +128,7 @@ public class SysDeptController extends BaseController
return
AjaxResult
.
error
(
"修改部门'"
+
dept
.
getDeptName
()
+
"'失败,上级部门不能是自己"
);
}
else
if
(
StringUtils
.
equals
(
UserConstants
.
DEPT_DISABLE
,
dept
.
getStatus
())
&&
deptService
.
selectNormalChildrenDeptById
(
dept
.
getDeptId
())
>
0
)
&&
deptService
.
selectNormalChildrenDeptById
(
dept
.
getDeptId
())
!=
"0"
)
{
return
AjaxResult
.
error
(
"该部门包含未停用的子部门!"
);
}
...
...
@@ -141,7 +141,7 @@ public class SysDeptController extends BaseController
*/
@Log
(
title
=
"部门管理"
,
businessType
=
BusinessType
.
DELETE
)
@DeleteMapping
(
"/{deptId}"
)
public
AjaxResult
remove
(
@PathVariable
Lo
ng
deptId
)
public
AjaxResult
remove
(
@PathVariable
Stri
ng
deptId
)
{
if
(
deptService
.
hasChildByDeptId
(
deptId
))
{
...
...
zh-baseversion-common/src/main/java/com/zehong/common/core/domain/TreeSelect.java
View file @
f19dae16
...
...
@@ -17,7 +17,7 @@ public class TreeSelect implements Serializable
private
static
final
long
serialVersionUID
=
1L
;
/** 节点ID */
private
Lo
ng
id
;
private
Stri
ng
id
;
/** 节点名称 */
private
String
label
;
...
...
@@ -40,17 +40,17 @@ public class TreeSelect implements Serializable
public
TreeSelect
(
SysMenu
menu
)
{
this
.
id
=
menu
.
getMenuId
();
this
.
id
=
menu
.
getMenuId
()
.
toString
()
;
this
.
label
=
menu
.
getMenuName
();
this
.
children
=
menu
.
getChildren
().
stream
().
map
(
TreeSelect:
:
new
).
collect
(
Collectors
.
toList
());
}
public
Lo
ng
getId
()
public
Stri
ng
getId
()
{
return
id
;
}
public
void
setId
(
Lo
ng
id
)
public
void
setId
(
Stri
ng
id
)
{
this
.
id
=
id
;
}
...
...
zh-baseversion-common/src/main/java/com/zehong/common/core/domain/entity/SysDept.java
View file @
f19dae16
...
...
@@ -19,10 +19,10 @@ public class SysDept extends BaseEntity
private
static
final
long
serialVersionUID
=
1L
;
/** 部门ID */
private
Lo
ng
deptId
;
private
Stri
ng
deptId
;
/** 父部门ID */
private
Lo
ng
parentId
;
private
Stri
ng
parentId
;
/** 祖级列表 */
private
String
ancestors
;
...
...
@@ -54,22 +54,22 @@ public class SysDept extends BaseEntity
/** 子部门 */
private
List
<
SysDept
>
children
=
new
ArrayList
<
SysDept
>();
public
Lo
ng
getDeptId
()
public
Stri
ng
getDeptId
()
{
return
deptId
;
}
public
void
setDeptId
(
Lo
ng
deptId
)
public
void
setDeptId
(
Stri
ng
deptId
)
{
this
.
deptId
=
deptId
;
}
public
Lo
ng
getParentId
()
public
Stri
ng
getParentId
()
{
return
parentId
;
}
public
void
setParentId
(
Lo
ng
parentId
)
public
void
setParentId
(
Stri
ng
parentId
)
{
this
.
parentId
=
parentId
;
}
...
...
zh-baseversion-common/src/main/java/com/zehong/common/core/domain/entity/SysRole.java
View file @
f19dae16
...
...
@@ -57,7 +57,7 @@ public class SysRole extends BaseEntity
private
Long
[]
menuIds
;
/** 部门组(数据权限) */
private
Lo
ng
[]
deptIds
;
private
Stri
ng
[]
deptIds
;
public
SysRole
()
{
...
...
@@ -194,12 +194,12 @@ public class SysRole extends BaseEntity
this
.
menuIds
=
menuIds
;
}
public
Lo
ng
[]
getDeptIds
()
public
Stri
ng
[]
getDeptIds
()
{
return
deptIds
;
}
public
void
setDeptIds
(
Lo
ng
[]
deptIds
)
public
void
setDeptIds
(
Stri
ng
[]
deptIds
)
{
this
.
deptIds
=
deptIds
;
}
...
...
zh-baseversion-common/src/main/java/com/zehong/common/core/domain/entity/SysUser.java
View file @
f19dae16
...
...
@@ -94,7 +94,7 @@ public class SysUser extends BaseEntity
private
Long
[]
roleIds
;
/** 岗位组 */
private
Lo
ng
[]
postIds
;
private
Stri
ng
[]
postIds
;
private
String
enterpriseId
;
...
...
@@ -304,12 +304,12 @@ public class SysUser extends BaseEntity
this
.
roleIds
=
roleIds
;
}
public
Lo
ng
[]
getPostIds
()
public
Stri
ng
[]
getPostIds
()
{
return
postIds
;
}
public
void
setPostIds
(
Lo
ng
[]
postIds
)
public
void
setPostIds
(
Stri
ng
[]
postIds
)
{
this
.
postIds
=
postIds
;
}
...
...
zh-baseversion-system/src/main/java/com/zehong/system/domain/SysRoleDept.java
View file @
f19dae16
...
...
@@ -14,7 +14,7 @@ public class SysRoleDept
private
Long
roleId
;
/** 部门ID */
private
Lo
ng
deptId
;
private
Stri
ng
deptId
;
public
Long
getRoleId
()
{
...
...
@@ -26,12 +26,12 @@ public class SysRoleDept
this
.
roleId
=
roleId
;
}
public
Lo
ng
getDeptId
()
public
Stri
ng
getDeptId
()
{
return
deptId
;
}
public
void
setDeptId
(
Lo
ng
deptId
)
public
void
setDeptId
(
Stri
ng
deptId
)
{
this
.
deptId
=
deptId
;
}
...
...
zh-baseversion-system/src/main/java/com/zehong/system/domain/SysUserPost.java
View file @
f19dae16
...
...
@@ -14,7 +14,7 @@ public class SysUserPost
private
Long
userId
;
/** 岗位ID */
private
Lo
ng
postId
;
private
Stri
ng
postId
;
public
Long
getUserId
()
{
...
...
@@ -26,12 +26,12 @@ public class SysUserPost
this
.
userId
=
userId
;
}
public
Lo
ng
getPostId
()
public
Stri
ng
getPostId
()
{
return
postId
;
}
public
void
setPostId
(
Lo
ng
postId
)
public
void
setPostId
(
Stri
ng
postId
)
{
this
.
postId
=
postId
;
}
...
...
zh-baseversion-system/src/main/java/com/zehong/system/mapper/SysDeptMapper.java
View file @
f19dae16
...
...
@@ -34,7 +34,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 部门信息
*/
public
SysDept
selectDeptById
(
Lo
ng
deptId
);
public
SysDept
selectDeptById
(
Stri
ng
deptId
);
/**
* 根据ID查询所有子部门
...
...
@@ -42,7 +42,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 部门列表
*/
public
List
<
SysDept
>
selectChildrenDeptById
(
Lo
ng
deptId
);
public
List
<
SysDept
>
selectChildrenDeptById
(
Stri
ng
deptId
);
/**
* 根据ID查询所有子部门(正常状态)
...
...
@@ -50,7 +50,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 子部门数
*/
public
int
selectNormalChildrenDeptById
(
Lo
ng
deptId
);
public
String
selectNormalChildrenDeptById
(
Stri
ng
deptId
);
/**
* 是否存在子节点
...
...
@@ -58,7 +58,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 结果
*/
public
int
hasChildByDeptId
(
Lo
ng
deptId
);
public
int
hasChildByDeptId
(
Stri
ng
deptId
);
/**
* 查询部门是否存在用户
...
...
@@ -66,7 +66,7 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 结果
*/
public
int
checkDeptExistUser
(
Lo
ng
deptId
);
public
int
checkDeptExistUser
(
Stri
ng
deptId
);
/**
* 校验部门名称是否唯一
...
...
@@ -75,7 +75,7 @@ public interface SysDeptMapper
* @param parentId 父部门ID
* @return 结果
*/
public
SysDept
checkDeptNameUnique
(
@Param
(
"deptName"
)
String
deptName
,
@Param
(
"parentId"
)
Lo
ng
parentId
);
public
SysDept
checkDeptNameUnique
(
@Param
(
"deptName"
)
String
deptName
,
@Param
(
"parentId"
)
Stri
ng
parentId
);
/**
* 新增部门信息
...
...
@@ -114,5 +114,5 @@ public interface SysDeptMapper
* @param deptId 部门ID
* @return 结果
*/
public
int
deleteDeptById
(
Lo
ng
deptId
);
public
int
deleteDeptById
(
Stri
ng
deptId
);
}
zh-baseversion-system/src/main/java/com/zehong/system/mapper/SysRoleDeptMapper.java
View file @
f19dae16
...
...
@@ -32,7 +32,7 @@ public interface SysRoleDeptMapper
* @param deptId 部门ID
* @return 结果
*/
public
int
selectCountRoleDeptByDeptId
(
Lo
ng
deptId
);
public
int
selectCountRoleDeptByDeptId
(
Stri
ng
deptId
);
/**
* 批量新增角色部门信息
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/ISysDeptService.java
View file @
f19dae16
...
...
@@ -49,7 +49,7 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 部门信息
*/
public
SysDept
selectDeptById
(
Lo
ng
deptId
);
public
SysDept
selectDeptById
(
Stri
ng
deptId
);
/**
* 根据ID查询所有子部门(正常状态)
...
...
@@ -57,7 +57,7 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 子部门数
*/
public
int
selectNormalChildrenDeptById
(
Lo
ng
deptId
);
public
String
selectNormalChildrenDeptById
(
Stri
ng
deptId
);
/**
* 是否存在部门子节点
...
...
@@ -65,7 +65,7 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 结果
*/
public
boolean
hasChildByDeptId
(
Lo
ng
deptId
);
public
boolean
hasChildByDeptId
(
Stri
ng
deptId
);
/**
* 查询部门是否存在用户
...
...
@@ -73,7 +73,7 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 结果 true 存在 false 不存在
*/
public
boolean
checkDeptExistUser
(
Lo
ng
deptId
);
public
boolean
checkDeptExistUser
(
Stri
ng
deptId
);
/**
* 校验部门名称是否唯一
...
...
@@ -105,5 +105,5 @@ public interface ISysDeptService
* @param deptId 部门ID
* @return 结果
*/
public
int
deleteDeptById
(
Lo
ng
deptId
);
public
int
deleteDeptById
(
Stri
ng
deptId
);
}
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/SysDeptServiceImpl.java
View file @
f19dae16
...
...
@@ -54,7 +54,7 @@ public class SysDeptServiceImpl implements ISysDeptService
public
List
<
SysDept
>
buildDeptTree
(
List
<
SysDept
>
depts
)
{
List
<
SysDept
>
returnList
=
new
ArrayList
<
SysDept
>();
List
<
Long
>
tempList
=
new
ArrayList
<
Lo
ng
>();
List
<
String
>
tempList
=
new
ArrayList
<
Stri
ng
>();
for
(
SysDept
dept
:
depts
)
{
tempList
.
add
(
dept
.
getDeptId
());
...
...
@@ -109,7 +109,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 部门信息
*/
@Override
public
SysDept
selectDeptById
(
Lo
ng
deptId
)
public
SysDept
selectDeptById
(
Stri
ng
deptId
)
{
return
deptMapper
.
selectDeptById
(
deptId
);
}
...
...
@@ -121,7 +121,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 子部门数
*/
@Override
public
int
selectNormalChildrenDeptById
(
Lo
ng
deptId
)
public
String
selectNormalChildrenDeptById
(
Stri
ng
deptId
)
{
return
deptMapper
.
selectNormalChildrenDeptById
(
deptId
);
}
...
...
@@ -133,7 +133,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 结果
*/
@Override
public
boolean
hasChildByDeptId
(
Lo
ng
deptId
)
public
boolean
hasChildByDeptId
(
Stri
ng
deptId
)
{
int
result
=
deptMapper
.
hasChildByDeptId
(
deptId
);
return
result
>
0
?
true
:
false
;
...
...
@@ -146,7 +146,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 结果 true 存在 false 不存在
*/
@Override
public
boolean
checkDeptExistUser
(
Lo
ng
deptId
)
public
boolean
checkDeptExistUser
(
Stri
ng
deptId
)
{
int
result
=
deptMapper
.
checkDeptExistUser
(
deptId
);
return
result
>
0
?
true
:
false
;
...
...
@@ -161,9 +161,9 @@ public class SysDeptServiceImpl implements ISysDeptService
@Override
public
String
checkDeptNameUnique
(
SysDept
dept
)
{
Long
deptId
=
StringUtils
.
isNull
(
dept
.
getDeptId
())
?
-
1L
:
dept
.
getDeptId
();
String
deptId
=
StringUtils
.
isNull
(
dept
.
getDeptId
())
?
"-1"
:
dept
.
getDeptId
();
SysDept
info
=
deptMapper
.
checkDeptNameUnique
(
dept
.
getDeptName
(),
dept
.
getParentId
());
if
(
StringUtils
.
isNotNull
(
info
)
&&
info
.
getDeptId
().
longValue
()
!=
deptId
.
longValue
(
))
if
(
StringUtils
.
isNotNull
(
info
)
&&
!
info
.
getDeptId
().
equals
(
deptId
))
{
return
UserConstants
.
NOT_UNIQUE
;
}
...
...
@@ -236,7 +236,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @param newAncestors 新的父ID集合
* @param oldAncestors 旧的父ID集合
*/
public
void
updateDeptChildren
(
Lo
ng
deptId
,
String
newAncestors
,
String
oldAncestors
)
public
void
updateDeptChildren
(
Stri
ng
deptId
,
String
newAncestors
,
String
oldAncestors
)
{
List
<
SysDept
>
children
=
deptMapper
.
selectChildrenDeptById
(
deptId
);
for
(
SysDept
child
:
children
)
...
...
@@ -256,7 +256,7 @@ public class SysDeptServiceImpl implements ISysDeptService
* @return 结果
*/
@Override
public
int
deleteDeptById
(
Lo
ng
deptId
)
public
int
deleteDeptById
(
Stri
ng
deptId
)
{
return
deptMapper
.
deleteDeptById
(
deptId
);
}
...
...
@@ -288,7 +288,7 @@ public class SysDeptServiceImpl implements ISysDeptService
while
(
it
.
hasNext
())
{
SysDept
n
=
(
SysDept
)
it
.
next
();
if
(
StringUtils
.
isNotNull
(
n
.
getParentId
())
&&
n
.
getParentId
()
.
longValue
()
==
t
.
getDeptId
().
longValue
())
if
(
StringUtils
.
isNotNull
(
n
.
getParentId
())
&&
n
.
getParentId
()
==
t
.
getDeptId
())
{
tlist
.
add
(
n
);
}
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/SysRoleServiceImpl.java
View file @
f19dae16
...
...
@@ -269,7 +269,7 @@ public class SysRoleServiceImpl implements ISysRoleService
int
rows
=
1
;
// 新增角色与部门(数据权限)管理
List
<
SysRoleDept
>
list
=
new
ArrayList
<
SysRoleDept
>();
for
(
Lo
ng
deptId
:
role
.
getDeptIds
())
for
(
Stri
ng
deptId
:
role
.
getDeptIds
())
{
SysRoleDept
rd
=
new
SysRoleDept
();
rd
.
setRoleId
(
role
.
getRoleId
());
...
...
zh-baseversion-system/src/main/java/com/zehong/system/service/impl/SysUserServiceImpl.java
View file @
f19dae16
...
...
@@ -351,12 +351,12 @@ public class SysUserServiceImpl implements ISysUserService
*/
public
void
insertUserPost
(
SysUser
user
)
{
Lo
ng
[]
posts
=
user
.
getPostIds
();
Stri
ng
[]
posts
=
user
.
getPostIds
();
if
(
StringUtils
.
isNotNull
(
posts
))
{
// 新增用户与岗位管理
List
<
SysUserPost
>
list
=
new
ArrayList
<
SysUserPost
>();
for
(
Lo
ng
postId
:
posts
)
for
(
Stri
ng
postId
:
posts
)
{
SysUserPost
up
=
new
SysUserPost
();
up
.
setUserId
(
user
.
getUserId
());
...
...
zh-baseversion-system/src/main/resources/mapper/system/SysUserMapper.xml
View file @
f19dae16
...
...
@@ -204,7 +204,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
LEFT JOIN sys_user_post up ON u.user_id = up.user_id
LEFT JOIN sys_post p ON up.post_id = p.post_id
<where>
<if
test=
"enterpriseId != null
and enterpriseId != 0
"
>
<if
test=
"enterpriseId != null"
>
AND u.dept_id = #{enterpriseId}
</if>
<if
test=
"postCode !=null and postCode != ''"
>
...
...
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