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
6a873119
Commit
6a873119
authored
Feb 10, 2022
by
陈宏杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
三要素保持一致
parent
c541232b
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
17 deletions
+48
-17
RepaymentLoanInfoMapper.java
...tgroup/report/mapper/baihang/RepaymentLoanInfoMapper.java
+2
-0
BaiHangFileReportService.java
...roup/report/service/baihang/BaiHangFileReportService.java
+39
-17
RepaymentLoanInfoMapper.xml
...ntgroup/report/mapper/baihang/RepaymentLoanInfoMapper.xml
+7
-0
No files found.
src/main/java/cn/quantgroup/report/mapper/baihang/RepaymentLoanInfoMapper.java
View file @
6a873119
...
...
@@ -6,6 +6,7 @@ import cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Repository
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
...
...
@@ -123,4 +124,5 @@ public interface RepaymentLoanInfoMapper {
List
<
LoanApplicationHistoryIdInfo
>
queryLoanApplicationHistoryIdInfo
(
BaiHangTimeRecord
baiHangTimeRecord
);
Integer
queryRepeatOfD3R
(
@Param
(
"loanId"
)
String
loanId
,
@Param
(
"termNo"
)
Integer
termNo
,
@Param
(
"realRepayment"
)
BigDecimal
realRepayment
);
}
src/main/java/cn/quantgroup/report/service/baihang/BaiHangFileReportService.java
View file @
6a873119
...
...
@@ -570,15 +570,18 @@ public class BaiHangFileReportService {
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
queryOverdueRecordOfD3
(
BaiHangTimeRecord
.
builder
().
startTime
(
startTime
).
endTime
(
endTime
).
loanStartTime
(
loanStartTime
).
loanEndTime
(
loanEndTime
).
linkPointTime
(
linkPointTime
).
build
());
log
.
info
(
"量化派助贷TO百行报送(D3)-逾期记录查询结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} "
,
startTime
,
endTime
,
repaymentLoanInfos
.
size
(),
(
queryStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
/
1000
)
+
".s"
);
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
String
id
=
""
,
nameForD3
=
null
;
String
id
=
""
;
JSONObject
userInfoObject
=
null
;
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++)
{
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
try
{
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
nameForD3
=
getNameForD3
(
repaymentLoanInfo
.
getLoanId
());
if
(
StringUtils
.
isNotBlank
(
nameForD3
))
{
repaymentLoanInfo
.
setName
(
nameForD3
);
if
(
StringUtils
.
isNotBlank
(
linkPointTime
))
{
userInfoObject
=
getUserInfoForD3
(
repaymentLoanInfo
.
getLoanId
());
repaymentLoanInfo
.
setName
(
userInfoObject
.
getString
(
"name"
));
repaymentLoanInfo
.
setPid
(
userInfoObject
.
getString
(
"pid"
));
repaymentLoanInfo
.
setMobile
(
userInfoObject
.
getString
(
"mobile"
));
}
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
record
.
setRecordId
(
id
);
...
...
@@ -624,7 +627,8 @@ public class BaiHangFileReportService {
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
new
ArrayList
<>(
D3_INITIAL_CAPACITY
),
tempRepaymentLoanInfos
=
null
,
recordList
=
new
ArrayList
<>(
D3_INITIAL_CAPACITY
);
Date
stepEndDate
=
null
;
Integer
step
=
null
;
String
id
=
""
,
nameForD3
=
null
;
String
id
=
""
;
JSONObject
userInfoObject
=
null
;
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
List
<
String
>
reportList
=
new
ArrayList
<>(
D3_INITIAL_CAPACITY
);
reportList
.
add
(
"#singleLoanRepayInfo"
);
...
...
@@ -659,9 +663,11 @@ public class BaiHangFileReportService {
try
{
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
nameForD3
=
getNameForD3
(
repaymentLoanInfo
.
getLoanId
());
if
(
StringUtils
.
isNotBlank
(
nameForD3
))
{
repaymentLoanInfo
.
setName
(
nameForD3
);
if
(
StringUtils
.
isNotBlank
(
linkPointTime
))
{
userInfoObject
=
getUserInfoForD3
(
repaymentLoanInfo
.
getLoanId
());
repaymentLoanInfo
.
setName
(
userInfoObject
.
getString
(
"name"
));
repaymentLoanInfo
.
setPid
(
userInfoObject
.
getString
(
"pid"
));
repaymentLoanInfo
.
setMobile
(
userInfoObject
.
getString
(
"mobile"
));
}
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
record
.
setRecordId
(
id
);
...
...
@@ -715,10 +721,20 @@ public class BaiHangFileReportService {
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
queryRepayMentRecordOfD3
(
BaiHangTimeRecord
.
builder
().
startTime
(
startTime
).
endTime
(
endTime
).
loanStartTime
(
loanStartTime
).
loanEndTime
(
loanEndTime
).
linkPointTime
(
linkPointTime
).
build
());
log
.
info
(
"量化派助贷TO百行报送(D3)-还款记录查询结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} "
,
startTime
,
endTime
,
repaymentLoanInfos
.
size
(),
(
queryStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
/
1000
)
+
".s"
);
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
String
id
=
""
,
nameForD3
=
null
;
String
id
=
""
;
JSONObject
userInfoObject
=
null
;
Integer
repeatCount
=
null
;
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++)
{
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
try
{
if
(
StringUtils
.
isNotBlank
(
linkPointTime
))
{
//新老数据衔接避免重复报送
repeatCount
=
repaymentLoanInfoMapper
.
queryRepeatOfD3R
(
repaymentLoanInfo
.
getLoanId
(),
repaymentLoanInfo
.
getTermNo
(),
repaymentLoanInfo
.
getRealRepayment
());
if
(
Objects
.
nonNull
(
repeatCount
)
&&
repeatCount
>
0
)
{
log
.
info
(
"量化派助贷TO百行报送(D3)-已报送,重复信息 {}"
,
JSONObject
.
toJSONString
(
repaymentLoanInfo
));
continue
;
}
}
if
(
repairDataList_01
.
contains
(
repaymentLoanInfo
.
getLoanId
()))
{
log
.
error
(
"量化派助贷TO百行报送(D3)-还款记录处理脏数据: {}"
,
repaymentLoanInfo
.
getLoanId
());
//脏数据特殊处理,不修改业务库数据
...
...
@@ -728,9 +744,11 @@ public class BaiHangFileReportService {
}
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
nameForD3
=
getNameForD3
(
repaymentLoanInfo
.
getLoanId
());
if
(
StringUtils
.
isNotBlank
(
nameForD3
))
{
repaymentLoanInfo
.
setName
(
nameForD3
);
if
(
StringUtils
.
isNotBlank
(
linkPointTime
))
{
userInfoObject
=
getUserInfoForD3
(
repaymentLoanInfo
.
getLoanId
());
repaymentLoanInfo
.
setName
(
userInfoObject
.
getString
(
"name"
));
repaymentLoanInfo
.
setPid
(
userInfoObject
.
getString
(
"pid"
));
repaymentLoanInfo
.
setMobile
(
userInfoObject
.
getString
(
"mobile"
));
}
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
record
.
setRecordId
(
id
);
...
...
@@ -1005,16 +1023,20 @@ public class BaiHangFileReportService {
return
headMark
;
}
private
String
getName
ForD3
(
String
applyId
)
{
String
name
=
null
;
private
JSONObject
getUserInfo
ForD3
(
String
applyId
)
{
JSONObject
userInfoObject
=
new
JSONObject
()
;
LoanInfoZhuDai
loanInfoZhuDaiOfLately
=
loanInfoMapper
.
findLoanInfoZhuDaiOfLately
(
applyId
);
if
(
Objects
.
nonNull
(
loanInfoZhuDaiOfLately
))
{
name
=
loanInfoZhuDaiOfLately
.
getName
();
userInfoObject
.
put
(
"name"
,
loanInfoZhuDaiOfLately
.
getName
());
userInfoObject
.
put
(
"pid"
,
loanInfoZhuDaiOfLately
.
getPid
());
userInfoObject
.
put
(
"mobile"
,
loanInfoZhuDaiOfLately
.
getMobile
());
}
else
{
ApplyLoanInfoZhuDai
applyLoanInfoZhuDaiOfLately
=
applyLoanInfoMapper
.
findApplyLoanInfoZhuDaiOfLately
(
applyId
);
name
=
Objects
.
nonNull
(
applyLoanInfoZhuDaiOfLately
)
?
applyLoanInfoZhuDaiOfLately
.
getName
()
:
null
;
userInfoObject
.
put
(
"name"
,
applyLoanInfoZhuDaiOfLately
.
getName
());
userInfoObject
.
put
(
"pid"
,
applyLoanInfoZhuDaiOfLately
.
getPid
());
userInfoObject
.
put
(
"mobile"
,
applyLoanInfoZhuDaiOfLately
.
getMobile
());
}
return
name
;
return
userInfoObject
;
}
}
src/main/resources/cn/quantgroup/report/mapper/baihang/RepaymentLoanInfoMapper.xml
View file @
6a873119
...
...
@@ -1195,5 +1195,12 @@
group by a.loan_application_history_id
</select>
<select
id=
"queryRepeatOfD3R"
resultType=
"java.lang.Integer"
>
select count(*)
from risk_datasource.repayment_loan_info_zhudai
where loan_id = #{loanId,jdbcType=VARCHAR}
and term_no = #{termNo}
and real_repayment = #{realRepayment}
</select>
</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