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
e991690f
Commit
e991690f
authored
Dec 12, 2021
by
陈宏杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
异常记录
parent
2f0b5070
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
BaiHangDataDisposeService.java
...oup/report/service/baihang/BaiHangDataDisposeService.java
+12
-0
BaiHangFileReportService.java
...roup/report/service/baihang/BaiHangFileReportService.java
+1
-1
No files found.
src/main/java/cn/quantgroup/report/service/baihang/BaiHangDataDisposeService.java
View file @
e991690f
...
...
@@ -4,8 +4,10 @@ import cn.hutool.core.io.IoUtil;
import
cn.hutool.json.JSONUtil
;
import
cn.quantgroup.report.domain.baihang.ApplyLoanInfoZhuDai
;
import
cn.quantgroup.report.mapper.master.ApplyLoanInfoZhuDaiMapper
;
import
cn.quantgroup.report.utils.DateUtils
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -13,7 +15,10 @@ import org.springframework.scheduling.annotation.Async;
import
org.springframework.stereotype.Service
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.FileReader
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.UUID
;
import
java.util.concurrent.atomic.AtomicInteger
;
...
...
@@ -36,6 +41,7 @@ public class BaiHangDataDisposeService {
List
<
ApplyLoanInfoZhuDai
>
zhuDaiLogList
=
null
;
ApplyLoanInfoZhuDai
record
=
null
;
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
List
<
String
>
reportList
=
new
ArrayList
<>();
try
{
bis
=
new
BufferedReader
(
new
FileReader
(
HOST_PATH
+
plainTextFileName
));
while
(
null
!=
(
dataStr
=
bis
.
readLine
()))
{
...
...
@@ -43,6 +49,7 @@ public class BaiHangDataDisposeService {
ApplyLoanInfoZhuDai
applyLoanInfoZhuDai
=
JSONUtil
.
toBean
(
dataStr
,
ApplyLoanInfoZhuDai
.
class
);
zhuDaiLogList
=
applyLoanInfoZhuDaiMapper
.
findByApplyId
(
applyLoanInfoZhuDai
.
getApplyId
());
if
(
CollectionUtils
.
isEmpty
(
zhuDaiLogList
))
{
reportList
.
add
(
dataStr
);
atomicInteger
.
getAndIncrement
();
if
(
saveDb
)
{
record
=
new
ApplyLoanInfoZhuDai
();
...
...
@@ -53,6 +60,11 @@ public class BaiHangDataDisposeService {
}
}
}
if
(
CollectionUtils
.
isNotEmpty
(
reportList
))
{
File
file
=
new
File
(
HOST_PATH
+
"fixA1RefuseDataCauseByBatchSave_"
+
DateUtils
.
formatDate
(
new
Date
(),
"yyyyMMddHHmmsss"
)
+
".txt"
);
FileUtils
.
writeLines
(
file
,
reportList
);
baiHangFileReportService
.
clear
(
reportList
);
}
log
.
error
(
"fixA1RefuseDataCauseByBatchSave处理数据结束,处理总量={}"
,
atomicInteger
.
get
());
}
catch
(
Exception
e
)
{
log
.
error
(
"fixA1RefuseDataCauseByBatchSave处理数据异常"
,
e
.
getMessage
());
...
...
src/main/java/cn/quantgroup/report/service/baihang/BaiHangFileReportService.java
View file @
e991690f
...
...
@@ -742,7 +742,7 @@ public class BaiHangFileReportService {
return
encryptFileName
;
}
p
rivate
void
clear
(
Collection
...
collections
)
{
p
ublic
void
clear
(
Collection
...
collections
)
{
for
(
Collection
col
:
collections
)
{
if
(!
CollectionUtils
.
isEmpty
(
col
))
{
col
.
clear
();
...
...
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