Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sample-form-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
赵啸非
sample-form-platform
Commits
877df31b
Commit
877df31b
authored
Feb 19, 2023
by
“yiyousong”
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.scsmile.cn/zxf/sample-form-platform
parents
d31cf9ad
a5aa5cc5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
32 deletions
+49
-32
sample-form-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteMatterTaskImpl.java
...a/com/mortals/xhx/daemon/task/SyncSiteMatterTaskImpl.java
+42
-31
sample-form-manager/src/main/resources/bootstrap.yml
sample-form-manager/src/main/resources/bootstrap.yml
+7
-1
No files found.
sample-form-manager/src/main/java/com/mortals/xhx/daemon/task/SyncSiteMatterTaskImpl.java
View file @
877df31b
...
...
@@ -46,11 +46,20 @@ public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
if
(
siteRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
log
.
info
(
"总数量:{}"
,
siteRest
.
getData
().
size
());
siteRest
.
getData
().
forEach
(
site
->
{
sheetMatterService
.
getDao
().
delete
(
new
SheetMatterQuery
().
siteId
(
site
.
getId
()));
int
page
=
100
;
int
pageNum
=
100
;
for
(
int
i
=
1
;
i
<=
page
;
i
++){
SiteMatterPdu
siteMatterPdu
=
new
SiteMatterPdu
();
siteMatterPdu
.
setPage
(
1
);
siteMatterPdu
.
setSize
(-
1
);
siteMatterPdu
.
setPage
(
i
);
siteMatterPdu
.
setSize
(
pageNum
);
log
.
info
(
"请求列表:"
+
i
);
Rest
<
RespData
<
List
<
SiteMatterPdu
>>>
siteMatterRest
=
siteMatterFeign
.
list
(
siteMatterPdu
);
if
(
siteMatterRest
.
getCode
()
==
YesNoEnum
.
YES
.
getValue
())
{
if
(
siteMatterRest
.
getData
().
getData
().
size
()==
0
){
log
.
info
(
"数据没有!跳出循环"
);
break
;
}
//删除后新增
log
.
info
(
"事项总数量:{}"
,
siteMatterRest
.
getData
().
getData
().
size
());
List
<
SheetMatterEntity
>
sheetMatterEntities
=
siteMatterRest
.
getData
().
getData
().
stream
().
map
(
siteMatter
->
{
...
...
@@ -68,17 +77,19 @@ public class SyncSiteMatterTaskImpl implements ITaskExcuteService {
}).
collect
(
Collectors
.
toList
());
if
(!
ObjectUtils
.
isEmpty
(
sheetMatterEntities
))
{
sheetMatterService
.
getDao
().
delete
(
new
SheetMatterQuery
().
siteId
(
site
.
getId
()));
//
sheetMatterService.getDao().delete(new SheetMatterQuery().siteId(site.getId()));
log
.
info
(
"新增数量:{}"
,
sheetMatterEntities
.
size
());
List
<
List
<
SheetMatterEntity
>>
partition
=
ListUtil
.
partition
(
sheetMatterEntities
,
500
);
sheetMatterService
.
save
(
sheetMatterEntities
);
/* List<List<SheetMatterEntity>> partition = ListUtil.partition(sheetMatterEntities, 500);
for (List<SheetMatterEntity> matterEntities : partition) {
sheetMatterService
.
save
(
matterEntities
);
}
}*/
}
}
else
{
log
.
info
(
"请求错误,code:{}"
,
siteMatterRest
.
getCode
());
}
}
});
}
}
...
...
sample-form-manager/src/main/resources/bootstrap.yml
View file @
877df31b
...
...
@@ -13,7 +13,6 @@ spring:
jackson
:
date-format
:
yyyy-MM-dd HH:mm:ss
time-zone
:
GMT+8
cloud
:
nacos
:
# Nacos 作为注册中心的配置项,对应 NacosDiscoveryProperties 配置类
...
...
@@ -45,3 +44,10 @@ cookie:
port
:
111
token
:
head
:
mortal
hystrix
:
command
:
default
:
execution
:
isolation
:
thread
:
timeoutInMilliseconds
:
60000
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