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
a54847d8
Commit
a54847d8
authored
Nov 14, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改刷新用户树
parent
a1a48388
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
50 deletions
+7
-50
base-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
...in/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
+1
-45
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
...mortals/xhx/module/site/service/impl/SiteServiceImpl.java
+6
-5
No files found.
base-manager/src/main/java/com/mortals/xhx/daemon/task/SyncUserTaskImpl.java
View file @
a54847d8
...
@@ -36,54 +36,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
...
@@ -36,54 +36,10 @@ public class SyncUserTaskImpl implements ITaskExcuteService {
@Autowired
@Autowired
private
UserService
userService
;
private
UserService
userService
;
@Autowired
private
IUserFeign
userFeign
;
@Override
@Override
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
public
void
excuteTask
(
ITask
task
)
throws
AppException
{
userService
.
refreshUser
();
log
.
info
(
"同步用户"
);
log
.
info
(
"同步用户"
);
/* UserPdu userPdu = new UserPdu();
userService
.
refreshUser
();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData());*/
//resourceService.updateUserList();
/* UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
*//* List<UserPdu> firstList = list.getData().getData();
List<UserEntity> secondList = userService.find(new UserQuery());
//交叉对比后,多的新增 少的删除
List<UserEntity> diffList = secondList.parallelStream()
.filter(item -> !firstList.parallelStream().map(e -> e.getId()).collect(Collectors.toList()).contains(item.getId()))
.collect(Collectors.toList());*//*
//log.info("diffList:{}",JSON.toJSONString(diffList));
//更新本地用户信息,并且更新用户站点树
list.getData().getData().forEach(user -> {
//查询用户是否存在,
//UserEntity userEntity = userService.get(user.getId());
UserEntity userEntity =userService.selectOne(new UserQuery().loginName(user.getLoginName()));
if (ObjectUtils.isEmpty(userEntity)) {
//新增
UserEntity entity = new UserEntity();
entity.initAttrValue();
BeanUtils.copyProperties(user, entity, BeanUtil.getNullPropertyNames(user));
userService.save(entity);
Context context = new Context();
context.setUser(entity);
new Thread(new SyncTreeSiteThread(siteService, context)).start();
}
});*/
}
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
View file @
a54847d8
...
@@ -217,7 +217,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -217,7 +217,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
@Override
@Override
protected
void
saveAfter
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
saveAfter
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
super
.
saveAfter
(
entity
,
context
);
super
.
saveAfter
(
entity
,
context
);
this
.
updateAllSiteTree
(
context
);
userService
.
refreshUser
();
// this.updateAllSiteTree(context);
//通知php系统更新
//通知php系统更新
String
phpUrl
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_PHP_HTTP_URL
,
"http://127.0.0.1:11078/zwfw_api"
);
String
phpUrl
=
GlobalSysInfo
.
getParamValue
(
PARAM_SERVER_PHP_HTTP_URL
,
"http://127.0.0.1:11078/zwfw_api"
);
HashMap
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
HashMap
<
String
,
String
>
paramsMap
=
new
HashMap
<>();
...
@@ -365,11 +366,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -365,11 +366,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Rest
<
Void
>
rest1
=
deviceFeign
.
refreshMessage
(
devicePdu
);
Rest
<
Void
>
rest1
=
deviceFeign
.
refreshMessage
(
devicePdu
);
log
.
info
(
"调用刷新结果:{}"
,
JSON
.
toJSONString
(
rest1
));
log
.
info
(
"调用刷新结果:{}"
,
JSON
.
toJSONString
(
rest1
));
refresh
=
false
;
refresh
=
false
;
//刷新站点树
//刷新用户站点树
cacheService
.
del
(
USER_SITE_TREE
);
// cacheService.del(USER_SITE_TREE);
this
.
updateAllSiteTree
(
context
);
// this.updateAllSiteTree(context);
userService
.
refreshUser
();
}
}
}
}
...
...
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