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
5c60d373
Commit
5c60d373
authored
Jan 03, 2020
by
haoyanhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
方法整理&优化
parent
a1f4ac15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
CleanningTransactionLogService.java
...rt/service/manualTool/CleanningTransactionLogService.java
+13
-13
No files found.
src/main/java/cn/quantgroup/report/service/manualTool/CleanningTransactionLogService.java
View file @
5c60d373
...
@@ -683,10 +683,10 @@ public class CleanningTransactionLogService {
...
@@ -683,10 +683,10 @@ public class CleanningTransactionLogService {
Stopwatch
queryStopwatch
=
Stopwatch
.
createStarted
();
Stopwatch
queryStopwatch
=
Stopwatch
.
createStarted
();
List
<
TransactionLogPO
>
transactionLogPOList
=
riskDatasourceJdbcTemplate
.
query
(
TRANSACTION_SQL
,
new
BeanPropertyRowMapper
<>(
TransactionLogPO
.
class
));
List
<
TransactionLogPO
>
transactionLogPOList
=
riskDatasourceJdbcTemplate
.
query
(
TRANSACTION_SQL
,
new
BeanPropertyRowMapper
<>(
TransactionLogPO
.
class
));
log
.
info
(
"transactionLog查询数据结束, startTime: {} , endTime: {} , size: {} , 耗时: {} "
,
startTime
,
endTime
,
CollectionUtils
.
isEmpty
(
transactionLogPOList
)
?
0
:
transactionLogPOList
.
size
(),
queryStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"transactionLog查询数据结束
CCFByT
, startTime: {} , endTime: {} , size: {} , 耗时: {} "
,
startTime
,
endTime
,
CollectionUtils
.
isEmpty
(
transactionLogPOList
)
?
0
:
transactionLogPOList
.
size
(),
queryStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
if
(
CollectionUtils
.
isEmpty
(
transactionLogPOList
))
{
if
(
CollectionUtils
.
isEmpty
(
transactionLogPOList
))
{
log
.
info
(
"查询数据为空跳过, startTime: {} , endTime: {} "
,
startTime
,
endTime
);
log
.
info
(
"查询数据为空跳过
CCFByT
, startTime: {} , endTime: {} "
,
startTime
,
endTime
);
continue
;
continue
;
}
}
...
@@ -703,13 +703,13 @@ public class CleanningTransactionLogService {
...
@@ -703,13 +703,13 @@ public class CleanningTransactionLogService {
.
append
(
format
).
toString
();
.
append
(
format
).
toString
();
transactionLogPOMap
.
put
(
key
,
transactionLogPO
);
transactionLogPOMap
.
put
(
key
,
transactionLogPO
);
}
}
log
.
info
(
"transactionLog
组装数据完成
, startTime: {} , 查询大小: {} , 组装后大小: {} , 耗时: {} "
,
startTime
,
transactionLogPOList
.
size
(),
transactionLogPOMap
.
size
(),
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"transactionLog
REMOVE数据完成CCFByT
, startTime: {} , 查询大小: {} , 组装后大小: {} , 耗时: {} "
,
startTime
,
transactionLogPOList
.
size
(),
transactionLogPOMap
.
size
(),
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
Stopwatch
callRStopwatch
=
Stopwatch
.
createStarted
();
Stopwatch
callRStopwatch
=
Stopwatch
.
createStarted
();
String
CALL_SQL
=
"select transaction_id, uuid, url_type, code, created_at "
+
String
CALL_SQL
=
"select transaction_id, uuid, url_type, code, created_at "
+
" from call_record where created_at >= '"
+
startTime
+
"' and created_at < '"
+
endTime
+
"' order by created_at desc;"
;
" from call_record where created_at >= '"
+
startTime
+
"' and created_at < '"
+
endTime
+
"' order by created_at desc;"
;
List
<
CallRecord1
>
queryResult
=
tidbRiskJdbcTemplate
.
query
(
CALL_SQL
,
new
BeanPropertyRowMapper
<>(
CallRecord1
.
class
));
List
<
CallRecord1
>
queryResult
=
tidbRiskJdbcTemplate
.
query
(
CALL_SQL
,
new
BeanPropertyRowMapper
<>(
CallRecord1
.
class
));
log
.
info
(
"callRecord查询数据结束, startTime: {} , endTime: {} , size: {} , 耗时: {} "
,
startTime
,
endTime
,
CollectionUtils
.
isEmpty
(
queryResult
)
?
0
:
queryResult
.
size
(),
callRStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"callRecord查询数据结束
CCFByT
, startTime: {} , endTime: {} , size: {} , 耗时: {} "
,
startTime
,
endTime
,
CollectionUtils
.
isEmpty
(
queryResult
)
?
0
:
queryResult
.
size
(),
callRStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
Map
<
String
,
CallRecord1
>
callRecord1Map
=
new
HashMap
<>();
Map
<
String
,
CallRecord1
>
callRecord1Map
=
new
HashMap
<>();
...
@@ -725,7 +725,7 @@ public class CleanningTransactionLogService {
...
@@ -725,7 +725,7 @@ public class CleanningTransactionLogService {
.
append
(
format
).
toString
();
.
append
(
format
).
toString
();
callRecord1Map
.
put
(
key
,
callRecord1
);
callRecord1Map
.
put
(
key
,
callRecord1
);
}
}
log
.
info
(
"callRecord组装数据完成, startTime: {} , 查询大小: {} , 组装后大小: {} , 耗时: {} "
,
startTime
,
queryResult
.
size
(),
callRecord1Map
.
size
(),
callStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"callRecord组装数据完成
CCFByT
, startTime: {} , 查询大小: {} , 组装后大小: {} , 耗时: {} "
,
startTime
,
queryResult
.
size
(),
callRecord1Map
.
size
(),
callStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
Stopwatch
delStopwatch
=
Stopwatch
.
createStarted
();
Stopwatch
delStopwatch
=
Stopwatch
.
createStarted
();
Iterator
<
Map
.
Entry
<
String
,
TransactionLogPO
>>
iterator
=
transactionLogPOMap
.
entrySet
().
iterator
();
Iterator
<
Map
.
Entry
<
String
,
TransactionLogPO
>>
iterator
=
transactionLogPOMap
.
entrySet
().
iterator
();
...
@@ -737,7 +737,7 @@ public class CleanningTransactionLogService {
...
@@ -737,7 +737,7 @@ public class CleanningTransactionLogService {
callRecord1Map
.
remove
(
key
);
callRecord1Map
.
remove
(
key
);
}
}
}
}
log
.
info
(
"去相同据完成, startTime: {} , callRecord1Map大小: {} , transactionLogPOMap大小: {} , 耗时: {} "
,
startTime
,
callRecord1Map
.
size
(),
transactionLogPOMap
.
size
(),
delStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"去相同据完成
CCFByT
, startTime: {} , callRecord1Map大小: {} , transactionLogPOMap大小: {} , 耗时: {} "
,
startTime
,
callRecord1Map
.
size
(),
transactionLogPOMap
.
size
(),
delStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
}
}
String
path
=
"/home/quant_group/baihang-report/logs/transaction_call/"
;
String
path
=
"/home/quant_group/baihang-report/logs/transaction_call/"
;
...
@@ -752,9 +752,9 @@ public class CleanningTransactionLogService {
...
@@ -752,9 +752,9 @@ public class CleanningTransactionLogService {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
});
});
log
.
info
(
"写入transaction_log多出的数据结束, startTime: {} , countNum: {} , Map大小: {} , 耗时: {} "
,
startTime
,
countNum
.
get
(),
transactionLogPOMap
.
size
(),
stopwatch1222
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"写入transaction_log多出的数据结束
CCFByT
, startTime: {} , countNum: {} , Map大小: {} , 耗时: {} "
,
startTime
,
countNum
.
get
(),
transactionLogPOMap
.
size
(),
stopwatch1222
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
}
else
{
}
else
{
log
.
info
(
"写入transaction_log多出的数据结束, startTime: {} , transactionLogPOMap size is Empty!"
,
startTime
);
log
.
info
(
"写入transaction_log多出的数据结束
CCFByT
, startTime: {} , transactionLogPOMap size is Empty!"
,
startTime
);
}
}
if
(
callRecord1Map
.
size
()>
0
)
{
if
(
callRecord1Map
.
size
()>
0
)
{
...
@@ -768,20 +768,20 @@ public class CleanningTransactionLogService {
...
@@ -768,20 +768,20 @@ public class CleanningTransactionLogService {
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
});
});
log
.
info
(
"写入call_record多出的数据结束, startTime: {} , countNum: {} , Map大小: {} , 耗时: {} "
,
startTime
,
countNum3
.
get
(),
callRecord1Map
.
size
(),
stopwatch3
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"写入call_record多出的数据结束
CCFByT
, startTime: {} , countNum: {} , Map大小: {} , 耗时: {} "
,
startTime
,
countNum3
.
get
(),
callRecord1Map
.
size
(),
stopwatch3
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
}
else
{
}
else
{
log
.
info
(
"写入call_record多出的数据结束, startTime: {} , transactionLogPOMap size is Empty!"
,
startTime
);
log
.
info
(
"写入call_record多出的数据结束
CCFByT
, startTime: {} , transactionLogPOMap size is Empty!"
,
startTime
);
}
}
if
(
executeOnce
){
if
(
executeOnce
){
log
.
info
(
"比较数据完成, newYnrTime: {} , isExecuteOnce: {} , startTime: {} , endTime: {} ,"
,
newYnrTime
,
isExecuteOnce
,
startTime
,
endTime
);
log
.
info
(
"比较数据完成
CCFByT
, newYnrTime: {} , isExecuteOnce: {} , startTime: {} , endTime: {} ,"
,
newYnrTime
,
isExecuteOnce
,
startTime
,
endTime
);
break
;
break
;
}
}
}
}
log
.
info
(
"----All比较数据完成----"
);
log
.
info
(
"----All比较数据完成
CCFByT
----"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"比较数据异常"
,
e
);
log
.
error
(
"比较数据异常
CCFByT
"
,
e
);
}
}
}
}
...
...
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