Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
baihang-report
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data-spider
baihang-report
Commits
6bc16645
Commit
6bc16645
authored
Mar 05, 2021
by
郑建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改为异步进行
parent
acb7c5b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
RepairController.java
...antgroup/report/controller/external/RepairController.java
+4
-9
RepairService.java
...va/cn/quantgroup/report/service/repair/RepairService.java
+12
-0
No files found.
src/main/java/cn/quantgroup/report/controller/external/RepairController.java
View file @
6bc16645
...
@@ -14,7 +14,8 @@ import java.util.concurrent.TimeUnit;
...
@@ -14,7 +14,8 @@ import java.util.concurrent.TimeUnit;
* @date 2021/3/2 - 18:43
* @date 2021/3/2 - 18:43
**/
**/
@Slf4j
@Slf4j
@RestController
(
"/zhudai"
)
@RestController
@RequestMapping
(
"/manualtool/zhudainew"
)
public
class
RepairController
{
public
class
RepairController
{
...
@@ -27,14 +28,8 @@ public class RepairController {
...
@@ -27,14 +28,8 @@ public class RepairController {
@RequestMapping
(
"/repair"
)
@RequestMapping
(
"/repair"
)
public
String
mainLoanInfoSend
(
int
startPage
){
public
String
mainLoanInfoSend
(
int
startPage
){
try
{
try
{
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
repairService
.
doRepair
(
startPage
);
repairService
.
doRepair
(
"normal_lh"
,
startPage
);
return
"数据开始补报"
;
repairService
.
doRepair
(
"overdue_lh"
,
startPage
);
repairService
.
doRepair
(
"normal"
,
startPage
);
repairService
.
doRepair
(
"overdue"
,
startPage
);
log
.
info
(
"本次测试总耗时 {}"
,
stopwatch
.
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"数据补报成功"
);
return
"数据补报成功"
;
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
"数据补报出现异常"
,
e
);
log
.
error
(
"数据补报出现异常"
,
e
);
return
"数据补报出现异常"
;
return
"数据补报出现异常"
;
...
...
src/main/java/cn/quantgroup/report/service/repair/RepairService.java
View file @
6bc16645
...
@@ -20,6 +20,7 @@ import org.apache.commons.collections.CollectionUtils;
...
@@ -20,6 +20,7 @@ import org.apache.commons.collections.CollectionUtils;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.scheduling.annotation.Async
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.io.File
;
import
java.io.File
;
...
@@ -64,6 +65,17 @@ public class RepairService implements CommonSuperService {
...
@@ -64,6 +65,17 @@ public class RepairService implements CommonSuperService {
public
static
final
String
errorLog
=
"/home/quant_group/baihang-report/data/baihang/error.txt"
;
public
static
final
String
errorLog
=
"/home/quant_group/baihang-report/data/baihang/error.txt"
;
@Async
public
void
doRepair
(
int
startPage
){
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
doRepair
(
"normal_lh"
,
startPage
);
doRepair
(
"overdue_lh"
,
startPage
);
doRepair
(
"normal"
,
startPage
);
doRepair
(
"overdue"
,
startPage
);
log
.
info
(
"本次测试总耗时 {}"
,
stopwatch
.
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"数据补报成功"
);
}
public
void
doRepair
(
String
type
,
int
startPage
)
{
public
void
doRepair
(
String
type
,
int
startPage
)
{
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
log
.
info
(
"开始报送 {}"
,
type
);
log
.
info
(
"开始报送 {}"
,
type
);
...
...
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