Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
complex-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
赵啸非
complex-platform
Commits
fd1e9e88
Commit
fd1e9e88
authored
Jun 20, 2024
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
综窗事项同步接口
parent
6d6c51e0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
14 deletions
+11
-14
complex-window-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/EventImplementationServiceImpl.java
...e/matter/service/impl/EventImplementationServiceImpl.java
+11
-14
No files found.
complex-window-manager/src/main/java/com/mortals/xhx/module/matter/service/impl/EventImplementationServiceImpl.java
View file @
fd1e9e88
...
...
@@ -54,6 +54,7 @@ public class EventImplementationServiceImpl extends AbstractCRUDServiceImpl<Even
req
.
setPageSize
(
pageSize
);
req
.
setCurrentPage
(
currentPage
);
try
{
log
.
info
(
"当前页码:"
+
currentPage
);
req
.
setNonce
(
RandomUtil
.
randomNumbers
(
6
));
cacheService
.
lpush
(
KEY_COMPLEX_REQ
,
JSONObject
.
toJSONString
(
req
));
String
rest
=
cacheService
.
blpop
(
KEY_EVENT_IMPLEMENTATION_RESP
+
req
.
getNonce
(),
HTTP_TIMEOUT
,
String
.
class
);
...
...
@@ -67,10 +68,16 @@ public class EventImplementationServiceImpl extends AbstractCRUDServiceImpl<Even
this
.
saveOrUpdate
(
list
);
int
total
=
eventListRest
.
getData
().
getTotal
();
int
pages
=
total
/
pageSize
+
1
;
log
.
info
(
"总页数:"
+
pages
);
if
(
pages
>
1
){
while
(
currentPage
<
pages
){
try
{
Thread
.
sleep
(
10000
);
}
catch
(
InterruptedException
e2
)
{
}
currentPage
++;
req
.
setCurrentPage
(
currentPage
);
log
.
info
(
"当前页码:"
+
currentPage
);
req
.
setNonce
(
RandomUtil
.
randomNumbers
(
6
));
cacheService
.
lpush
(
KEY_COMPLEX_REQ
,
JSONObject
.
toJSONString
(
req
));
String
restTemp
=
cacheService
.
blpop
(
KEY_EVENT_IMPLEMENTATION_RESP
+
req
.
getNonce
(),
HTTP_TIMEOUT
,
String
.
class
);
...
...
@@ -82,9 +89,13 @@ public class EventImplementationServiceImpl extends AbstractCRUDServiceImpl<Even
if
(
eventListTemp
.
getCode
()==
ApiRespCodeEnum
.
SUCCESS
.
getValue
()){
List
<
EventImplementationEntity
>
listTemp
=
convertEventImplementation
(
eventListTemp
.
getData
().
getRecords
());
this
.
saveOrUpdate
(
listTemp
);
}
else
{
log
.
info
(
"查询综窗事项列表失败"
);
}
}
}
}
else
{
log
.
info
(
"查询综窗事项列表失败"
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"同步数据失败"
,
e
);
...
...
@@ -134,18 +145,4 @@ public class EventImplementationServiceImpl extends AbstractCRUDServiceImpl<Even
}
return
list
;
}
public
static
void
main
(
String
[]
args
)
{
int
total
=
175
;
int
pageSize
=
50
;
int
currentPage
=
1
;
System
.
out
.
println
(
"当前页数:"
+
currentPage
);
int
pages
=
total
/
pageSize
+
1
;
System
.
out
.
println
(
"总页数:"
+
pages
);
while
(
currentPage
<
pages
){
currentPage
++;
System
.
out
.
println
(
"当前页数:"
+
currentPage
);
}
}
}
\ No newline at end of file
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