Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-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
赵啸非
device-new-platform
Commits
011d175e
Commit
011d175e
authored
Nov 15, 2023
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改用户同步接口
parent
19b7c036
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
device-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
...ls/xhx/base/system/user/service/impl/UserServiceImpl.java
+15
-15
No files found.
device-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
View file @
011d175e
...
@@ -102,19 +102,21 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
...
@@ -102,19 +102,21 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
//更新不更新密码字段
//更新不更新密码字段
entity
.
setLoginPwd
(
null
);
entity
.
setLoginPwd
(
null
);
this
.
doHandlerUser
(
entity
);
this
.
doHandlerUser
(
entity
);
//更新角色
if
(
entity
.
getId
().
longValue
()
!=
SysConstains
.
ADMIN_ID
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getRoleIds
()))
{
RoleUserQuery
roleUserQuery
=
new
RoleUserQuery
();
roleUserQuery
.
setUserId
(
entity
.
getId
());
List
<
Long
>
idList
=
Arrays
.
asList
(
entity
.
getRoleIds
().
split
(
","
)).
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
roleUserQuery
.
setRoleIdList
(
idList
);
roleUserService
.
doDistributionRole
(
roleUserQuery
);
}
}
}
@Override
@Override
protected
void
saveAfter
(
UserEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
saveAfter
(
UserEntity
entity
,
Context
context
)
throws
AppException
{
//新增角色
//新增角色
updateUserRole
(
entity
);
super
.
saveAfter
(
entity
,
context
);
}
@Override
protected
void
updateAfter
(
UserEntity
entity
,
Context
context
)
throws
AppException
{
updateUserRole
(
entity
);
super
.
updateAfter
(
entity
,
context
);
}
private
void
updateUserRole
(
UserEntity
entity
)
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getId
())
&&
entity
.
getId
().
longValue
()
!=
SysConstains
.
ADMIN_ID
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getRoleIds
()))
{
if
(!
ObjectUtils
.
isEmpty
(
entity
.
getId
())
&&
entity
.
getId
().
longValue
()
!=
SysConstains
.
ADMIN_ID
&&
!
ObjectUtils
.
isEmpty
(
entity
.
getRoleIds
()))
{
RoleUserQuery
roleUserQuery
=
new
RoleUserQuery
();
RoleUserQuery
roleUserQuery
=
new
RoleUserQuery
();
roleUserQuery
.
setUserId
(
entity
.
getId
());
roleUserQuery
.
setUserId
(
entity
.
getId
());
...
@@ -122,7 +124,6 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
...
@@ -122,7 +124,6 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
roleUserQuery
.
setRoleIdList
(
idList
);
roleUserQuery
.
setRoleIdList
(
idList
);
roleUserService
.
doDistributionRole
(
roleUserQuery
);
roleUserService
.
doDistributionRole
(
roleUserQuery
);
}
}
super
.
saveAfter
(
entity
,
context
);
}
}
@Override
@Override
...
@@ -351,6 +352,11 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
...
@@ -351,6 +352,11 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
log
.
info
(
"需要新增用户数量:{}"
,
saveUpdateCollect
.
get
(
true
).
size
());
log
.
info
(
"需要新增用户数量:{}"
,
saveUpdateCollect
.
get
(
true
).
size
());
saveUpdateCollect
.
get
(
true
).
stream
().
forEach
(
item
->
{
saveUpdateCollect
.
get
(
true
).
stream
().
forEach
(
item
->
{
this
.
getUserDao
().
insert
(
item
);
this
.
getUserDao
().
insert
(
item
);
//更新默认用户角色
RoleUserQuery
roleUserQuery
=
new
RoleUserQuery
();
roleUserQuery
.
setUserId
(
item
.
getId
());
roleUserQuery
.
setRoleIdList
(
Arrays
.
asList
(
1L
));
roleUserService
.
doDistributionRole
(
roleUserQuery
);
});
});
}
}
...
@@ -359,14 +365,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
...
@@ -359,14 +365,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
log
.
info
(
"需要更新用户数量:{}"
,
saveUpdateCollect
.
get
(
false
).
size
());
log
.
info
(
"需要更新用户数量:{}"
,
saveUpdateCollect
.
get
(
false
).
size
());
saveUpdateCollect
.
get
(
false
).
stream
().
forEach
(
item
->
{
saveUpdateCollect
.
get
(
false
).
stream
().
forEach
(
item
->
{
this
.
getUserDao
().
update
(
item
);
this
.
getUserDao
().
update
(
item
);
//更新默认用户角色
RoleUserQuery
roleUserQuery
=
new
RoleUserQuery
();
roleUserQuery
.
setUserId
(
item
.
getId
());
roleUserQuery
.
setRoleIdList
(
Arrays
.
asList
(
1L
));
roleUserService
.
doDistributionRole
(
roleUserQuery
);
});
});
}
}
}
}
//查找新增 与更新
//查找新增 与更新
}
}
...
...
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