Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
work_service
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
licc
work_service
Commits
3b1976c3
Commit
3b1976c3
authored
Mar 16, 2021
by
cq990612
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化代码结构
parent
c222aa80
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
BASE_RESP_CODE_ENUM.java
...wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
+2
-1
WorkUserServiceImpl.java
...n/java/cn/wisenergy/service/impl/WorkUserServiceImpl.java
+9
-1
No files found.
wisenergy-common/src/main/java/cn/wisenergy/common/utils/exception/BASE_RESP_CODE_ENUM.java
View file @
3b1976c3
...
...
@@ -82,7 +82,8 @@ public enum BASE_RESP_CODE_ENUM {
ROLE_CANNOTBE_EMPTY
(
"662"
,
"设置的角色不能为空"
),
NOADMIN_ISTRATIVE_RIGHTS
(
"663"
,
"设置的负责人没有管理权限"
),
CHOOSEATLEASTONEROLE
(
"667"
,
"至少保留一个角色"
),
DOWNLOAD_ERROR
(
"668"
,
"下载出错"
)
DOWNLOAD_ERROR
(
"668"
,
"下载出错"
),
PLEASE_CANCELTHE_MANAGEMENTROLE
(
"669"
,
"注销账号,请取消管理角色"
),
;
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/impl/WorkUserServiceImpl.java
View file @
3b1976c3
...
...
@@ -212,7 +212,6 @@ public class WorkUserServiceImpl implements WorkUserService {
@Override
public
Boolean
modifyRole
(
Integer
userId
,
List
<
Integer
>
roleIds
,
Integer
status
,
Integer
submitOrder
)
{
log
.
info
(
"WorkUserServiceImpl[]modifyRole[].input.param.userId:{},roleIds:{},status:{},submitOrder:{}"
+
userId
,
roleIds
,
status
,
submitOrder
);
PageHelper
.
clearPage
();
if
(
CollectionUtils
.
isEmpty
(
roleIds
))
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
CHOOSEATLEASTONEROLE
);
}
...
...
@@ -226,6 +225,7 @@ public class WorkUserServiceImpl implements WorkUserService {
if
(
null
==
workUser
)
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
QUERY_DATA_IS_NULL
);
}
WorkDept
workDept
=
workDeptService
.
getById
(
workUser
.
getDeptId
());
WorkCentre
centre
=
workCentreService
.
getCentreById
(
workDept
.
getCentreId
());
List
<
Integer
>
roles
=
workUserRoleMapper
.
getRole
(
userId
);
...
...
@@ -282,6 +282,14 @@ public class WorkUserServiceImpl implements WorkUserService {
workCentreService
.
updateById
(
centre
);
}
}
if
(
null
!=
status
&&
status
==
0
&&
!
CollectionUtils
.
isEmpty
(
roleIds
))
{
if
(
roleIds
.
size
()
==
1
&&
roleIds
.
get
(
0
).
equals
(
0
))
{
}
else
{
throw
new
BaseCustomException
(
BASE_RESP_CODE_ENUM
.
PLEASE_CANCELTHE_MANAGEMENTROLE
);
}
}
workUserRoleMapper
.
insertBatch
(
userId
,
roleIds
);
return
true
;
}
...
...
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