Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
smart_gov_platform
Commits
cc1a6c0d
Commit
cc1a6c0d
authored
Jun 02, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除角色关联删除
parent
1c45ebd0
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
3 deletions
+32
-3
portal-manager/doc/api.md
portal-manager/doc/api.md
+1
-1
portal-manager/src/main/java/com/mortals/xhx/module/role/service/impl/RoleServiceImpl.java
...mortals/xhx/module/role/service/impl/RoleServiceImpl.java
+31
-1
portal-manager/src/main/java/com/mortals/xhx/module/user/service/impl/UserServiceImpl.java
...mortals/xhx/module/user/service/impl/UserServiceImpl.java
+0
-1
No files found.
portal-manager/doc/api.md
View file @
cc1a6c0d
...
@@ -690,7 +690,7 @@ data|object|数据对象
...
@@ -690,7 +690,7 @@ data|object|数据对象
**响应消息样例:**
**响应消息样例:**
```
```
{
{
"msg":"新增
模块
成功",
"msg":"新增成功",
"code":1,
"code":1,
"data":{}
"data":{}
}
}
...
...
portal-manager/src/main/java/com/mortals/xhx/module/role/service/impl/RoleServiceImpl.java
View file @
cc1a6c0d
...
@@ -8,22 +8,52 @@
...
@@ -8,22 +8,52 @@
package
com.mortals.xhx.module.role.service.impl
;
package
com.mortals.xhx.module.role.service.impl
;
import
com.mortals.framework.exception.AppException
;
import
com.mortals.framework.model.Context
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.framework.service.impl.AbstractCRUDServiceImpl
;
import
com.mortals.xhx.module.role.dao.RoleDao
;
import
com.mortals.xhx.module.role.dao.RoleDao
;
import
com.mortals.xhx.module.role.model.RoleEntity
;
import
com.mortals.xhx.module.role.model.*
;
import
com.mortals.xhx.module.role.service.RoleAuthService
;
import
com.mortals.xhx.module.role.service.RoleService
;
import
com.mortals.xhx.module.role.service.RoleService
;
import
com.mortals.xhx.module.role.service.RoleUserService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.util.ObjectUtils
;
import
java.util.Arrays
;
/**
/**
* <p>Title: 角色信息</p>
* <p>Title: 角色信息</p>
* <p>Description: RoleServiceImpl service接口 </p>
* <p>Description: RoleServiceImpl service接口 </p>
* <p>Copyright: Copyright ® </p>
* <p>Copyright: Copyright ® </p>
* <p>Company: </p>
* <p>Company: </p>
*
* @author
* @author
* @version 1.0.0
* @version 1.0.0
*/
*/
@Service
(
"roleService"
)
@Service
(
"roleService"
)
public
class
RoleServiceImpl
extends
AbstractCRUDServiceImpl
<
RoleDao
,
RoleEntity
,
Long
>
implements
RoleService
{
public
class
RoleServiceImpl
extends
AbstractCRUDServiceImpl
<
RoleDao
,
RoleEntity
,
Long
>
implements
RoleService
{
@Autowired
private
RoleAuthService
roleAuthService
;
@Autowired
private
RoleUserService
roleUserService
;
@Override
protected
void
removeAfter
(
Long
[]
ids
,
Context
context
,
int
result
)
throws
AppException
{
RoleAuthQuery
roleAuthQuery
=
new
RoleAuthQuery
();
roleAuthQuery
.
setRoleIdList
(
Arrays
.
asList
(
ids
));
Long
[]
roleAuthIds
=
roleAuthService
.
find
(
roleAuthQuery
).
stream
().
map
(
RoleAuthEntity:
:
getId
).
toArray
(
Long
[]::
new
);
if
(!
ObjectUtils
.
isEmpty
(
roleAuthIds
))
{
roleAuthService
.
remove
(
roleAuthIds
,
context
);
}
RoleUserQuery
roleUserQuery
=
new
RoleUserQuery
();
roleUserQuery
.
setRoleIdList
(
Arrays
.
asList
(
ids
));
Long
[]
roleUserIds
=
roleUserService
.
find
(
roleUserQuery
).
stream
().
map
(
RoleUserEntity:
:
getId
).
toArray
(
Long
[]::
new
);
if
(!
ObjectUtils
.
isEmpty
(
roleUserIds
))
{
roleUserService
.
remove
(
roleUserIds
,
context
);
}
super
.
removeAfter
(
ids
,
context
,
result
);
}
}
}
\ No newline at end of file
portal-manager/src/main/java/com/mortals/xhx/module/user/service/impl/UserServiceImpl.java
View file @
cc1a6c0d
...
@@ -56,7 +56,6 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
...
@@ -56,7 +56,6 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
if
(!
ObjectUtils
.
isEmpty
(
collect
.
get
(
item
.
getId
()))){
if
(!
ObjectUtils
.
isEmpty
(
collect
.
get
(
item
.
getId
()))){
item
.
setRoleId
(
collect
.
get
(
item
.
getId
()).
stream
().
map
(
RoleUserEntity:
:
getRoleId
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
item
.
setRoleId
(
collect
.
get
(
item
.
getId
()).
stream
().
map
(
RoleUserEntity:
:
getRoleId
).
map
(
String:
:
valueOf
).
collect
(
Collectors
.
joining
(
","
)));
item
.
setRoleName
(
collect
.
get
(
item
.
getId
()).
stream
().
map
(
m
->
roleMap
.
get
(
m
.
getRoleId
())).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
joining
(
","
)));
item
.
setRoleName
(
collect
.
get
(
item
.
getId
()).
stream
().
map
(
m
->
roleMap
.
get
(
m
.
getRoleId
())).
filter
(
f
->
f
!=
null
).
collect
(
Collectors
.
joining
(
","
)));
}
}
});
});
super
.
findAfter
(
entity
,
pageInfo
,
context
,
list
);
super
.
findAfter
(
entity
,
pageInfo
,
context
,
list
);
...
...
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