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
6506d06e
Commit
6506d06e
authored
Dec 21, 2019
by
郝彦辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
写文件用批量写入
parent
52b51a60
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
273 additions
and
8 deletions
+273
-8
BaiHangZhuDaiService.java
...antgroup/report/service/baihang/BaiHangZhuDaiService.java
+15
-6
ManualToolService.java
...antgroup/report/service/manualTool/ManualToolService.java
+258
-2
No files found.
src/main/java/cn/quantgroup/report/service/baihang/BaiHangZhuDaiService.java
View file @
6506d06e
...
...
@@ -909,6 +909,8 @@ public class BaiHangZhuDaiService {
int
counter
=
0
;
log
.
info
(
"开始>>整理百行-助贷还款&逾期存量数据 startDate : {} , noEndDate : {} ......"
,
startDate
,
noEndDate
);
StringBuffer
tmpWriteBuffer
=
null
;
while
(
true
)
{
if
(
D3_Stop
.
get
()){
log
.
error
(
"All还款&逾期存量数据查询STOP, D3_Stop: {} , endTime: {} "
,
D3_Stop
.
get
(),
erlyDate
.
plusDays
(
counter
).
format
(
DateTimeFormatter
.
ISO_DATE
));
...
...
@@ -919,6 +921,7 @@ public class BaiHangZhuDaiService {
if
(
erlyDate
.
plusDays
(
counter
).
compareTo
(
endDate
)
>
0
)
{
break
;
}
List
<
RepaymentInfoZhuDai
>
repaymentInfoList
=
new
ArrayList
<>();
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfosLh
=
new
ArrayList
<>();
...
...
@@ -931,11 +934,9 @@ public class BaiHangZhuDaiService {
long
log_stUtc
=
System
.
currentTimeMillis
();
try
{
if
(
type
==
0
)
{
if
(
StringUtils
.
isNotEmpty
(
d3Type
)
&&
d3Type
.
equals
(
"1"
)){
//只要逾期
continue
;
}
//Stopwatch stopwatch = Stopwatch.createStarted();
/* repaymentInfoList = repaymentLoanInfoMapper.queryStockRepayMentInfoZhuDai(timeRecord);*/
...
...
@@ -951,7 +952,6 @@ public class BaiHangZhuDaiService {
}
}
else
{
if
(
StringUtils
.
isNotEmpty
(
d3Type
)
&&
d3Type
.
equals
(
"0"
)){
//只要还款
continue
;
}
...
...
@@ -975,7 +975,8 @@ public class BaiHangZhuDaiService {
repaymentInfoList
.
addAll
(
repaymentLoanInfosLh
);
}
tmpWriteBuffer
=
new
StringBuffer
();
int
buffCount
=
0
;
for
(
int
j
=
0
;
j
<
repaymentInfoList
.
size
();
j
++)
{
RepaymentInfoZhuDai
repaymentInfo
=
repaymentInfoList
.
get
(
j
);
String
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
...
...
@@ -994,12 +995,20 @@ public class BaiHangZhuDaiService {
repaymentInfo
.
setUploadTs
(
repaymentInfo
.
getStatusConfirmAt
());
}
FileUtils
.
write
(
new
File
(
fileName
+
"_01.txt"
),
JSON
.
toJSONString
(
repaymentInfo
)+
"\r\n"
,
"UTF-8"
,
true
);
//这么写太慢了
///////FileUtils.write(new File(fileName+"_01.txt"), JSON.toJSONString(repaymentInfo)+"\r\n", "UTF-8", true);
//脱敏数据写一份
//testTuoMinFileWrite(fileName+"_TEST_01.txt",starTime,null,null,repaymentInfo);
tmpWriteBuffer
.
append
(
JSON
.
toJSONString
(
repaymentInfo
)+
"\r\n"
);
buffCount
++;
}
FileUtils
.
write
(
new
File
(
fileName
+
"_01.txt"
),
tmpWriteBuffer
.
toString
(),
"UTF-8"
,
true
);
log
.
info
(
"批量写入文件结束,repaymentInfoList="
+
repaymentInfoList
.
size
()+
",buffCount="
+
buffCount
+
",Check Size="
+(
repaymentInfoList
.
size
()==
buffCount
));
tmpWriteBuffer
=
null
;
buffCount
=
0
;
}
catch
(
Exception
e
)
{
log
.
error
(
"还款&逾期存量数据处理异常, startTime: {} , endTime: {} , type: {} "
,
starTime
,
endTime
,
type
,
e
);
try
{
...
...
src/main/java/cn/quantgroup/report/service/manualTool/ManualToolService.java
View file @
6506d06e
This diff is collapsed.
Click to expand it.
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