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
a1a48388
Commit
a1a48388
authored
Nov 14, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改刷新用户树
parent
6d018c9b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
138 deletions
+32
-138
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
...ls/xhx/base/system/user/service/impl/UserServiceImpl.java
+3
-20
base-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DemoStartedService.java
...als/xhx/daemon/applicationservice/DemoStartedService.java
+6
-1
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
...mortals/xhx/module/site/service/impl/SiteServiceImpl.java
+1
-117
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteController.java
.../java/com/mortals/xhx/module/site/web/SiteController.java
+22
-0
No files found.
base-manager/src/main/java/com/mortals/xhx/base/system/user/service/impl/UserServiceImpl.java
View file @
a1a48388
...
@@ -395,23 +395,6 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
...
@@ -395,23 +395,6 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
siteService
.
updateAllSiteTree
(
null
);
siteService
.
updateAllSiteTree
(
null
);
/* //单独更新全站点
UserEntity userEntity = new UserEntity();
userEntity.initAttrValue();
userEntity.setId(0L);
Context contextTemp = new Context();
contextTemp.setUser(userEntity);
SyncTreeSiteThread syncTreeSiteThread = new SyncTreeSiteThread(contextTemp);
ThreadPool.getInstance().execute(syncTreeSiteThread);
userEntity = new UserEntity();
userEntity.initAttrValue();
userEntity.setId(1L);
contextTemp = new Context();
contextTemp.setUser(userEntity);
syncTreeSiteThread = new SyncTreeSiteThread(contextTemp);
ThreadPool.getInstance().execute(syncTreeSiteThread);
*/
}
}
...
@@ -429,7 +412,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
...
@@ -429,7 +412,7 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
List
<
UserEntity
>
newUserList
=
userPduList
.
stream
().
map
(
newUser
->
{
List
<
UserEntity
>
newUserList
=
userPduList
.
stream
().
map
(
newUser
->
{
UserEntity
userEntity
=
new
UserEntity
();
UserEntity
userEntity
=
new
UserEntity
();
userEntity
.
initAttrValue
();
userEntity
.
initAttrValue
();
BeanUtils
.
copyProperties
(
newUser
,
userEntity
,
new
String
[]{
"lastLoginTime"
,
"lastLoginAddress"
});
BeanUtils
.
copyProperties
(
newUser
,
userEntity
,
new
String
[]{
"lastLoginTime"
,
"lastLoginAddress"
});
return
userEntity
;
return
userEntity
;
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
...
@@ -497,8 +480,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
...
@@ -497,8 +480,8 @@ public class UserServiceImpl extends AbstractCRUDCacheServiceImpl<UserDao, UserE
System
.
out
.
println
(
SecurityUtil
.
md5DoubleEncoding
(
"xhxADMIN8@a"
));
System
.
out
.
println
(
SecurityUtil
.
md5DoubleEncoding
(
"xhxADMIN8@a"
));
// System.out.println(SecurityUtil.md5DoubleEncoding("123"));
// System.out.println(SecurityUtil.md5DoubleEncoding("123"));
// System.out.println(SecurityUtil.md5DoubleEncoding("Qt123456@"));
// System.out.println(SecurityUtil.md5DoubleEncoding("Qt123456@"));
/*
/*
//宜宾一体化账号密码
//宜宾一体化账号密码
...
...
base-manager/src/main/java/com/mortals/xhx/daemon/applicationservice/DemoStartedService.java
View file @
a1a48388
...
@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
...
@@ -10,6 +10,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
USER_SITE_TREE
;
import
static
com
.
mortals
.
xhx
.
common
.
key
.
Constant
.
USER_SITE_TREE
;
...
@@ -22,6 +23,8 @@ public class DemoStartedService implements IApplicationStartedService {
...
@@ -22,6 +23,8 @@ public class DemoStartedService implements IApplicationStartedService {
private
ICacheService
cacheService
;
private
ICacheService
cacheService
;
@Autowired
@Autowired
private
SiteService
siteService
;
private
SiteService
siteService
;
@Autowired
private
UserService
userService
;
@Override
@Override
public
void
start
()
{
public
void
start
()
{
...
@@ -29,7 +32,9 @@ public class DemoStartedService implements IApplicationStartedService {
...
@@ -29,7 +32,9 @@ public class DemoStartedService implements IApplicationStartedService {
log
.
info
(
"开始服务..[初始化用户站点树]"
);
log
.
info
(
"开始服务..[初始化用户站点树]"
);
//删除redis 中的 站点树
//删除redis 中的 站点树
cacheService
.
del
(
USER_SITE_TREE
);
cacheService
.
del
(
USER_SITE_TREE
);
siteService
.
updateAllSiteTree
(
null
);
//从门户获取所有站点用户
userService
.
refreshUser
();
}
}
@Override
@Override
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/service/impl/SiteServiceImpl.java
View file @
a1a48388
...
@@ -213,27 +213,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -213,27 +213,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
super
.
saveBefore
(
entity
,
context
);
super
.
saveBefore
(
entity
,
context
);
}
}
@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
);
//刷新站点树
//ThreadPool.getInstance().execute(new SyncTreeSiteThread(this,context));
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData());
}*/
this
.
updateAllSiteTree
(
context
);
this
.
updateAllSiteTree
(
context
);
//新加的站点 只需要更新全树
//更新同步部门相关
//deptService.syncDeptBySiteId(entity, 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
<>();
...
@@ -374,14 +358,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -374,14 +358,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
protected
void
updateAfter
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
protected
void
updateAfter
(
SiteEntity
entity
,
Context
context
)
throws
AppException
{
super
.
updateAfter
(
entity
,
context
);
super
.
updateAfter
(
entity
,
context
);
//刷新站点树
//刷新站点树
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
userService.updateUserList(list.getData().getData());
}*/
if
(
refresh
)
{
if
(
refresh
)
{
//通知设备更新站点信息
//通知设备更新站点信息
DevicePdu
devicePdu
=
new
DevicePdu
();
DevicePdu
devicePdu
=
new
DevicePdu
();
...
@@ -389,8 +365,6 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -389,8 +365,6 @@ 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
);
...
@@ -742,13 +716,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -742,13 +716,11 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
Integer
total
=
restStat
.
getData
().
getOrDefault
(
"total"
,
0
);
Integer
total
=
restStat
.
getData
().
getOrDefault
(
"total"
,
0
);
//获取事项全列表
//获取事项全列表
Rest
<
List
<
MatterEntity
>>
matterAllRest
=
this
.
getMatterAllListByGOV
(
params
,
pageNum
,
context
);
Rest
<
List
<
MatterEntity
>>
matterAllRest
=
this
.
getMatterAllListByGOV
(
params
,
pageNum
,
context
);
if
(
matterAllRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
if
(
matterAllRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
return
matterAllRest
.
getData
();
return
matterAllRest
.
getData
();
}
}
}
}
return
new
ArrayList
<
MatterEntity
>();
return
new
ArrayList
<
MatterEntity
>();
}
}
...
@@ -777,56 +749,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -777,56 +749,8 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
}
}
}
}
log
.
info
(
"抓取事项结束"
);
log
.
info
(
"抓取事项结束"
);
/* HashMap<String, String> params = new HashMap<>();
params.put("dxType", dxType);
params.put("areaCode", siteEntity.getAreaCode());
params.put("deptCode", "");
params.put("searchtext", "");
params.put("taskType", "");
params.put("pageno", "1");
params.put("type", "2");
List<MatterEntity> govMatterList = this.getMatters(params, context);
dxType = "3";
params = new HashMap<>();
params.put("dxType", dxType);
params.put("areaCode", siteEntity.getAreaCode());
params.put("deptCode", "");
params.put("searchtext", "");
params.put("taskType", "");
params.put("pageno", "1");
params.put("type", "2");
List<MatterEntity> mattersTwo = this.getMatters(params, context);
govMatterList.addAll(mattersTwo);*/
// new MatterQuery().setMatterNoNotList();
// List<MatterEntity> localMatterList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()));
//HashSet<String> matterNoSet = new HashSet<>();
Set
<
String
>
matterNoSet
=
matterService
.
getDao
().
getMatterListByAreaCode
(
new
MatterQuery
().
areaCode
(
siteEntity
.
getAreaCode
())).
parallelStream
().
map
(
i
->
i
.
getMatterNo
()).
collect
(
Collectors
.
toSet
());
Set
<
String
>
matterNoSet
=
matterService
.
getDao
().
getMatterListByAreaCode
(
new
MatterQuery
().
areaCode
(
siteEntity
.
getAreaCode
())).
parallelStream
().
map
(
i
->
i
.
getMatterNo
()).
collect
(
Collectors
.
toSet
());
/* Integer page = 1;
Integer size = 200;
PageInfo pageInfo = new PageInfo();
pageInfo.setCountPage(false);
while (true) {
pageInfo.setCurrPage(page);
pageInfo.setPrePageResult(size);
Result<MatterEntity> matterEntityResult = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()), pageInfo, context);
if (ObjectUtils.isEmpty(matterEntityResult.getList())) {
break;
}
Set<String> collect = matterEntityResult.getList().parallelStream().map(i -> i.getMatterNo()).collect(Collectors.toSet());
matterNoSet.addAll(collect);
page++;
log.info("page:{},size:{}", page, collect.size());
}*/
log
.
info
(
"计算差集"
);
log
.
info
(
"计算差集"
);
// List<MatterEntity> subList = this.subList(govMatterList, localMatterList);
// List<MatterEntity> subList = this.subList(govMatterList, localMatterList);
List
<
MatterEntity
>
subList
=
this
.
subListSet
(
govMatterList
,
matterNoSet
);
List
<
MatterEntity
>
subList
=
this
.
subListSet
(
govMatterList
,
matterNoSet
);
...
@@ -842,47 +766,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
...
@@ -842,47 +766,7 @@ public class SiteServiceImpl extends AbstractCRUDCacheServiceImpl<SiteDao, SiteE
matterEntity
.
setCreateTime
(
new
Date
());
matterEntity
.
setCreateTime
(
new
Date
());
matterService
.
save
(
matterEntity
,
context
);
matterService
.
save
(
matterEntity
,
context
);
}
}
/* List<List<MatterEntity>> partition = ListUtil.partition(subList, 100);
for (List<MatterEntity> matterEntityList : partition) {
log.info("insert subList size:" + matterEntityList.size());
int count = matterService.save(matterEntityList, context);
log.info("insert subList size success:" + count);
}*/
}
/* Rest<Map<String, Integer>> restStat = MatterHtmlParseUtil.statSiteMatterDeptCount(params, url);
if (restStat.getCode() == YesNoEnum.YES.getValue()) {
Integer pageNum = restStat.getData().getOrDefault("pageNum", 0);
Integer total = restStat.getData().getOrDefault("total", 0);
//获取事项全列表
Rest<List<MatterEntity>> matterAllRest = this.getMatterAllListByGOV(params, pageNum, context);
if (matterAllRest.getCode() == YesNoEnum.YES.getValue()) {
List<MatterEntity> govMatterList = matterAllRest.getData();
List<MatterEntity> localMatterList = matterService.find(new MatterQuery().areaCode(siteEntity.getAreaCode()));
List<MatterEntity> subList = this.subList(govMatterList, localMatterList);
log.info("需要添加事项数量====" + subList.size());
//差集进行插入并更新详细数据
if (!ObjectUtils.isEmpty(subList)) {
for (MatterEntity matterEntity : subList) {
DeptEntity deptCache = deptService.getExtCache(matterEntity.getDeptCode());
matterEntity.setDeptName(deptCache == null ? "" : deptCache.getName());
matterService.save(matterEntity, context);
}
List<List<MatterEntity>> partition = ListUtil.partition(subList, 100);
for (List<MatterEntity> matterEntityList : partition) {
log.info("insert subList size:" + matterEntityList.size());
int count = matterService.save(matterEntityList, context);
log.info("insert subList size success:" + count);
}
}
}
}
}
*/
return
Rest
.
ok
(
"同步事项条数成功!"
);
return
Rest
.
ok
(
"同步事项条数成功!"
);
}
}
...
...
base-manager/src/main/java/com/mortals/xhx/module/site/web/SiteController.java
View file @
a1a48388
...
@@ -17,8 +17,12 @@ import com.mortals.xhx.common.code.AreaLevelEnum;
...
@@ -17,8 +17,12 @@ import com.mortals.xhx.common.code.AreaLevelEnum;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.code.YesNoEnum
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.common.key.Constant
;
import
com.mortals.xhx.common.keys.RedisCacheKeys
;
import
com.mortals.xhx.common.keys.RedisCacheKeys
;
import
com.mortals.xhx.common.pdu.RespData
;
import
com.mortals.xhx.common.pdu.user.UserPdu
;
import
com.mortals.xhx.common.utils.SyncDeptThread
;
import
com.mortals.xhx.common.utils.SyncDeptThread
;
import
com.mortals.xhx.common.utils.SyncGovMatterDetailThread
;
import
com.mortals.xhx.common.utils.SyncGovMatterDetailThread
;
import
com.mortals.xhx.common.utils.SyncTreeSiteThread
;
import
com.mortals.xhx.feign.user.IUserFeign
;
import
com.mortals.xhx.module.area.model.AreaEntity
;
import
com.mortals.xhx.module.area.model.AreaEntity
;
import
com.mortals.xhx.module.area.model.AreaQuery
;
import
com.mortals.xhx.module.area.model.AreaQuery
;
import
com.mortals.xhx.module.area.service.AreaService
;
import
com.mortals.xhx.module.area.service.AreaService
;
...
@@ -36,6 +40,7 @@ import com.mortals.xhx.module.site.service.SiteService;
...
@@ -36,6 +40,7 @@ import com.mortals.xhx.module.site.service.SiteService;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.apache.commons.collections4.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Lazy
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
...
@@ -63,6 +68,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
...
@@ -63,6 +68,9 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
private
SiteService
siteService
;
private
SiteService
siteService
;
@Autowired
@Autowired
private
AreaService
areaService
;
private
AreaService
areaService
;
@Autowired
@Lazy
private
IUserFeign
userFeign
;
public
SiteController
()
{
public
SiteController
()
{
super
.
setModuleDesc
(
"站点"
);
super
.
setModuleDesc
(
"站点"
);
...
@@ -571,6 +579,20 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
...
@@ -571,6 +579,20 @@ public class SiteController extends BaseCRUDJsonBodyMappingController<SiteServic
List
<
SiteEntity
>
siteEntities
=
this
.
service
.
find
(
new
SiteQuery
().
areaCode
(
siteEntity
.
getAreaCode
()));
List
<
SiteEntity
>
siteEntities
=
this
.
service
.
find
(
new
SiteQuery
().
areaCode
(
siteEntity
.
getAreaCode
()));
siteEntity
.
setSiteCode
(
siteEntity
.
getAreaCode
()
+
Constant
.
SITE_SPLIT_MARK
+
StringUtils
.
lpad
(
siteEntities
.
size
()
+
1
,
Constant
.
SITE_CODE_NUM
));
siteEntity
.
setSiteCode
(
siteEntity
.
getAreaCode
()
+
Constant
.
SITE_SPLIT_MARK
+
StringUtils
.
lpad
(
siteEntities
.
size
()
+
1
,
Constant
.
SITE_CODE_NUM
));
this
.
service
.
getDao
().
update
(
siteEntity
);
this
.
service
.
getDao
().
update
(
siteEntity
);
//todo 更新用户站点树
/* Rest<String> rest = userFeign.synchSiteAuth();
if (rest.getCode().equals(YesNoEnum.YES.getValue())) {
UserPdu userPdu = new UserPdu();
userPdu.setPage(1);
userPdu.setSize(-1);
Rest<RespData<List<UserPdu>>> list = userFeign.list(userPdu);
this.service.updateUserList(list.getData().getData());
// ThreadPool.getInstance().execute(new SyncTreeSiteThread(this,context));
this.service.updateAllSiteTree(null);*/
}
else
{
}
else
{
this
.
service
.
save
(
siteEntity
,
getContext
());
this
.
service
.
save
(
siteEntity
,
getContext
());
}
}
...
...
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