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
0f8a765a
Commit
0f8a765a
authored
Aug 04, 2021
by
陈宏杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量插入
parent
0f58c44d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
30 deletions
+47
-30
RepaymentLoanInfoDbMapper.java
...group/report/mapper/master/RepaymentLoanInfoDbMapper.java
+2
-0
BaiHangFileReportService.java
...roup/report/service/baihang/BaiHangFileReportService.java
+33
-30
RepaymentLoanInfoDbMapper.xml
...tgroup/report/mapper/master/RepaymentLoanInfoDbMapper.xml
+12
-0
No files found.
src/main/java/cn/quantgroup/report/mapper/master/RepaymentLoanInfoDbMapper.java
View file @
0f8a765a
...
@@ -37,4 +37,6 @@ public interface RepaymentLoanInfoDbMapper {
...
@@ -37,4 +37,6 @@ public interface RepaymentLoanInfoDbMapper {
*/
*/
List
<
RepaymentLoanInfoLog
>
findByD3RecordId
(
String
[]
recordIdArray
);
List
<
RepaymentLoanInfoLog
>
findByD3RecordId
(
String
[]
recordIdArray
);
void
batchSaveRepaymentLoanInfoLog
(
List
<
RepaymentInfoZhuDai
>
list
);
}
}
src/main/java/cn/quantgroup/report/service/baihang/BaiHangFileReportService.java
View file @
0f8a765a
...
@@ -320,8 +320,8 @@ public class BaiHangFileReportService {
...
@@ -320,8 +320,8 @@ public class BaiHangFileReportService {
* @param endTime 截止时间
* @param endTime 截止时间
*/
*/
private
void
reportD3O
(
String
startTime
,
String
endTime
)
{
private
void
reportD3O
(
String
startTime
,
String
endTime
)
{
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
null
;
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
null
,
recordList
=
new
ArrayList
<>(
5000
)
;
List
<
String
>
reportList
=
new
ArrayList
<>();
List
<
String
>
reportList
=
new
ArrayList
<>(
5000
);
reportList
.
add
(
"#singleLoanRepayInfo"
);
reportList
.
add
(
"#singleLoanRepayInfo"
);
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
try
{
...
@@ -334,14 +334,10 @@ public class BaiHangFileReportService {
...
@@ -334,14 +334,10 @@ public class BaiHangFileReportService {
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
try
{
try
{
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
try
{
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
record
.
setRecordId
(
id
);
record
.
setRecordId
(
id
);
recordList
.
add
(
record
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
record
);
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-逾期记录保存异常"
,
e
);
}
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
...
@@ -352,6 +348,11 @@ public class BaiHangFileReportService {
...
@@ -352,6 +348,11 @@ public class BaiHangFileReportService {
log
.
error
(
"量化派助贷TO百行报送(D3)-逾期记录处理异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
log
.
error
(
"量化派助贷TO百行报送(D3)-逾期记录处理异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
}
}
}
}
try
{
repaymentLoanInfoDbMapper
.
batchSaveRepaymentLoanInfoLog
(
recordList
);
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-逾期记录保存异常"
,
e
);
}
File
file
=
new
File
(
"量子数科科技有限公司_D3O_"
+
fileNameReplaceAll
(
startTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
File
file
=
new
File
(
"量子数科科技有限公司_D3O_"
+
fileNameReplaceAll
(
startTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
FileUtils
.
writeLines
(
file
,
reportList
);
FileUtils
.
writeLines
(
file
,
reportList
);
if
(
reportList
.
size
()<=
1
)
{
if
(
reportList
.
size
()<=
1
)
{
...
@@ -371,12 +372,12 @@ public class BaiHangFileReportService {
...
@@ -371,12 +372,12 @@ public class BaiHangFileReportService {
private
void
reportD3OFor30Day
(
String
startTime
,
String
endTime
)
{
private
void
reportD3OFor30Day
(
String
startTime
,
String
endTime
)
{
List
<
LoanApplicationHistoryIdInfo
>
idInfos
=
null
;
List
<
LoanApplicationHistoryIdInfo
>
idInfos
=
null
;
LoanApplicationHistoryIdInfo
idInfo
=
null
;
LoanApplicationHistoryIdInfo
idInfo
=
null
;
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
new
ArrayList
<>(
),
tempRepaymentLoanInfos
=
null
;
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
new
ArrayList
<>(
5000
),
tempRepaymentLoanInfos
=
null
,
recordList
=
new
ArrayList
<>(
5000
)
;
Date
stepEndDate
=
null
;
Date
stepEndDate
=
null
;
Integer
step
=
null
;
Integer
step
=
null
;
String
id
=
""
;
String
id
=
""
;
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
List
<
String
>
reportList
=
new
ArrayList
<>();
List
<
String
>
reportList
=
new
ArrayList
<>(
5000
);
reportList
.
add
(
"#singleLoanRepayInfo"
);
reportList
.
add
(
"#singleLoanRepayInfo"
);
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
try
{
...
@@ -403,14 +404,10 @@ public class BaiHangFileReportService {
...
@@ -403,14 +404,10 @@ public class BaiHangFileReportService {
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
try
{
try
{
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
try
{
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
record
.
setRecordId
(
id
);
record
.
setRecordId
(
id
);
recordList
.
add
(
record
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
record
);
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-每30天逾期记录保存异常"
,
e
);
}
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
...
@@ -421,6 +418,11 @@ public class BaiHangFileReportService {
...
@@ -421,6 +418,11 @@ public class BaiHangFileReportService {
log
.
error
(
"量化派助贷TO百行报送(D3)-每30天逾期记录处理异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
log
.
error
(
"量化派助贷TO百行报送(D3)-每30天逾期记录处理异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
}
}
}
}
try
{
repaymentLoanInfoDbMapper
.
batchSaveRepaymentLoanInfoLog
(
recordList
);
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-每30天逾期记录保存异常"
,
e
);
}
File
file
=
new
File
(
"量子数科科技有限公司_D3O30_"
+
fileNameReplaceAll
(
startTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
File
file
=
new
File
(
"量子数科科技有限公司_D3O30_"
+
fileNameReplaceAll
(
startTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
FileUtils
.
writeLines
(
file
,
reportList
);
FileUtils
.
writeLines
(
file
,
reportList
);
if
(
reportList
.
size
()<=
1
)
{
if
(
reportList
.
size
()<=
1
)
{
...
@@ -440,8 +442,8 @@ public class BaiHangFileReportService {
...
@@ -440,8 +442,8 @@ public class BaiHangFileReportService {
* @param endTime 截止时间
* @param endTime 截止时间
*/
*/
private
void
reportD3R
(
String
startTime
,
String
endTime
)
{
private
void
reportD3R
(
String
startTime
,
String
endTime
)
{
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
null
;
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
null
,
recordList
=
new
ArrayList
<>(
5000
)
;
List
<
String
>
reportList
=
new
ArrayList
<>();
List
<
String
>
reportList
=
new
ArrayList
<>(
5000
);
reportList
.
add
(
"#singleLoanRepayInfo"
);
reportList
.
add
(
"#singleLoanRepayInfo"
);
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
try
{
...
@@ -454,14 +456,10 @@ public class BaiHangFileReportService {
...
@@ -454,14 +456,10 @@ public class BaiHangFileReportService {
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
try
{
try
{
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
try
{
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
record
.
setRecordId
(
id
);
record
.
setRecordId
(
id
);
recordList
.
add
(
record
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
record
);
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-还款记录保存异常"
,
e
);
}
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
...
@@ -472,6 +470,11 @@ public class BaiHangFileReportService {
...
@@ -472,6 +470,11 @@ public class BaiHangFileReportService {
log
.
error
(
"量化派助贷TO百行报送(D3)-还款记录处理异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
log
.
error
(
"量化派助贷TO百行报送(D3)-还款记录处理异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
}
}
}
}
try
{
repaymentLoanInfoDbMapper
.
batchSaveRepaymentLoanInfoLog
(
recordList
);
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-还款记录保存异常"
,
e
);
}
File
file
=
new
File
(
"量子数科科技有限公司_D3R_"
+
fileNameReplaceAll
(
startTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
File
file
=
new
File
(
"量子数科科技有限公司_D3R_"
+
fileNameReplaceAll
(
startTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
FileUtils
.
writeLines
(
file
,
reportList
);
FileUtils
.
writeLines
(
file
,
reportList
);
if
(
reportList
.
size
()<=
1
)
{
if
(
reportList
.
size
()<=
1
)
{
...
...
src/main/resources/cn/quantgroup/report/mapper/master/RepaymentLoanInfoDbMapper.xml
View file @
0f8a765a
...
@@ -92,4 +92,16 @@
...
@@ -92,4 +92,16 @@
</foreach>
</foreach>
</select>
</select>
<insert
id=
"batchSaveRepaymentLoanInfoLog"
parameterType=
"java.util.List"
>
insert into repayment_loan_info_zhudai
(record_id,req_id ,name,pid ,mobile ,op_code ,upload_ts ,loan_id ,term_no ,term_status ,target_repayment_date ,real_repayment_date,planned_payment ,target_repayment,real_repayment ,overdue_amount,remaining_amount,overdue_status,loan_status,status_confirm_at)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{item.recordId, jdbcType=VARCHAR},#{item.reqID, jdbcType=VARCHAR},#{item.name, jdbcType=VARCHAR},#{item.pid, jdbcType=VARCHAR},#{item.mobile, jdbcType=VARCHAR},#{item.opCode, jdbcType=VARCHAR},
#{item.uploadTs, jdbcType=VARCHAR},#{item.loanId, jdbcType=VARCHAR},#{item.termNo, jdbcType=INTEGER},#{item.termStatus, jdbcType=INTEGER},#{item.targetRepaymentDate, jdbcType=VARCHAR},#{item.realRepaymentDate, jdbcType=VARCHAR},
#{item.plannedPayment, jdbcType=DECIMAL},#{item.targetRepayment, jdbcType=DECIMAL},#{item.realRepayment, jdbcType=DECIMAL},#{item.overdueAmount, jdbcType=DECIMAL},#{item.remainingAmount, jdbcType=DECIMAL},
#{item.overdueStatus, jdbcType=INTEGER},#{item.loanStatus, jdbcType=INTEGER},#{item.statusConfirmAt, jdbcType=VARCHAR})
</foreach>
</insert>
</mapper>
</mapper>
\ 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