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
0c7340ab
Commit
0c7340ab
authored
Nov 05, 2019
by
郝彦辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
非联合贷-实时数据报送sql修改
parent
c78fdc51
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
145 additions
and
674 deletions
+145
-674
LoanInfo.java
...in/java/cn/quantgroup/report/domain/baihang/LoanInfo.java
+0
-45
LoanInfoZhuDai.java
...a/cn/quantgroup/report/domain/baihang/LoanInfoZhuDai.java
+2
-0
RepaymentInfoZhuDai.java
...quantgroup/report/domain/baihang/RepaymentInfoZhuDai.java
+2
-0
RepaymentLoanInfo.java
...n/quantgroup/report/domain/baihang/RepaymentLoanInfo.java
+0
-43
LoanInfoMapper.java
...a/cn/quantgroup/report/mapper/baihang/LoanInfoMapper.java
+3
-4
RepaymentLoanInfoMapper.java
...tgroup/report/mapper/baihang/RepaymentLoanInfoMapper.java
+8
-5
LoanInfoDbMapper.java
.../cn/quantgroup/report/mapper/master/LoanInfoDbMapper.java
+3
-3
RepaymentLoanInfoDbMapper.java
...group/report/mapper/master/RepaymentLoanInfoDbMapper.java
+4
-4
BaiHangService.java
.../cn/quantgroup/report/service/baihang/BaiHangService.java
+11
-11
BaiHangZhuDaiService.java
...antgroup/report/service/baihang/BaiHangZhuDaiService.java
+74
-529
ReSendBaiHangService.java
...antgroup/report/service/baihang/ReSendBaiHangService.java
+5
-5
ManualToolService.java
...antgroup/report/service/manualTool/ManualToolService.java
+6
-6
LoanInfoMapper.xml
...es/cn/quantgroup/report/mapper/baihang/LoanInfoMapper.xml
+1
-1
RepaymentLoanInfoMapper.xml
...ntgroup/report/mapper/baihang/RepaymentLoanInfoMapper.xml
+2
-2
LoanInfoDbMapper.xml
...s/cn/quantgroup/report/mapper/master/LoanInfoDbMapper.xml
+16
-8
RepaymentLoanInfoDbMapper.xml
...tgroup/report/mapper/master/RepaymentLoanInfoDbMapper.xml
+8
-8
No files found.
src/main/java/cn/quantgroup/report/domain/baihang/LoanInfo.java
deleted
100644 → 0
View file @
c78fdc51
package
cn
.
quantgroup
.
report
.
domain
.
baihang
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 放款用户信息
*
* @Author fengjunkai
* @Date 2019-03-26 14:49
*/
@Data
public
class
LoanInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
7293591774673907983L
;
private
String
reqID
;
//记录唯一ID
private
String
recordId
;
private
String
opCode
;
//操作代码A-增加 M-修改
private
String
uploadTs
;
//记录生成时间 ISO 8601格式 LocalDateTime生成
private
String
name
;
//姓名
private
String
pid
;
//身份证好
private
String
mobile
;
//手机号
private
String
loanId
;
//贷款编号
private
int
guaranteeType
;
//贷款担保类型
private
int
loanPurpose
;
//借款用途
private
String
applyDate
;
// 贷款申请时间
private
String
accountOpenDate
;
//账户开立时间
private
String
issueDate
;
//贷款放款时间
private
String
dueDate
;
//贷款到期日期 YYYY-MM-DD
private
BigDecimal
loanAmount
;
//贷款金额
private
int
totalTerm
;
//还款总期数
private
int
targetRepayDateType
;
//账单日类型
private
int
termPeriod
;
//每期还款周期
private
String
firstRepaymentDate
;
//首次应还款日期 YYYY-MM-DD
private
int
gracePeriod
;
//宽限日
private
String
targetRepayDateList
;
//账单日列表
}
src/main/java/cn/quantgroup/report/domain/baihang/LoanInfoZhuDai.java
View file @
0c7340ab
...
@@ -44,4 +44,6 @@ public class LoanInfoZhuDai extends FinTechAgencyBusinessZhuDai implements Seria
...
@@ -44,4 +44,6 @@ public class LoanInfoZhuDai extends FinTechAgencyBusinessZhuDai implements Seria
private
String
targetRepayDateList
;
//账单日列表
private
String
targetRepayDateList
;
//账单日列表
private
String
recordId
;
}
}
src/main/java/cn/quantgroup/report/domain/baihang/RepaymentInfoZhuDai.java
View file @
0c7340ab
...
@@ -38,5 +38,7 @@ public class RepaymentInfoZhuDai implements Serializable {
...
@@ -38,5 +38,7 @@ public class RepaymentInfoZhuDai implements Serializable {
//businessOrgCreditCode 业务发生机构代码string Y/N
//businessOrgCreditCode 业务发生机构代码string Y/N
private
String
recordId
;
}
}
src/main/java/cn/quantgroup/report/domain/baihang/RepaymentLoanInfo.java
deleted
100644 → 0
View file @
c78fdc51
package
cn
.
quantgroup
.
report
.
domain
.
baihang
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Date
;
/**
* 还款用户信息
*
* @Author fengjunkai
* @Date 2019-03-26 15:13
*/
@Data
public
class
RepaymentLoanInfo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
8722959335665582382L
;
private
String
reqID
;
//记录唯一标示
private
String
recordId
;
private
String
opCode
;
//操作CODE a-增加 m-修改
private
String
uploadTs
;
//记录生成时间 ISO 8601
private
String
loanId
;
//贷款ID
private
String
name
;
private
String
pid
;
private
String
mobile
;
private
int
termNo
;
//当前还款期数
private
String
termStatus
;
//本期还款状态
private
String
targetRepaymentDate
;
//本期应还款日 YYYY-MM-DD
private
String
realRepaymentDate
;
//实际还款日期ISO 8601
private
BigDecimal
plannedPayment
;
//本期计划应还款金额
private
BigDecimal
targetRepayment
;
//本期剩余应还款金额
private
BigDecimal
realRepayment
;
// 本次还款金额
private
String
overdueStatus
;
//当前逾期天数
private
String
statusConfirmAt
;
//本期还款状态确认时间
private
BigDecimal
overdueAmount
;
//当前逾期总金额
private
BigDecimal
remainingAmount
;
//贷款余额
private
int
loanStatus
;
//本笔贷款状态
}
src/main/java/cn/quantgroup/report/mapper/baihang/LoanInfoMapper.java
View file @
0c7340ab
...
@@ -2,7 +2,6 @@ package cn.quantgroup.report.mapper.baihang;
...
@@ -2,7 +2,6 @@ package cn.quantgroup.report.mapper.baihang;
import
cn.quantgroup.report.domain.baihang.BaiHangTimeRecord
;
import
cn.quantgroup.report.domain.baihang.BaiHangTimeRecord
;
import
cn.quantgroup.report.domain.baihang.LoanInfoVo
;
import
cn.quantgroup.report.domain.baihang.LoanInfoVo
;
import
cn.quantgroup.report.domain.baihang.LoanInfo
;
import
cn.quantgroup.report.domain.baihang.LoanInfoZhuDai
;
import
cn.quantgroup.report.domain.baihang.LoanInfoZhuDai
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -18,13 +17,13 @@ import java.util.List;
...
@@ -18,13 +17,13 @@ import java.util.List;
public
interface
LoanInfoMapper
{
public
interface
LoanInfoMapper
{
//报送实时放款数据(百行征信报送)
//报送实时放款数据(百行征信报送)
List
<
LoanInfo
>
findLoanInfo
();
List
<
LoanInfo
ZhuDai
>
findLoanInfo
();
List
<
LoanInfo
>
findLoanInfoByTime
(
BaiHangTimeRecord
baiHangTimeRecord
);
List
<
LoanInfo
ZhuDai
>
findLoanInfoByTime
(
BaiHangTimeRecord
baiHangTimeRecord
);
//根据loan_application_history_id查询最晚还款日
//根据loan_application_history_id查询最晚还款日
List
<
String
>
findTargetRepaymentDayList
(
String
reqId
);
List
<
String
>
findTargetRepaymentDayList
(
String
reqId
);
List
<
LoanInfo
>
stockLoanInfo
();
List
<
LoanInfo
ZhuDai
>
stockLoanInfo
();
/**
/**
...
...
src/main/java/cn/quantgroup/report/mapper/baihang/RepaymentLoanInfoMapper.java
View file @
0c7340ab
package
cn
.
quantgroup
.
report
.
mapper
.
baihang
;
package
cn
.
quantgroup
.
report
.
mapper
.
baihang
;
import
cn.quantgroup.report.domain.baihang.*
;
import
cn.quantgroup.report.domain.baihang.BaiHangName
;
import
cn.quantgroup.report.domain.baihang.BaiHangNameResult
;
import
cn.quantgroup.report.domain.baihang.BaiHangTimeRecord
;
import
cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
...
@@ -15,13 +18,13 @@ import java.util.List;
...
@@ -15,13 +18,13 @@ import java.util.List;
public
interface
RepaymentLoanInfoMapper
{
public
interface
RepaymentLoanInfoMapper
{
//实时还款(百行征信报送)
//实时还款(百行征信报送)
List
<
Repayment
LoanInfo
>
findRepayMentLoanInfo
(
BaiHangTimeRecord
baiHangTimeRecord
);
List
<
Repayment
InfoZhuDai
>
findRepayMentLoanInfo
(
BaiHangTimeRecord
baiHangTimeRecord
);
//实时逾期还款(百行征信报送)
//实时逾期还款(百行征信报送)
List
<
Repayment
LoanInfo
>
findRepayMentLoanInfoOverdue
(
BaiHangTimeRecord
baiHangTimeRecord
);
List
<
Repayment
InfoZhuDai
>
findRepayMentLoanInfoOverdue
(
BaiHangTimeRecord
baiHangTimeRecord
);
List
<
Repayment
LoanInfo
>
findStockRepayMentLoanInfo
(
BaiHangTimeRecord
baiHangTimeRecord
);
List
<
Repayment
InfoZhuDai
>
findStockRepayMentLoanInfo
(
BaiHangTimeRecord
baiHangTimeRecord
);
List
<
Repayment
LoanInfo
>
findStockRepayMentLoanInfoOverdue
(
BaiHangTimeRecord
baiHangTimeRecord
);
List
<
Repayment
InfoZhuDai
>
findStockRepayMentLoanInfoOverdue
(
BaiHangTimeRecord
baiHangTimeRecord
);
BaiHangNameResult
findName
(
BaiHangName
baiHangName
);
BaiHangNameResult
findName
(
BaiHangName
baiHangName
);
...
...
src/main/java/cn/quantgroup/report/mapper/master/LoanInfoDbMapper.java
View file @
0c7340ab
package
cn
.
quantgroup
.
report
.
mapper
.
master
;
package
cn
.
quantgroup
.
report
.
mapper
.
master
;
import
cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord
;
import
cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord
;
import
cn.quantgroup.report.domain.baihang.LoanInfo
;
import
cn.quantgroup.report.domain.baihang.LoanInfo
ZhuDai
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
...
@@ -15,8 +15,8 @@ import java.util.List;
...
@@ -15,8 +15,8 @@ import java.util.List;
@Repository
@Repository
public
interface
LoanInfoDbMapper
{
public
interface
LoanInfoDbMapper
{
void
saveLoanInfoRecordLog
(
LoanInfo
loanInfo
);
void
saveLoanInfoRecordLog
(
LoanInfo
ZhuDai
loanInfo
);
List
<
LoanInfo
>
findAll
();
List
<
LoanInfo
ZhuDai
>
findAll
();
void
updateCurrentRecordEnableFalce
(
BaiHangUpDateRecord
baiHangUpDateRecord
);
void
updateCurrentRecordEnableFalce
(
BaiHangUpDateRecord
baiHangUpDateRecord
);
}
}
src/main/java/cn/quantgroup/report/mapper/master/RepaymentLoanInfoDbMapper.java
View file @
0c7340ab
...
@@ -2,7 +2,7 @@ package cn.quantgroup.report.mapper.master;
...
@@ -2,7 +2,7 @@ package cn.quantgroup.report.mapper.master;
import
cn.quantgroup.report.domain.baihang.BaiHangRepayment
;
import
cn.quantgroup.report.domain.baihang.BaiHangRepayment
;
import
cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord
;
import
cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord
;
import
cn.quantgroup.report.domain.baihang.Repayment
LoanInfo
;
import
cn.quantgroup.report.domain.baihang.Repayment
InfoZhuDai
;
import
cn.quantgroup.report.domain.baihang.RepaymentLoanInfoVo
;
import
cn.quantgroup.report.domain.baihang.RepaymentLoanInfoVo
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -17,13 +17,13 @@ import java.util.List;
...
@@ -17,13 +17,13 @@ import java.util.List;
@Repository
@Repository
public
interface
RepaymentLoanInfoDbMapper
{
public
interface
RepaymentLoanInfoDbMapper
{
void
saveRepaymentLoanInfoLog
(
Repayment
LoanInfo
repaymentLoanInfo
);
void
saveRepaymentLoanInfoLog
(
Repayment
InfoZhuDai
repaymentLoanInfo
);
List
<
Repayment
LoanInfo
>
findAll
();
List
<
Repayment
InfoZhuDai
>
findAll
();
void
updateCurrentRecordEnableFalse
(
BaiHangUpDateRecord
baiHangUpDateRecord
);
void
updateCurrentRecordEnableFalse
(
BaiHangUpDateRecord
baiHangUpDateRecord
);
Repayment
LoanInfo
findLastOne
(
BaiHangRepayment
baiHangRepayment
);
Repayment
InfoZhuDai
findLastOne
(
BaiHangRepayment
baiHangRepayment
);
/**
/**
...
...
src/main/java/cn/quantgroup/report/service/baihang/BaiHangService.java
View file @
0c7340ab
...
@@ -130,7 +130,7 @@ public class BaiHangService {
...
@@ -130,7 +130,7 @@ public class BaiHangService {
*/
*/
public
void
sendLoaInfoReportToBaiHang
()
{
public
void
sendLoaInfoReportToBaiHang
()
{
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
List
<
LoanInfo
>
loanInfos
=
new
ArrayList
<>();
List
<
LoanInfo
ZhuDai
>
loanInfos
=
new
ArrayList
<>();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
try
{
Stopwatch
queryWatch
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch
=
Stopwatch
.
createStarted
();
...
@@ -138,7 +138,7 @@ public class BaiHangService {
...
@@ -138,7 +138,7 @@ public class BaiHangService {
log
.
info
(
"广达小贷TO百行放款申请报送开始, 大小: {} , 耗时: {} "
,
loanInfos
.
size
(),
queryWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"广达小贷TO百行放款申请报送开始, 大小: {} , 耗时: {} "
,
loanInfos
.
size
(),
queryWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
for
(
int
i
=
0
;
i
<
loanInfos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
loanInfos
.
size
();
i
++)
{
LoanInfo
loanInfo
=
loanInfos
.
get
(
i
);
LoanInfo
ZhuDai
loanInfo
=
loanInfos
.
get
(
i
);
String
id
=
""
;
String
id
=
""
;
try
{
try
{
String
loanInfoReqId
=
loanInfo
.
getReqID
();
String
loanInfoReqId
=
loanInfo
.
getReqID
();
...
@@ -188,7 +188,7 @@ public class BaiHangService {
...
@@ -188,7 +188,7 @@ public class BaiHangService {
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
try
{
List
<
Repayment
LoanInfo
>
repaymentLoanInfos
=
null
;
List
<
Repayment
InfoZhuDai
>
repaymentLoanInfos
=
null
;
if
(
j
==
0
)
{
if
(
j
==
0
)
{
Stopwatch
realTimeStopWatch
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeStopWatch
=
Stopwatch
.
createStarted
();
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
findRepayMentLoanInfo
(
BaiHangTimeRecord
.
builder
().
startTime
(
startTime
).
endTime
(
endTime
).
build
());
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
findRepayMentLoanInfo
(
BaiHangTimeRecord
.
builder
().
startTime
(
startTime
).
endTime
(
endTime
).
build
());
...
@@ -202,10 +202,10 @@ public class BaiHangService {
...
@@ -202,10 +202,10 @@ public class BaiHangService {
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++)
{
Repayment
LoanInfo
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
Repayment
InfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
String
id
=
""
;
String
id
=
""
;
try
{
try
{
Repayment
LoanInfo
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
build
());
Repayment
InfoZhuDai
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
build
());
if
(
j
>
0
&&
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
if
(
j
>
0
&&
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
log
.
info
(
"广达小贷TO百行征信报送实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} "
,
startTime
,
endTime
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
log
.
info
(
"广达小贷TO百行征信报送实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} "
,
startTime
,
endTime
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
continue
;
continue
;
...
@@ -252,7 +252,7 @@ public class BaiHangService {
...
@@ -252,7 +252,7 @@ public class BaiHangService {
log
.
info
(
"百行征信报送放款数据, {}"
,
JSON
.
toJSONString
(
handLoanInfos
));
log
.
info
(
"百行征信报送放款数据, {}"
,
JSON
.
toJSONString
(
handLoanInfos
));
for
(
int
i
=
0
;
i
<
handLoanInfos
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
handLoanInfos
.
size
();
i
++){
LoanInfo
loanInfo
=
new
Gson
().
fromJson
(
handLoanInfos
.
get
(
i
),
new
TypeToken
<
LoanInfo
>(){}.
getType
());
LoanInfo
ZhuDai
loanInfo
=
new
Gson
().
fromJson
(
handLoanInfos
.
get
(
i
),
new
TypeToken
<
LoanInfoZhuDai
>(){}.
getType
());
log
.
info
(
"百行征信报送放款数据单个数据, {}"
,
JSON
.
toJSONString
(
loanInfo
));
log
.
info
(
"百行征信报送放款数据单个数据, {}"
,
JSON
.
toJSONString
(
loanInfo
));
String
loanInfoReqId
=
loanInfo
.
getReqID
();
String
loanInfoReqId
=
loanInfo
.
getReqID
();
...
@@ -282,7 +282,7 @@ public class BaiHangService {
...
@@ -282,7 +282,7 @@ public class BaiHangService {
List
<
String
>
repaymentLoanInfos
=
FileUtils
.
readLines
(
new
File
(
baihangHandD3DataUrl
),
"utf-8"
);
List
<
String
>
repaymentLoanInfos
=
FileUtils
.
readLines
(
new
File
(
baihangHandD3DataUrl
),
"utf-8"
);
log
.
info
(
"百行征信报送还款数据, {}"
,
JSON
.
toJSONString
(
repaymentLoanInfos
));
log
.
info
(
"百行征信报送还款数据, {}"
,
JSON
.
toJSONString
(
repaymentLoanInfos
));
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++){
Repayment
LoanInfo
repaymentLoanInfo
=
new
Gson
().
fromJson
(
repaymentLoanInfos
.
get
(
i
),
new
TypeToken
<
RepaymentLoanInfo
>(){}.
getType
());
Repayment
InfoZhuDai
repaymentLoanInfo
=
new
Gson
().
fromJson
(
repaymentLoanInfos
.
get
(
i
),
new
TypeToken
<
RepaymentInfoZhuDai
>(){}.
getType
());
log
.
info
(
"百行征信报送还款数据单个数据, {}"
,
JSON
.
toJSONString
(
repaymentLoanInfo
));
log
.
info
(
"百行征信报送还款数据单个数据, {}"
,
JSON
.
toJSONString
(
repaymentLoanInfo
));
try
{
try
{
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
repaymentLoanInfo
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
repaymentLoanInfo
);
...
@@ -328,9 +328,9 @@ public class BaiHangService {
...
@@ -328,9 +328,9 @@ public class BaiHangService {
//http 存量放款数据报送
//http 存量放款数据报送
public
void
stockLoanInfo
()
{
public
void
stockLoanInfo
()
{
List
<
LoanInfo
>
loanInfos
=
loanInfoMapper
.
stockLoanInfo
();
List
<
LoanInfo
ZhuDai
>
loanInfos
=
loanInfoMapper
.
stockLoanInfo
();
for
(
int
i
=
0
;
i
<
loanInfos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
loanInfos
.
size
();
i
++)
{
LoanInfo
loanInfo
=
loanInfos
.
get
(
i
);
LoanInfo
ZhuDai
loanInfo
=
loanInfos
.
get
(
i
);
String
id
=
""
;
String
id
=
""
;
try
{
try
{
String
loanInfoReqId
=
loanInfo
.
getReqID
();
String
loanInfoReqId
=
loanInfo
.
getReqID
();
...
@@ -360,7 +360,7 @@ public class BaiHangService {
...
@@ -360,7 +360,7 @@ public class BaiHangService {
if
(
erlyDate
.
plusDays
(
counter
+
1
).
compareTo
(
endDate
)
>=
0
)
{
if
(
erlyDate
.
plusDays
(
counter
+
1
).
compareTo
(
endDate
)
>=
0
)
{
break
;
break
;
}
}
List
<
Repayment
LoanInfo
>
repaymentLoanInfos
=
new
ArrayList
<>();
List
<
Repayment
InfoZhuDai
>
repaymentLoanInfos
=
new
ArrayList
<>();
String
starTime
=
erlyDate
.
plusDays
(
counter
).
format
(
DateTimeFormatter
.
ISO_DATE
);
String
starTime
=
erlyDate
.
plusDays
(
counter
).
format
(
DateTimeFormatter
.
ISO_DATE
);
String
endTime
=
erlyDate
.
plusDays
(
counter
+
1
).
format
(
DateTimeFormatter
.
ISO_DATE
);
String
endTime
=
erlyDate
.
plusDays
(
counter
+
1
).
format
(
DateTimeFormatter
.
ISO_DATE
);
log
.
info
(
"整理startTime: {} , endTime: {} "
,
starTime
,
endTime
);
log
.
info
(
"整理startTime: {} , endTime: {} "
,
starTime
,
endTime
);
...
@@ -377,7 +377,7 @@ public class BaiHangService {
...
@@ -377,7 +377,7 @@ public class BaiHangService {
log
.
info
(
"查询逾期还款 startTime: {} , endTime: {} , 大小: {} , 耗时: {} "
,
starTime
,
endTime
,
repaymentLoanInfos
.
size
(),
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"查询逾期还款 startTime: {} , endTime: {} , 大小: {} , 耗时: {} "
,
starTime
,
endTime
,
repaymentLoanInfos
.
size
(),
stopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
}
}
for
(
int
j
=
0
;
j
<
repaymentLoanInfos
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
repaymentLoanInfos
.
size
();
j
++)
{
Repayment
LoanInfo
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
j
);
Repayment
InfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
j
);
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190508/baihang_source_d3.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190508/baihang_source_d3.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// FileUtils.write(new File("/vpants/shaun/risk-datasource/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0001.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// FileUtils.write(new File("/vpants/shaun/risk-datasource/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0001.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
FileUtils
.
write
(
new
File
(
"/Users/fengjunkai/Desktop/new/20190529/xinjiangguangda_D3_2019052910580303_0001.txt"
),
JSON
.
toJSONString
(
repaymentLoanInfo
)
+
"\r\n"
,
true
);
FileUtils
.
write
(
new
File
(
"/Users/fengjunkai/Desktop/new/20190529/xinjiangguangda_D3_2019052910580303_0001.txt"
),
JSON
.
toJSONString
(
repaymentLoanInfo
)
+
"\r\n"
,
true
);
...
...
src/main/java/cn/quantgroup/report/service/baihang/BaiHangZhuDaiService.java
View file @
0c7340ab
...
@@ -18,9 +18,7 @@ import cn.quantgroup.report.service.baihang.response.InterfaceUploadResponse;
...
@@ -18,9 +18,7 @@ import cn.quantgroup.report.service.baihang.response.InterfaceUploadResponse;
import
cn.quantgroup.report.service.baihang.response.InterfaceUploadValidationResponse
;
import
cn.quantgroup.report.service.baihang.response.InterfaceUploadValidationResponse
;
import
cn.quantgroup.report.service.baihang.util.BHRSAUtils
;
import
cn.quantgroup.report.service.baihang.util.BHRSAUtils
;
import
cn.quantgroup.report.service.baihang.util.Base64
;
import
cn.quantgroup.report.service.baihang.util.Base64
;
import
cn.quantgroup.report.service.baihang.util.TuoMinUtils
;
import
cn.quantgroup.report.service.http.IHttpService
;
import
cn.quantgroup.report.service.http.IHttpService
;
import
cn.quantgroup.report.utils.ReadOrWriteTxt
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -40,8 +38,6 @@ import javax.annotation.PostConstruct;
...
@@ -40,8 +38,6 @@ import javax.annotation.PostConstruct;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.security.PublicKey
;
import
java.security.PublicKey
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
...
@@ -102,9 +98,10 @@ public class BaiHangZhuDaiService {
...
@@ -102,9 +98,10 @@ public class BaiHangZhuDaiService {
@Value
(
"${baihang.zhudai.password}"
)
@Value
(
"${baihang.zhudai.password}"
)
public
String
password
;
public
String
password
;
private
DateFormat
df_uploadTs
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
//
private DateFormat df_uploadTs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
private
final
String
zl_file_path_name
=
"D:/BaiHangZhuDai/data/D3/"
;
@Value
(
"${baihang.zhudai.cunliang.data.url}"
)
public
String
zl_file_path_name
;
// = "D:\\JavaTeam\\baihang\\cunLiang\\";存量数据整理目录
private
static
PublicKey
baihang_zhudai_publickey
=
null
;
private
static
PublicKey
baihang_zhudai_publickey
=
null
;
...
@@ -142,11 +139,11 @@ public class BaiHangZhuDaiService {
...
@@ -142,11 +139,11 @@ public class BaiHangZhuDaiService {
Stopwatch
queryWatch1
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch1
=
Stopwatch
.
createStarted
();
BaiHangTimeRecord
timeRecord
=
BaiHangTimeRecord
.
builder
().
startTime
(
startnyr
).
endTime
(
endnyr
).
build
();
BaiHangTimeRecord
timeRecord
=
BaiHangTimeRecord
.
builder
().
startTime
(
startnyr
).
endTime
(
endnyr
).
build
();
List
<
ApplyLoanInfoZhuDai
>
applyLoanInfos
=
applyLoanInfoMapper
.
findRealTimeApplyLoanZhuDai
(
timeRecord
);
List
<
ApplyLoanInfoZhuDai
>
applyLoanInfos
=
applyLoanInfoMapper
.
findRealTimeApplyLoanZhuDai
(
timeRecord
);
log
.
info
(
"量化派助贷TO百行报送-非联合贷申请查询完成, 大小: {} , 耗时: {} "
,
(
applyLoanInfos
!=
null
?
applyLoanInfos
.
size
()
:
0
),
queryWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-非联合贷申请查询完成, 大小: {} , 耗时: {} "
,
(
applyLoanInfos
!=
null
?
applyLoanInfos
.
size
()
:
0
),
(
queryWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
Stopwatch
queryWatch2
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch2
=
Stopwatch
.
createStarted
();
List
<
ApplyLoanInfoZhuDai
>
applyLoanInfosLh
=
applyLoanInfoMapper
.
findRealTimeApplyLoanZhuDaiLh
();
List
<
ApplyLoanInfoZhuDai
>
applyLoanInfosLh
=
applyLoanInfoMapper
.
findRealTimeApplyLoanZhuDaiLh
();
log
.
info
(
"量化派助贷TO百行报送-联合贷申请查询完成, 大小: {} , 耗时: {} "
,
(
applyLoanInfosLh
!=
null
?
applyLoanInfosLh
.
size
()
:
0
),
queryWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-联合贷申请查询完成, 大小: {} , 耗时: {} "
,
(
applyLoanInfosLh
!=
null
?
applyLoanInfosLh
.
size
()
:
0
),
(
queryWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
if
(
applyLoanInfos
==
null
){
if
(
applyLoanInfos
==
null
){
applyLoanInfos
=
new
ArrayList
<
ApplyLoanInfoZhuDai
>();
applyLoanInfos
=
new
ArrayList
<
ApplyLoanInfoZhuDai
>();
...
@@ -175,7 +172,7 @@ public class BaiHangZhuDaiService {
...
@@ -175,7 +172,7 @@ public class BaiHangZhuDaiService {
log
.
error
(
"量化派助贷TO百行报送-贷款申请信息异常"
,
e
);
log
.
error
(
"量化派助贷TO百行报送-贷款申请信息异常"
,
e
);
}
}
}
}
log
.
info
(
"量化派助贷TO百行报送-贷款申请报送完成, 实际大小: {} , 报送成功大小: {} , 耗时: {} "
,
applyLoanInfos
.
size
(),
atomicInteger
.
get
(),
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-贷款申请报送完成, 实际大小: {} , 报送成功大小: {} , 耗时: {} "
,
applyLoanInfos
.
size
(),
atomicInteger
.
get
(),
(
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
}
}
...
@@ -193,11 +190,11 @@ public class BaiHangZhuDaiService {
...
@@ -193,11 +190,11 @@ public class BaiHangZhuDaiService {
try
{
try
{
Stopwatch
queryWatch1
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch1
=
Stopwatch
.
createStarted
();
loanInfos
=
loanInfoMapper
.
findRealTimeLoanInfoZhuDai
(
timeRecord
);
loanInfos
=
loanInfoMapper
.
findRealTimeLoanInfoZhuDai
(
timeRecord
);
log
.
info
(
"量化派助贷TO百行报送-非联合贷放款申请报送开始, 大小: {} , 耗时: {} "
,
loanInfos
.
size
(),
queryWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-非联合贷放款申请报送开始, 大小: {} , 耗时: {} "
,
loanInfos
.
size
(),
(
queryWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
Stopwatch
queryWatch2
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch2
=
Stopwatch
.
createStarted
();
List
<
LoanInfoZhuDai
>
loanInfosLh
=
loanInfoMapper
.
findRealTimeLoanInfoZhuDaiLh
();
List
<
LoanInfoZhuDai
>
loanInfosLh
=
loanInfoMapper
.
findRealTimeLoanInfoZhuDaiLh
();
log
.
info
(
"量化派助贷TO百行报送-联合贷放款申请报送开始, 大小: {} , 耗时: {} "
,
loanInfosLh
.
size
(),
queryWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-联合贷放款申请报送开始, 大小: {} , 耗时: {} "
,
loanInfosLh
.
size
(),
(
queryWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
if
(
loanInfos
==
null
){
if
(
loanInfos
==
null
){
loanInfos
=
new
ArrayList
<
LoanInfoZhuDai
>();
loanInfos
=
new
ArrayList
<
LoanInfoZhuDai
>();
...
@@ -216,27 +213,6 @@ public class BaiHangZhuDaiService {
...
@@ -216,27 +213,6 @@ public class BaiHangZhuDaiService {
loanInfozd_tmp
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
loanInfozd_tmp
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
}
}
/*UUID loanInfoId = UUID.randomUUID();
id = loanInfoId.toString().replaceAll("-", "");
loanInfo.setRecordId(id);
try{
loanInfoDbMapper.saveLoanInfoRecordLog(loanInfo);
}catch(Exception e){}
loanInfo.setRecordId(null);
loanInfo.setReqID(id);*/
UUID
loanInfoId
=
UUID
.
randomUUID
();
id
=
loanInfoId
.
toString
().
replaceAll
(
"-"
,
""
);
try
{
LoanInfo
record
=
new
LoanInfo
();
BeanUtils
.
copyProperties
(
loanInfozd_tmp
,
record
);
record
.
setRecordId
(
id
);
loanInfoDbMapper
.
saveLoanInfoRecordLog
(
record
);
}
catch
(
Exception
e
){
log
.
error
(
"量化派助贷TO百行报送-放款申请保存记录失败"
,
e
);
}
loanInfozd_tmp
.
setReqID
(
id
);
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
if
(
relationID
!=
null
){
if
(
relationID
!=
null
){
if
(
relationID
.
length
()>
36
){
//长度[1,26]
if
(
relationID
.
length
()>
36
){
//长度[1,26]
...
@@ -250,6 +226,16 @@ public class BaiHangZhuDaiService {
...
@@ -250,6 +226,16 @@ public class BaiHangZhuDaiService {
}
}
}
}
UUID
loanInfoId
=
UUID
.
randomUUID
();
id
=
loanInfoId
.
toString
().
replaceAll
(
"-"
,
""
);
try
{
loanInfozd_tmp
.
setRecordId
(
id
);
loanInfoDbMapper
.
saveLoanInfoRecordLog
(
loanInfozd_tmp
);
}
catch
(
Exception
e
){
log
.
error
(
"量化派助贷TO百行报送-放款申请保存记录失败"
,
e
);
}
loanInfozd_tmp
.
setRecordId
(
null
);
loanInfozd_tmp
.
setReqID
(
id
);
String
jsonStr
=
JSONObject
.
toJSONString
(
loanInfozd_tmp
);
String
jsonStr
=
JSONObject
.
toJSONString
(
loanInfozd_tmp
);
LoanInfoZhuDaiVo
loanInfo
=
JSONObject
.
parseObject
(
jsonStr
,
LoanInfoZhuDaiVo
.
class
);
LoanInfoZhuDaiVo
loanInfo
=
JSONObject
.
parseObject
(
jsonStr
,
LoanInfoZhuDaiVo
.
class
);
...
@@ -275,7 +261,7 @@ public class BaiHangZhuDaiService {
...
@@ -275,7 +261,7 @@ public class BaiHangZhuDaiService {
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
"量化派助贷TO百行报送-异常"
,
e
);
log
.
error
(
"量化派助贷TO百行报送-异常"
,
e
);
}
}
log
.
info
(
"量化派助贷TO百行报送-放款申请完成, 实际大小: {} , 报送成功大小: {} , 耗时: {} "
,
loanInfos
.
size
(),
atomicInteger
.
get
(),
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-放款申请完成, 实际大小: {} , 报送成功大小: {} , 耗时: {} "
,
loanInfos
.
size
(),
atomicInteger
.
get
(),
(
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
}
}
...
@@ -295,20 +281,20 @@ public class BaiHangZhuDaiService {
...
@@ -295,20 +281,20 @@ public class BaiHangZhuDaiService {
if
(
j
==
0
)
{
if
(
j
==
0
)
{
Stopwatch
realTimeStopWatch1
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeStopWatch1
=
Stopwatch
.
createStarted
();
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentInfo
(
timeRecord
);
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentInfo
(
timeRecord
);
log
.
info
(
"量化派助贷TO百行报送-非联合贷实时还款, startnyr: {} , endnyr: {} , 大小: {} , 耗时: {} "
,
startnyr
,
endnyr
,
repaymentLoanInfos
.
size
(),
realTimeStopWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-非联合贷实时还款, startnyr: {} , endnyr: {} , 大小: {} , 耗时: {} "
,
startnyr
,
endnyr
,
repaymentLoanInfos
.
size
(),
(
realTimeStopWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
Stopwatch
realTimeStopWatch2
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeStopWatch2
=
Stopwatch
.
createStarted
();
repaymentLoanInfosLh
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentInfoLh
(
timeRecord
);
repaymentLoanInfosLh
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentInfoLh
(
timeRecord
);
log
.
info
(
"量化派助贷TO百行报送-联合贷实时还款, startnyr: {} , endnyr: {} , 大小: {} , 耗时: {} "
,
startnyr
,
endnyr
,
repaymentLoanInfosLh
.
size
(),
realTimeStopWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-联合贷实时还款, startnyr: {} , endnyr: {} , 大小: {} , 耗时: {} "
,
startnyr
,
endnyr
,
repaymentLoanInfosLh
.
size
(),
(
realTimeStopWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
}
else
{
}
else
{
Stopwatch
realTimeOverdueStopWatch3
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeOverdueStopWatch3
=
Stopwatch
.
createStarted
();
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentOverdue
(
timeRecord
);
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentOverdue
(
timeRecord
);
log
.
info
(
"量化派助贷TO百行报送-非联合贷实时还款逾期, startnyr: {} , endnyr: {} , 大小: {} , 耗时: {} "
,
startnyr
,
endnyr
,
repaymentLoanInfos
.
size
(),
realTimeOverdueStopWatch3
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-非联合贷实时还款逾期, startnyr: {} , endnyr: {} , 大小: {} , 耗时: {} "
,
startnyr
,
endnyr
,
repaymentLoanInfos
.
size
(),
(
realTimeOverdueStopWatch3
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
Stopwatch
realTimeOverdueStopWatch4
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeOverdueStopWatch4
=
Stopwatch
.
createStarted
();
repaymentLoanInfosLh
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentOverdueLh
(
timeRecord
);
repaymentLoanInfosLh
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentOverdueLh
(
timeRecord
);
log
.
info
(
"量化派助贷TO百行报送-联合贷实时还款逾期, startnyr: {} , endnyr: {} , 大小: {} , 耗时: {} "
,
startnyr
,
endnyr
,
repaymentLoanInfos
.
size
(),
realTimeOverdueStopWatch4
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-联合贷实时还款逾期, startnyr: {} , endnyr: {} , 大小: {} , 耗时: {} "
,
startnyr
,
endnyr
,
repaymentLoanInfos
.
size
(),
(
realTimeOverdueStopWatch4
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
}
}
...
@@ -324,30 +310,20 @@ public class BaiHangZhuDaiService {
...
@@ -324,30 +310,20 @@ public class BaiHangZhuDaiService {
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
String
id
=
""
;
String
id
=
""
;
try
{
try
{
Repayment
LoanInfo
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
build
());
Repayment
InfoZhuDai
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
build
());
if
(
j
>
0
&&
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
if
(
j
>
0
&&
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
log
.
info
(
"量化派助贷TO百行报送-实时还款逾期跳过报送, startnyr: {} , endnyr: {} , bean: {} "
,
startnyr
,
endnyr
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
log
.
info
(
"量化派助贷TO百行报送-实时还款逾期跳过报送, startnyr: {} , endnyr: {} , bean: {} "
,
startnyr
,
endnyr
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
continue
;
continue
;
}
}
/*id = UUID.randomUUID().toString().replaceAll("-", "");
repaymentLoanInfo.setRecordId(id);
try {
repaymentLoanInfoDbMapper.saveRepaymentLoanInfoLog(repaymentLoanInfo);
} catch (Exception e) {
}
repaymentLoanInfo.setReqID(id);
repaymentLoanInfo.setRecordId(null);*/
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
try
{
try
{
RepaymentLoanInfo
record
=
new
RepaymentLoanInfo
();
repaymentLoanInfo
.
setRecordId
(
id
);
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
repaymentLoanInfo
);
record
.
setRecordId
(
id
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
record
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送-实时还款保存记录异常"
,
e
);
log
.
error
(
"量化派助贷TO百行报送-实时还款保存记录异常"
,
e
);
}
}
repaymentLoanInfo
.
setRecordId
(
null
);
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setPid
(
interfaceUploadClient
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setPid
(
interfaceUploadClient
(
repaymentLoanInfo
.
getPid
()));
...
@@ -366,7 +342,7 @@ public class BaiHangZhuDaiService {
...
@@ -366,7 +342,7 @@ public class BaiHangZhuDaiService {
log
.
error
(
"量化派助贷TO百行报送-还款信息异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
log
.
error
(
"量化派助贷TO百行报送-还款信息异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
}
}
}
}
log
.
info
(
"量化派助贷TO百行报送-还款申请完成 J: {} , 开始时间: {} , 结束时间: {} , 实际大小: {} , 报送成功大小: {} , 耗时: {} "
,
j
,
startnyr
,
endnyr
,
repaymentLoanInfos
.
size
(),
atomicInteger
.
get
(),
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"量化派助贷TO百行报送-还款申请完成 J: {} , 开始时间: {} , 结束时间: {} , 实际大小: {} , 报送成功大小: {} , 耗时: {} "
,
j
,
startnyr
,
endnyr
,
repaymentLoanInfos
.
size
(),
atomicInteger
.
get
(),
(
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送-异常 J: {} , 开始时间: {} , 结束时间: {} "
,
j
,
startnyr
,
endnyr
,
e
);
log
.
error
(
"量化派助贷TO百行报送-异常 J: {} , 开始时间: {} , 结束时间: {} "
,
j
,
startnyr
,
endnyr
,
e
);
}
}
...
@@ -383,10 +359,11 @@ public class BaiHangZhuDaiService {
...
@@ -383,10 +359,11 @@ public class BaiHangZhuDaiService {
* 创建时间: 2019.10.29 <br/>
* 创建时间: 2019.10.29 <br/>
*/
*/
public
void
sendHandApplyToBaiHang
()
throws
Exception
{
public
void
sendHandApplyToBaiHang
()
throws
Exception
{
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
List
<
String
>
handApplys
=
FileUtils
.
readLines
(
new
File
(
baihangHandA1DataUrl
),
"utf-8"
);
List
<
String
>
handApplys
=
FileUtils
.
readLines
(
new
File
(
baihangHandA1DataUrl
),
"utf-8"
);
log
.
info
(
"百行征信助贷模式报送贷款申请数据, {}"
,
JSON
.
toJSONString
(
handApplys
));
log
.
info
(
"百行征信助贷模式报送贷款申请数据, {}"
,
JSON
.
toJSONString
(
handApplys
));
for
(
int
i
=
0
;
i
<
handApplys
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
handApplys
.
size
();
i
++){
try
{
//
try {
ApplyLoanInfoZhuDai
applyInfo
=
new
Gson
().
fromJson
(
handApplys
.
get
(
i
),
new
TypeToken
<
ApplyLoanInfoZhuDai
>(){}.
getType
());
ApplyLoanInfoZhuDai
applyInfo
=
new
Gson
().
fromJson
(
handApplys
.
get
(
i
),
new
TypeToken
<
ApplyLoanInfoZhuDai
>(){}.
getType
());
log
.
info
(
"百行征信助贷模式报送贷款申请数据单个数据, {}"
,
JSON
.
toJSONString
(
applyInfo
));
log
.
info
(
"百行征信助贷模式报送贷款申请数据单个数据, {}"
,
JSON
.
toJSONString
(
applyInfo
));
...
@@ -398,10 +375,11 @@ public class BaiHangZhuDaiService {
...
@@ -398,10 +375,11 @@ public class BaiHangZhuDaiService {
log.info("量化派助贷TO百行报送-贷款申请返回结果不正确, loanId: {} ", applyInfo.getLoanId());
log.info("量化派助贷TO百行报送-贷款申请返回结果不正确, loanId: {} ", applyInfo.getLoanId());
}*/
}*/
log
.
info
(
"百行征信助贷模式手动报送贷款申请记录 json: {} , result: {} "
,
JSON
.
toJSONString
(
applyInfo
),
resultStr
);
log
.
info
(
"百行征信助贷模式手动报送贷款申请记录 json: {} , result: {} "
,
JSON
.
toJSONString
(
applyInfo
),
resultStr
);
}
catch
(
Exception
e
)
{
/*
} catch (Exception e) {
log.error("百行征信助贷模式手动报送贷款申请记录异常", e);
log.error("百行征信助贷模式手动报送贷款申请记录异常", e);
}*/
}
}
}
log
.
info
(
"百行征信助贷模式手动报送贷款申请结束, 大小: {} , 耗时: {} "
,
handApplys
.
size
(),
((
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
));
}
}
/**
/**
...
@@ -412,6 +390,7 @@ public class BaiHangZhuDaiService {
...
@@ -412,6 +390,7 @@ public class BaiHangZhuDaiService {
* 创建时间: 2019.10.29 <br/>
* 创建时间: 2019.10.29 <br/>
*/
*/
public
void
sendHandLoaInfoReportToBaiHang
()
throws
Exception
{
public
void
sendHandLoaInfoReportToBaiHang
()
throws
Exception
{
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
List
<
String
>
handLoanInfos
=
FileUtils
.
readLines
(
new
File
(
baihangHandD2DataUrl
),
"utf-8"
);
List
<
String
>
handLoanInfos
=
FileUtils
.
readLines
(
new
File
(
baihangHandD2DataUrl
),
"utf-8"
);
log
.
info
(
"百行征信助贷模式报送放款数据, {}"
,
JSON
.
toJSONString
(
handLoanInfos
));
log
.
info
(
"百行征信助贷模式报送放款数据, {}"
,
JSON
.
toJSONString
(
handLoanInfos
));
for
(
int
i
=
0
;
i
<
handLoanInfos
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
handLoanInfos
.
size
();
i
++){
...
@@ -425,18 +404,6 @@ public class BaiHangZhuDaiService {
...
@@ -425,18 +404,6 @@ public class BaiHangZhuDaiService {
loanInfozd_tmp
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
loanInfozd_tmp
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
}
}
/*try{
loanInfoDbMapper.saveLoanInfoRecordLog(loanInfo);
}catch(Exception e){}*/
try
{
LoanInfo
record
=
new
LoanInfo
();
BeanUtils
.
copyProperties
(
loanInfozd_tmp
,
record
);
record
.
setRecordId
(
loanInfozd_tmp
.
getReqID
());
loanInfoDbMapper
.
saveLoanInfoRecordLog
(
record
);
}
catch
(
Exception
e
){
log
.
error
(
"量化派助贷TO百行报送-放款申请保存记录失败"
,
e
);
}
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
if
(
relationID
!=
null
){
if
(
relationID
!=
null
){
if
(
relationID
.
length
()>
36
){
//长度[1,26]
if
(
relationID
.
length
()>
36
){
//长度[1,26]
...
@@ -450,6 +417,14 @@ public class BaiHangZhuDaiService {
...
@@ -450,6 +417,14 @@ public class BaiHangZhuDaiService {
}
}
}
}
try
{
loanInfozd_tmp
.
setRecordId
(
loanInfozd_tmp
.
getReqID
());
loanInfoDbMapper
.
saveLoanInfoRecordLog
(
loanInfozd_tmp
);
}
catch
(
Exception
e
){
log
.
error
(
"量化派助贷TO百行报送-放款申请保存记录失败"
,
e
);
}
loanInfozd_tmp
.
setRecordId
(
null
);
String
jsonStr
=
JSONObject
.
toJSONString
(
loanInfozd_tmp
);
String
jsonStr
=
JSONObject
.
toJSONString
(
loanInfozd_tmp
);
LoanInfoZhuDaiVo
loanInfo
=
JSONObject
.
parseObject
(
jsonStr
,
LoanInfoZhuDaiVo
.
class
);
LoanInfoZhuDaiVo
loanInfo
=
JSONObject
.
parseObject
(
jsonStr
,
LoanInfoZhuDaiVo
.
class
);
FinTechAgencyBusinessZhuDai
finTechAgencyBusiness
=
JSONObject
.
parseObject
(
jsonStr
,
FinTechAgencyBusinessZhuDai
.
class
);
FinTechAgencyBusinessZhuDai
finTechAgencyBusiness
=
JSONObject
.
parseObject
(
jsonStr
,
FinTechAgencyBusinessZhuDai
.
class
);
...
@@ -462,6 +437,7 @@ public class BaiHangZhuDaiService {
...
@@ -462,6 +437,7 @@ public class BaiHangZhuDaiService {
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
loanInfo
));
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
loanInfo
));
log
.
info
(
"北京众信利民助贷模式TO百行征信报送放款记录(手动) loanId: {} , bean: {} , result: {} "
,
loanInfo
.
getLoanId
(),
JSON
.
toJSONString
(
loanInfo
),
resultStr
);
log
.
info
(
"北京众信利民助贷模式TO百行征信报送放款记录(手动) loanId: {} , bean: {} , result: {} "
,
loanInfo
.
getLoanId
(),
JSON
.
toJSONString
(
loanInfo
),
resultStr
);
}
}
log
.
info
(
"北京众信利民助贷模式TO百行征信报送放款记录(手动)结束, 大小: {} , 耗时: {} "
,
handLoanInfos
.
size
(),
((
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
));
}
}
...
@@ -472,28 +448,23 @@ public class BaiHangZhuDaiService {
...
@@ -472,28 +448,23 @@ public class BaiHangZhuDaiService {
* 创建人: yanhui.Hao <br/>
* 创建人: yanhui.Hao <br/>
* 创建时间: 2019.10.29 <br/>
* 创建时间: 2019.10.29 <br/>
*/
*/
public
void
sendHandRepaymentReportToBaiHang1
()
{
public
void
sendHandRepaymentReportToBaiHang1
()
throws
Exception
{
try
{
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
List
<
String
>
repaymentLoanInfos
=
FileUtils
.
readLines
(
new
File
(
baihangHandD3DataUrl
),
"utf-8"
);
List
<
String
>
repaymentLoanInfos
=
FileUtils
.
readLines
(
new
File
(
baihangHandD3DataUrl
),
"utf-8"
);
//try {
log
.
info
(
"百行征信助贷模式报送还款数据, {}"
,
JSON
.
toJSONString
(
repaymentLoanInfos
));
log
.
info
(
"百行征信助贷模式报送还款数据, {}"
,
JSON
.
toJSONString
(
repaymentLoanInfos
));
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++){
RepaymentInfoZhuDai
repaymentLoanInfo
=
new
Gson
().
fromJson
(
repaymentLoanInfos
.
get
(
i
),
new
TypeToken
<
RepaymentInfoZhuDai
>(){}.
getType
());
RepaymentInfoZhuDai
repaymentLoanInfo
=
new
Gson
().
fromJson
(
repaymentLoanInfos
.
get
(
i
),
new
TypeToken
<
RepaymentInfoZhuDai
>(){}.
getType
());
log
.
info
(
"百行征信助贷模式报送还款数据单个数据, {}"
,
JSON
.
toJSONString
(
repaymentLoanInfo
));
log
.
info
(
"百行征信助贷模式报送还款数据单个数据, {}"
,
JSON
.
toJSONString
(
repaymentLoanInfo
));
/*try {
repaymentLoanInfoDbMapper.saveRepaymentLoanInfoLog(repaymentLoanInfo);
} catch (Exception e) {
}
repaymentLoanInfo.setReqID(repaymentLoanInfo.getRecordId());
repaymentLoanInfo.setRecordId(null);*/
try
{
try
{
RepaymentLoanInfo
record
=
new
RepaymentLoanInfo
();
repaymentLoanInfo
.
setRecordId
(
repaymentLoanInfo
.
getReqID
());
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
repaymentLoanInfo
);
record
.
setRecordId
(
repaymentLoanInfo
.
getReqID
());
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
record
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送-实时还款保存记录异常"
,
e
);
log
.
error
(
"量化派助贷TO百行报送-实时还款保存记录异常"
,
e
);
}
}
repaymentLoanInfo
.
setRecordId
(
null
);
repaymentLoanInfo
.
setPid
(
interfaceUploadClient
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setPid
(
interfaceUploadClient
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setName
(
interfaceUploadClient
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setName
(
interfaceUploadClient
(
repaymentLoanInfo
.
getName
()));
...
@@ -502,10 +473,10 @@ public class BaiHangZhuDaiService {
...
@@ -502,10 +473,10 @@ public class BaiHangZhuDaiService {
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangRepayMentLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
repaymentLoanInfo
));
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangRepayMentLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
repaymentLoanInfo
));
log
.
info
(
"百行征信助贷模式手动报送还款记录 json: {} , result: {} "
,
JSON
.
toJSONString
(
repaymentLoanInfo
),
resultStr
);
log
.
info
(
"百行征信助贷模式手动报送还款记录 json: {} , result: {} "
,
JSON
.
toJSONString
(
repaymentLoanInfo
),
resultStr
);
}
}
}
catch
(
Exception
e
)
{
/*
} catch (Exception e) {
log.error("百行征信助贷模式手动报送还款异常", e);
log.error("百行征信助贷模式手动报送还款异常", e);
}
}
*/
log
.
info
(
"百行征信助贷模式手动报送还款记录结束, 大小: {} , 耗时: {} "
,
repaymentLoanInfos
.
size
(),
((
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
));
}
}
//-----------------------------------------------存量整理---------------------------------------------------------------------
//-----------------------------------------------存量整理---------------------------------------------------------------------
...
@@ -527,7 +498,7 @@ public class BaiHangZhuDaiService {
...
@@ -527,7 +498,7 @@ public class BaiHangZhuDaiService {
return
"日期格式有误"
;
return
"日期格式有误"
;
}
}
final
String
fileName
=
zl_file_path_name
+
"zhudai_"
+
startDate
.
substring
(
0
,
startDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)
+
"_"
+
noEndDate
.
substring
(
0
,
noEndDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)
+
"_0001.txt"
;
final
String
fileName
=
zl_file_path_name
+
"zhudai_
A1_
"
+
startDate
.
substring
(
0
,
startDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)
+
"_"
+
noEndDate
.
substring
(
0
,
noEndDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)
+
"_0001.txt"
;
LocalDateTime
erlyDate
=
LocalDateTime
.
parse
(
startDate
);
LocalDateTime
erlyDate
=
LocalDateTime
.
parse
(
startDate
);
LocalDateTime
endDate
=
LocalDateTime
.
parse
(
noEndDate
);
LocalDateTime
endDate
=
LocalDateTime
.
parse
(
noEndDate
);
...
@@ -550,11 +521,11 @@ public class BaiHangZhuDaiService {
...
@@ -550,11 +521,11 @@ public class BaiHangZhuDaiService {
Stopwatch
queryWatch1
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch1
=
Stopwatch
.
createStarted
();
List
<
ApplyLoanInfoZhuDai
>
applyLoanInfoList
=
applyLoanInfoMapper
.
findRealTimeApplyLoanZhuDai
(
timeRecord
);
List
<
ApplyLoanInfoZhuDai
>
applyLoanInfoList
=
applyLoanInfoMapper
.
findRealTimeApplyLoanZhuDai
(
timeRecord
);
log
.
info
(
"百行助贷申请存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
applyLoanInfoList
.
size
(),
starTime
,
queryWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"百行助贷申请存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
applyLoanInfoList
.
size
(),
starTime
,
(
queryWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
Stopwatch
queryWatch2
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch2
=
Stopwatch
.
createStarted
();
List
<
ApplyLoanInfoZhuDai
>
applyLoanInfosLh
=
applyLoanInfoMapper
.
findRealTimeApplyLoanZhuDaiLh
();
List
<
ApplyLoanInfoZhuDai
>
applyLoanInfosLh
=
applyLoanInfoMapper
.
findRealTimeApplyLoanZhuDaiLh
();
log
.
info
(
"百行助贷申请存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
applyLoanInfosLh
.
size
(),
starTime
,
queryWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"百行助贷申请存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
applyLoanInfosLh
.
size
(),
starTime
,
(
queryWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
if
(
applyLoanInfoList
==
null
){
if
(
applyLoanInfoList
==
null
){
applyLoanInfoList
=
new
ArrayList
<
ApplyLoanInfoZhuDai
>();
applyLoanInfoList
=
new
ArrayList
<
ApplyLoanInfoZhuDai
>();
...
@@ -605,7 +576,7 @@ public class BaiHangZhuDaiService {
...
@@ -605,7 +576,7 @@ public class BaiHangZhuDaiService {
log
.
warn
(
"stockLoanInfoZhuDai日期格式有误, startDate : {} , noEndDate : {} "
,
startDate
,
noEndDate
);
log
.
warn
(
"stockLoanInfoZhuDai日期格式有误, startDate : {} , noEndDate : {} "
,
startDate
,
noEndDate
);
return
"日期格式有误"
;
return
"日期格式有误"
;
}
}
final
String
fileName
=
zl_file_path_name
+
"zhudai_"
+
startDate
.
substring
(
0
,
startDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)
+
"_"
+
noEndDate
.
substring
(
0
,
noEndDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)+
"_0001.txt"
;
final
String
fileName
=
zl_file_path_name
+
"zhudai_
D2_
"
+
startDate
.
substring
(
0
,
startDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)
+
"_"
+
noEndDate
.
substring
(
0
,
noEndDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)+
"_0001.txt"
;
LocalDateTime
erlyDate
=
LocalDateTime
.
parse
(
startDate
);
LocalDateTime
erlyDate
=
LocalDateTime
.
parse
(
startDate
);
LocalDateTime
endDate
=
LocalDateTime
.
parse
(
noEndDate
);
LocalDateTime
endDate
=
LocalDateTime
.
parse
(
noEndDate
);
...
@@ -626,10 +597,10 @@ public class BaiHangZhuDaiService {
...
@@ -626,10 +597,10 @@ public class BaiHangZhuDaiService {
Stopwatch
queryWatch1
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch1
=
Stopwatch
.
createStarted
();
List
<
LoanInfoZhuDai
>
loanInfozdList
=
loanInfoMapper
.
findRealTimeLoanInfoZhuDai
(
timeRecord
);
List
<
LoanInfoZhuDai
>
loanInfozdList
=
loanInfoMapper
.
findRealTimeLoanInfoZhuDai
(
timeRecord
);
log
.
info
(
"百行助贷放款存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
loanInfozdList
.
size
(),
starTime
,
queryWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"百行助贷放款存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
loanInfozdList
.
size
(),
starTime
,
(
queryWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
Stopwatch
queryWatch2
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch2
=
Stopwatch
.
createStarted
();
List
<
LoanInfoZhuDai
>
loanInfozdListLh
=
loanInfoMapper
.
findRealTimeLoanInfoZhuDaiLh
();
List
<
LoanInfoZhuDai
>
loanInfozdListLh
=
loanInfoMapper
.
findRealTimeLoanInfoZhuDaiLh
();
log
.
info
(
"百行助贷放款存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
loanInfozdListLh
.
size
(),
starTime
,
queryWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"百行助贷放款存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
loanInfozdListLh
.
size
(),
starTime
,
(
queryWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
if
(
loanInfozdList
==
null
){
if
(
loanInfozdList
==
null
){
loanInfozdList
=
new
ArrayList
<
LoanInfoZhuDai
>();
loanInfozdList
=
new
ArrayList
<
LoanInfoZhuDai
>();
}
}
...
@@ -670,7 +641,7 @@ public class BaiHangZhuDaiService {
...
@@ -670,7 +641,7 @@ public class BaiHangZhuDaiService {
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
loanInfoZhuDaiVo
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
loanInfoZhuDaiVo
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
}
}
loanInfoZhuDaiVo
.
setReqID
(
id
);
//???
loanInfoZhuDaiVo
.
setReqID
(
id
);
FileUtils
.
write
(
new
File
(
fileName
),
JSON
.
toJSONString
(
loanInfoZhuDaiVo
)
+
"\r\n"
,
true
);
FileUtils
.
write
(
new
File
(
fileName
),
JSON
.
toJSONString
(
loanInfoZhuDaiVo
)
+
"\r\n"
,
true
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -702,13 +673,11 @@ public class BaiHangZhuDaiService {
...
@@ -702,13 +673,11 @@ public class BaiHangZhuDaiService {
log
.
warn
(
"stockRepayMentInfoZhuDai日期格式有误, startDate : {} , noEndDate : {} "
,
startDate
,
noEndDate
);
log
.
warn
(
"stockRepayMentInfoZhuDai日期格式有误, startDate : {} , noEndDate : {} "
,
startDate
,
noEndDate
);
return
"日期格式有误"
;
return
"日期格式有误"
;
}
}
final
String
fileName
=
zl_file_path_name
+
"zhudai_"
+
startDate
.
substring
(
0
,
startDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)
+
"_"
+
noEndDate
.
substring
(
0
,
noEndDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)+
"_0001.txt"
;
final
String
fileName
=
zl_file_path_name
+
"zhudai_
D3_
"
+
startDate
.
substring
(
0
,
startDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)
+
"_"
+
noEndDate
.
substring
(
0
,
noEndDate
.
indexOf
(
"T"
)).
replace
(
"-"
,
""
)+
"_0001.txt"
;
LocalDateTime
erlyDate
=
LocalDateTime
.
parse
(
startDate
);
LocalDateTime
erlyDate
=
LocalDateTime
.
parse
(
startDate
);
LocalDateTime
endDate
=
LocalDateTime
.
parse
(
noEndDate
);
LocalDateTime
endDate
=
LocalDateTime
.
parse
(
noEndDate
);
LocalDateTime
yq_start
=
LocalDateTime
.
parse
(
"2017-03-09T00:00:00"
);
int
counter
=
0
;
int
counter
=
0
;
log
.
info
(
"开始>>整理百行-助贷还款&逾期存量数据 startDate : {} , noEndDate : {} ......"
,
startDate
,
noEndDate
);
log
.
info
(
"开始>>整理百行-助贷还款&逾期存量数据 startDate : {} , noEndDate : {} ......"
,
startDate
,
noEndDate
);
while
(
true
)
{
while
(
true
)
{
...
@@ -728,16 +697,16 @@ public class BaiHangZhuDaiService {
...
@@ -728,16 +697,16 @@ public class BaiHangZhuDaiService {
long
log_stUtc
=
System
.
currentTimeMillis
();
long
log_stUtc
=
System
.
currentTimeMillis
();
try
{
try
{
if
(
type
==
0
)
{
if
(
type
==
0
)
{
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
//
Stopwatch stopwatch = Stopwatch.createStarted();
/* repaymentInfoList = repaymentLoanInfoMapper.queryStockRepayMentInfoZhuDai(timeRecord);*/
/* repaymentInfoList = repaymentLoanInfoMapper.queryStockRepayMentInfoZhuDai(timeRecord);*/
Stopwatch
realTimeStopWatch1
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeStopWatch1
=
Stopwatch
.
createStarted
();
repaymentInfoList
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentInfo
(
timeRecord
);
repaymentInfoList
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentInfo
(
timeRecord
);
log
.
info
(
"百行助贷还款存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
repaymentInfoList
.
size
(),
starTime
,
realTimeStopWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"百行助贷还款存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
repaymentInfoList
.
size
(),
starTime
,
(
realTimeStopWatch1
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
Stopwatch
realTimeStopWatch2
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeStopWatch2
=
Stopwatch
.
createStarted
();
repaymentLoanInfosLh
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentInfoLh
(
timeRecord
);
repaymentLoanInfosLh
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentInfoLh
(
timeRecord
);
log
.
info
(
"百行助贷还款存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
repaymentLoanInfosLh
.
size
(),
starTime
,
realTimeStopWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"百行助贷还款存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
repaymentLoanInfosLh
.
size
(),
starTime
,
(
realTimeStopWatch2
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
}
else
{
}
else
{
/*if(erlyDate.plusDays(counter-1).compareTo(yq_start) >= 0){
/*if(erlyDate.plusDays(counter-1).compareTo(yq_start) >= 0){
Stopwatch stopwatch = Stopwatch.createStarted();
Stopwatch stopwatch = Stopwatch.createStarted();
...
@@ -747,11 +716,11 @@ public class BaiHangZhuDaiService {
...
@@ -747,11 +716,11 @@ public class BaiHangZhuDaiService {
Stopwatch
realTimeOverdueStopWatch3
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeOverdueStopWatch3
=
Stopwatch
.
createStarted
();
repaymentInfoList
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentOverdue
(
timeRecord
);
repaymentInfoList
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentOverdue
(
timeRecord
);
log
.
info
(
"百行助贷逾期存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
repaymentInfoList
.
size
(),
starTime
,
realTimeOverdueStopWatch3
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"百行助贷逾期存量-非联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
repaymentInfoList
.
size
(),
starTime
,
(
realTimeOverdueStopWatch3
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
Stopwatch
realTimeOverdueStopWatch4
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeOverdueStopWatch4
=
Stopwatch
.
createStarted
();
repaymentLoanInfosLh
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentOverdueLh
(
timeRecord
);
repaymentLoanInfosLh
=
repaymentLoanInfoMapper
.
findRealTimeRepayMentOverdueLh
(
timeRecord
);
log
.
info
(
"百行助贷逾期存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
repaymentInfoList
.
size
(),
starTime
,
realTimeOverdueStopWatch4
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
);
log
.
info
(
"百行助贷逾期存量-联合贷查询结束, 大小: {} , starTime: {} , 耗时: {} "
,
repaymentInfoList
.
size
(),
starTime
,
(
realTimeOverdueStopWatch4
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
);
}
}
if
(
repaymentInfoList
==
null
){
if
(
repaymentInfoList
==
null
){
...
@@ -764,6 +733,8 @@ public class BaiHangZhuDaiService {
...
@@ -764,6 +733,8 @@ public class BaiHangZhuDaiService {
for
(
int
j
=
0
;
j
<
repaymentInfoList
.
size
();
j
++)
{
for
(
int
j
=
0
;
j
<
repaymentInfoList
.
size
();
j
++)
{
RepaymentInfoZhuDai
repaymentInfo
=
repaymentInfoList
.
get
(
j
);
RepaymentInfoZhuDai
repaymentInfo
=
repaymentInfoList
.
get
(
j
);
String
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
repaymentInfo
.
setReqID
(
id
);
FileUtils
.
write
(
new
File
(
fileName
),
JSON
.
toJSONString
(
repaymentInfo
)
+
"\r\n"
,
true
);
FileUtils
.
write
(
new
File
(
fileName
),
JSON
.
toJSONString
(
repaymentInfo
)
+
"\r\n"
,
true
);
}
}
...
@@ -817,7 +788,7 @@ public class BaiHangZhuDaiService {
...
@@ -817,7 +788,7 @@ public class BaiHangZhuDaiService {
* @throws Exception
* @throws Exception
*/
*/
//public static void interfaceUploadValidationClient() throws Exception {
//public static void interfaceUploadValidationClient() throws Exception {
p
ublic
static
void
interfaceUploadValidationClient
(
String
miwen
)
throws
Exception
{
p
rivate
static
void
interfaceUploadValidationClient
(
String
miwen
)
throws
Exception
{
//RSA私钥文件路径(百行提供测试环境私钥文件)
//RSA私钥文件路径(百行提供测试环境私钥文件)
// String RSA_PRIVATE_KEY = "d:\\rsa_private_key.pem";
// String RSA_PRIVATE_KEY = "d:\\rsa_private_key.pem";
...
@@ -1075,7 +1046,7 @@ public class BaiHangZhuDaiService {
...
@@ -1075,7 +1046,7 @@ public class BaiHangZhuDaiService {
UUID
loanInfoId
=
UUID
.
randomUUID
();
UUID
loanInfoId
=
UUID
.
randomUUID
();
id
=
loanInfoId
.
toString
().
replaceAll
(
"-"
,
""
);
id
=
loanInfoId
.
toString
().
replaceAll
(
"-"
,
""
);
try
{
try
{
LoanInfo
record
=
new
LoanInfo
();
LoanInfo
ZhuDai
record
=
new
LoanInfoZhuDai
();
BeanUtils
.
copyProperties
(
loanInfo
,
record
);
BeanUtils
.
copyProperties
(
loanInfo
,
record
);
record
.
setRecordId
(
id
);
record
.
setRecordId
(
id
);
loanInfoDbMapper
.
saveLoanInfoRecordLog
(
record
);
loanInfoDbMapper
.
saveLoanInfoRecordLog
(
record
);
...
@@ -1127,7 +1098,7 @@ public class BaiHangZhuDaiService {
...
@@ -1127,7 +1098,7 @@ public class BaiHangZhuDaiService {
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
String
id
=
""
;
String
id
=
""
;
try
{
try
{
Repayment
LoanInfo
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
build
());
Repayment
InfoZhuDai
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
build
());
if
(
j
>
0
&&
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
if
(
j
>
0
&&
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
log
.
info
(
"量化派助贷TO百行报送-实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} "
,
starTime
,
endTime
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
log
.
info
(
"量化派助贷TO百行报送-实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} "
,
starTime
,
endTime
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
continue
;
continue
;
...
@@ -1144,7 +1115,7 @@ public class BaiHangZhuDaiService {
...
@@ -1144,7 +1115,7 @@ public class BaiHangZhuDaiService {
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
try
{
try
{
Repayment
LoanInfo
record
=
new
RepaymentLoanInfo
();
Repayment
InfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
record
.
setRecordId
(
id
);
record
.
setRecordId
(
id
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
record
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
record
);
...
@@ -1183,430 +1154,4 @@ public class BaiHangZhuDaiService {
...
@@ -1183,430 +1154,4 @@ public class BaiHangZhuDaiService {
//=========================================================================
public
static
void
main22
(
String
[]
args
)
{
/* String startTime = DateUtils.getYesterdayDateStr();
System.out.println(startTime);*/
try
{
/* //公钥加密
String miwen = interfaceUploadClient("'440582199309280675");
System.out.println(miwen);
//私钥解密
interfaceUploadValidationClient(miwen);*/
/* convertApplyLoanInfo();
convertLoanInfo();
convertRepaymentLoanInfo();*/
//txt2cry
//fileUploadClient();
//cry2txt
//fileUploadValidationClient();
/*List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Documents/repaymentLoanInfo11.json"), "utf-8");
for(int i=0;i<list.size();i++){
try{
RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// repaymentLoanInfo.setPid(interfaceUploadClient(repaymentLoanInfo.getPid()));
// repaymentLoanInfo.setName(interfaceUploadClient(repaymentLoanInfo.getName()));
// repaymentLoanInfo.setMobile(interfaceUploadClient(repaymentLoanInfo.getMobile()));
Map<String,Object> repaymentLoanInfoMap = new HashMap<>();
repaymentLoanInfoMap.put("reqID", repaymentLoanInfo.getReqID());
repaymentLoanInfoMap.put("uploadTs", repaymentLoanInfo.getUploadTs());
repaymentLoanInfoMap.put("opCode", repaymentLoanInfo.getOpCode());
repaymentLoanInfoMap.put("loanId", repaymentLoanInfo.getLoanId());
repaymentLoanInfoMap.put("name", interfaceUploadClient(repaymentLoanInfo.getName()));
repaymentLoanInfoMap.put("mobile", interfaceUploadClient(repaymentLoanInfo.getMobile()));
repaymentLoanInfoMap.put("pid", interfaceUploadClient(repaymentLoanInfo.getPid()));
repaymentLoanInfoMap.put("termNo", repaymentLoanInfo.getTermNo());
repaymentLoanInfoMap.put("termStatus", repaymentLoanInfo.getTermStatus());
repaymentLoanInfoMap.put("targetRepaymentDate", repaymentLoanInfo.getTargetRepaymentDate());
// if(!"overdue".equals(repaymentLoanInfo.getTermStatus())){
repaymentLoanInfoMap.put("realRepaymentDate", repaymentLoanInfo.getRealRepaymentDate());
// }
repaymentLoanInfoMap.put("plannedPayment", repaymentLoanInfo.getPlannedPayment());
repaymentLoanInfoMap.put("targetRepayment", repaymentLoanInfo.getTargetRepayment());
repaymentLoanInfoMap.put("realRepayment", repaymentLoanInfo.getRealRepayment());
repaymentLoanInfoMap.put("overdueStatus", repaymentLoanInfo.getOverdueStatus());
repaymentLoanInfoMap.put("statusConfirmAt", repaymentLoanInfo.getStatusConfirmAt());
repaymentLoanInfoMap.put("overdueAmount", repaymentLoanInfo.getOverdueAmount());
repaymentLoanInfoMap.put("remainingAmount", repaymentLoanInfo.getRemainingAmount());
repaymentLoanInfoMap.put("loanStatus", repaymentLoanInfo.getLoanStatus());
// String resultStr = iHttpService.postBaiHang(baiHangRepayMentLoanInfoUrl, getHeader(), JSON.toJSONString(repaymentLoanInfoMap));
System.out.println(JSON.toJSONString(repaymentLoanInfoMap));
}catch(Exception e){
log.error("广达小贷TO百行征信报送非循环贷还款信息异常", e);
}
}*/
/*UUID uuid = UUID.randomUUID();
System.out.println(uuid.toString().replaceAll("-",""));
System.out.println(LocalDateTime.now().format(DateTimeFormatter.ISO_DATE));
System.out.println(LocalDateTime.now().plusDays(-1).format(DateTimeFormatter.ISO_DATE));
String str = FileUtils.readFileToString(new File("/Users/fengjunkai/Downloads/111.txt"), "utf-8");
//String str = FileUtils.readFileToString(new File("/Users/fengjunkai/Desktop/20190421/loanInfo_0421"), "utf-8");
//String str = FileUtils.readFileToString(new File("/Users/fengjunkai/Desktop/20190421/repaymentInfo_0421"), "utf-8");
JSONArray jsonArray = JSON.parseArray(str);
for(int i=0;i<jsonArray.size();i++){
JSONObject jsonObject = jsonArray.getJSONObject(i);
FileUtils.write(new File("/Users/fengjunkai/Desktop/20190421/鹰潭市信江广达小额贷款股份有限公司_D2_20190421141422_0002.txt"), JSON.toJSONString(jsonObject)+"\r\n", true);
FileUtils.write(new File("/Users/fengjunkai/Desktop/20190421/鹰潭市信江广达小额贷款股份有限公司_D3_20190421141422_0003.txt"), JSON.toJSONString(jsonObject)+"\r\n", true);
}*/
/*String startTime = LocalDateTime.now().plusDays(-1).format(DateTimeFormatter.ISO_DATE);
String endTime = LocalDateTime.now().format(DateTimeFormatter.ISO_DATE);
for(int i=0;i<100;i++){
System.out.println("startTime : "+LocalDateTime.now().plusDays(-(i+1)).format(DateTimeFormatter.ISO_DATE)+", "+"endTime : "+LocalDateTime.now().plusDays(-i).format(DateTimeFormatter.ISO_DATE));
}*/
/* int counter = 0;
LocalDateTime erlyDate = LocalDateTime.parse(ERLY_DATE);
LocalDateTime endDate = LocalDateTime.parse(END_DATE);
while (true){
counter++;
if(endDate.compareTo(erlyDate.plusDays(counter))>0){
break;
}
System.out.println("startTime : "+erlyDate.plusDays(counter).format(DateTimeFormatter.ISO_DATE)+", "+"endTime : "+erlyDate.plusDays(counter+1).format(DateTimeFormatter.ISO_DATE));
}
System.out.println(LocalDateTime.now().plusDays(-1).compareTo(LocalDateTime.now())>=0);
System.out.println(LocalDateTime.now().compareTo(LocalDateTime.now()));
System.out.println(0>0);
System.out.println(LocalDateTime.parse("2017-09-31").format(DateTimeFormatter.ISO_DATE));;
String s = LocalDateTime.parse("2017-09-31").format(DateTimeFormatter.ISO_DATE);
System.out.println(LocalDateTime.parse("2017-09-29T00:00:00").format(DateTimeFormatter.ISO_DATE));
List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/鹰潭市信江广达小额贷款股份有限公司_D3_20190422110303_0003_new2.txt"), "utf-8");
List<RepaymentLoanInfo> repaymentLoanInfos = new Gson().fromJson(JSON.toJSONString(list), new TypeToken<ArrayList<RepaymentLoanInfo>>(){}.getType());
Map<String, RepaymentLoanInfo> speedMap = new HashMap<>();
for(int i=0;i<list.size();i++){
RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// UUID uuid = UUID.randomUUID();
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/reqIdMappingToUuid.txt"), repaymentLoanInfo.getReqID()+":"+uuid.toString().replaceAll("-", "")+"\r\n", true);
// repaymentLoanInfo.setReqID(uuid.toString().replaceAll("-",""));
// if(repaymentLoanInfo.getLoanStatus()==3 && "overdue".equalsIgnoreCase(repaymentLoanInfo.getTermStatus())){
// System.out.println("跳过第"+i+"个"+" "+JSON.toJSONString(repaymentLoanInfo));
// continue;
// }
// loanId+termNo+状态确认时间一样的 把没有实际还款时间的删掉
RepaymentLoanInfo repaymentLoanInfoCache = speedMap.get(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getTermNo()+repaymentLoanInfo.getStatusConfirmAt());
if(repaymentLoanInfoCache!=null){ //说明里面包含了同样的记录
String realRepaymentDate = repaymentLoanInfoCache.getRealRepaymentDate();
if(StringUtils.isBlank(realRepaymentDate)){
continue;
}else{
speedMap.put(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getTermNo()+repaymentLoanInfo.getStatusConfirmAt(), repaymentLoanInfo);
}
}else{
speedMap.put(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getTermNo()+repaymentLoanInfo.getStatusConfirmAt(), repaymentLoanInfo);
}
}
speedMap.forEach((k, v)->{
RepaymentLoanInfo repaymentLoanInfo = speedMap.get(k);
try {
FileUtils.write(new File("/Users/fengjunkai/Desktop/new/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
} catch (IOException e) {
e.printStackTrace();
}
});
System.out.println("完事");*/
// LocalDateTime localDateTime = LocalDateTime.now();
// System.out.println(localDateTime);
// System.out.println(localDateTime.toString().substring(0,19));
// System.out.println(localDateTime.format(DateTimeFormatter.ISO_LOCAL_DATE));
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004.txt"), "utf-8");
// Map<String,RepaymentLoanInfo> repaymentLoanInfoMap = new HashMap<>();
// for(int i=1;i<list.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// repaymentLoanInfoMap.put(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getTermNo()+repaymentLoanInfo.getLoanStatus(), repaymentLoanInfo);
// }
// List<String> list1 = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/CRY/11111111"), "utf-8");
// for(int i=0;i<list1.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = repaymentLoanInfoMap.get(list1.get(i));
// System.out.println(JSON.toJSONString(repaymentLoanInfo));
//
// repaymentLoanInfo.setLoanStatus(2);
// repaymentLoanInfo.setOpCode("M");
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_tmp1.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }
// for(int i=1;i<list.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// repaymentLoanInfo.setOpCode("M");
// if("967167083".equals(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus())){
// repaymentLoanInfo.setRealRepayment(repaymentLoanInfo.getPlannedPayment());
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_tmp.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }else if("967175963".equals(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus())){
// repaymentLoanInfo.setRealRepayment(repaymentLoanInfo.getPlannedPayment());
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_tmp.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }else if("967162983".equals(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus())){
// repaymentLoanInfo.setRealRepayment(repaymentLoanInfo.getPlannedPayment());
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_tmp.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }else if("967167603".equals(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus())){
// repaymentLoanInfo.setRealRepayment(repaymentLoanInfo.getPlannedPayment());
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_tmp.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }else if("967141803".equals(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus())){
// repaymentLoanInfo.setRealRepayment(repaymentLoanInfo.getPlannedPayment());
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_tmp.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }
// }
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_M_logicerror.log"), "utf-8");
// List<String> list1 = new ArrayList<>();
// for(int i=1;i<list.size();i++){
// JSONObject jsonObject = JSON.parseObject(list.get(i));
// String reqId = jsonObject.getString("reqID");
// list1.add(reqId);
// }
//
// List<String> list2 = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_tmp1.txt"), "utf-8");
// Map<String,RepaymentLoanInfo> repaymentLoanInfoMap = new HashMap<>();
// for(int i=0;i<list2.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list2.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// repaymentLoanInfoMap.put(repaymentLoanInfo.getReqID(), repaymentLoanInfo);
// }
//
//// repaymentLoanInfoMap.forEach((k,v)->{
//// try {
//// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_MM.txt"), JSON.toJSONString(v)+"\r\n", true);
//// } catch (IOException e) {
//// e.printStackTrace();
//// }
//// });
// for(int i=0;i<list1.size();i++){
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_MM.txt"), JSON.toJSONString(repaymentLoanInfoMap.get(list1.get(i)))+"\r\n", true);
// }
// List<String> list3 = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_MM.txt"), "utf-8");
// for(int i=0;i<list3.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list3.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// repaymentLoanInfo.setLoanStatus(1);
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_M1.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004.txt"), "utf-8");
// for(int i=0;i<list.size();i++){
//
// }
// List<String> list1 = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/22222"), "utf-8");
// Map<String,String> map = new HashMap<>();
// for(int i=0;i<list1.size();i++){
// String str[] = list1.get(i).split(":");
// map.put(str[0]+str[1]+str[2], str[3]);
// }
//
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004.txt"), "utf-8");
// Map<String,RepaymentLoanInfo> repaymentLoanInfoMap = new HashMap<>();
// for(int i=1;i<list.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// repaymentLoanInfoMap.put(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus()+repaymentLoanInfo.getTermNo()+repaymentLoanInfo.getOverdueStatus(), repaymentLoanInfo);
// }
// for(int i=0;i<list.size();i++){
// if(list.get(i).contains("90987526")){
// System.out.println(list.get(i));
// }
// }
//
// map.forEach((k,v)->{
// RepaymentLoanInfo repaymentLoanInfo = repaymentLoanInfoMap.get(k);
// repaymentLoanInfo.setRemainingAmount(new BigDecimal(v).setScale(2, BigDecimal.ROUND_HALF_UP));
// repaymentLoanInfo.setOpCode("M");
// try {
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_M2.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// } catch (IOException e) {
// e.printStackTrace();
// }
// });
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004.txt"), "utf-8");
// Map<String,RepaymentLoanInfo> map = new HashMap<>();
// for(int i=1;i<list.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// map.put(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus()+repaymentLoanInfo.getTermNo()+repaymentLoanInfo.getOverdueStatus(), repaymentLoanInfo);
// map.put(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus()+repaymentLoanInfo.getTermNo(), repaymentLoanInfo);
// map.put(repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus()+repaymentLoanInfo.getTermNo(), repaymentLoanInfo);
// }
// System.out.println(map.size());
//
// List<String> list1 = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/CRY/20190428/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_20190428"), "utf-8");
// for(int i=0;i<list1.size();i++){
// String tmp[] = list1.get(i).split("#");
//// RepaymentLoanInfo repaymentLoanInfo = map.get(tmp[0]+tmp[1]+tmp[2]+tmp[3]);
//// repaymentLoanInfo.setRealRepaymentDate(tmp[4]);
//// repaymentLoanInfo.setTargetRepayment(new BigDecimal(tmp[5]).setScale(2, BigDecimal.ROUND_HALF_UP));
//// repaymentLoanInfo.setRealRepayment(new BigDecimal(6).setScale(2, BigDecimal.ROUND_HALF_UP));
//// repaymentLoanInfo.setOpCode("M");
//// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/20190428/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_M3.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
//
//// RepaymentLoanInfo repaymentLoanInfo = map.get(tmp[0]+tmp[1]+tmp[2]);
//// repaymentLoanInfo.setOpCode("M");
//// repaymentLoanInfo.setLoanStatus(1);
//// repaymentLoanInfo.setRemainingAmount(new BigDecimal(tmp[3]).setScale(2, BigDecimal.ROUND_HALF_UP));
//// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/20190428/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_1.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
//
// RepaymentLoanInfo repaymentLoanInfo = map.get(tmp[0]+tmp[1]+tmp[2]);
// repaymentLoanInfo.setOpCode("M");
// repaymentLoanInfo.setLoanStatus(1);
//
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/20190428/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_2.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }
// String key = "9168549029D1";
// RepaymentLoanInfo repaymentLoanInfo = map.get(key);
// repaymentLoanInfo.setRealRepayment(new BigDecimal("2392.39").setScale(2, BigDecimal.ROUND_HALF_UP));
// repaymentLoanInfo.setOpCode("M");
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/CRY/20190430/鹰潭市信江广达小额贷款股份有限公司_D3_201904241037_0004_M4.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// List<String> list1 = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190509/tmp"), "utf-8");
// Map<String,String> map = new HashMap<>();
// for(int i=0;i<list1.size();i++){
// String tmp = list1.get(i);
// map.put(tmp, "1");
// }
//
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0008.txt"), "utf-8");
//// for(int i=0;i<list.size();i++){
//// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
//// repaymentLoanInfo.setReqID(UUID.randomUUID().toString().replaceAll("-", ""));
//// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0004.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
//// }
// for(int i=0;i<list.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
//// String key = repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getLoanStatus()+repaymentLoanInfo.getOverdueStatus()+repaymentLoanInfo.getTermNo()+"0"+repaymentLoanInfo.getStatusConfirmAt();
//// if(map.containsKey(key) && StringUtils.isBlank(repaymentLoanInfo.getRealRepaymentDate())){
//// System.out.println("包含key=="+key);
//// continue;
//// }
//
// if(repaymentLoanInfo.getLoanStatus()==3 && "overdue".equalsIgnoreCase(repaymentLoanInfo.getTermStatus())){
// System.out.println("shanchu"+repaymentLoanInfo.getLoanStatus()+"###"+repaymentLoanInfo.getTermStatus());
// continue;
// }
//
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0009.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }
// System.out.println("完事");
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0009.txt"), "utf-8");
// List<String> tmp = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190509/tmp.txt"), "utf-8");
//// Map<String,RepaymentLoanInfo> repaymentLoanInfoMap = new HashMap<>();
//
//
// Map<String,String> map = new HashMap<>();
// for(int i=0;i<tmp.size();i++){
// String tmpargs[] = tmp.get(i).split("###");
// map.put(tmpargs[0]+tmpargs[1]+tmpargs[2], tmpargs[3]);
// }
//
// for(int i=1;i<list.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// String key = repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getPlannedPayment()+repaymentLoanInfo.getTermNo();
// if(map.containsKey(key)){
// repaymentLoanInfo.setPlannedPayment(new BigDecimal(map.get(key)).setScale(2, BigDecimal.ROUND_HALF_UP));
// repaymentLoanInfo.setOpCode("M");
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0009_M.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }
// }
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019050805310101_0009.txt"), "utf-8");
// List<String> tmp = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190509/tmp.txt"), "utf-8");
//// Map<String,RepaymentLoanInfo> repaymentLoanInfoMap = new HashMap<>();
//
//
// Map<String,String> map = new HashMap<>();
// for(int i=0;i<tmp.size();i++){
// String tmpargs[] = tmp.get(i).split("###");
// map.put(tmpargs[0]+tmpargs[1]+tmpargs[2], tmpargs[3]);
// }
//
// for(int i=1;i<list.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// String key = repaymentLoanInfo.getLoanId()+repaymentLoanInfo.getPlannedPayment()+repaymentLoanInfo.getTermNo();
// if(map.containsKey(key)){
// repaymentLoanInfo.setPlannedPayment(new BigDecimal(map.get(key)).setScale(2, BigDecimal.ROUND_HALF_UP));
//// repaymentLoanInfo.setOpCode("M");
// System.out.println(JSON.toJSONString(repaymentLoanInfo));
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019052418260303_0001.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }else{
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019052418260303_0001.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }
// }
// System.out.println("wanshi");
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019052418260303_0001.txt"), "utf-8");
// for(int i=0;i<list.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
//// repaymentLoanInfo.setName(interfaceUploadClient(repaymentLoanInfo.getName()));
//// repaymentLoanInfo.setMobile(interfaceUploadClient(repaymentLoanInfo.getMobile()));
//// repaymentLoanInfo.setPid(interfaceUploadClient(repaymentLoanInfo.getPid()));
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D3_2019052418260303_0003_M.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }
// System.out.println("wanshi");
//
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_C1_2019050805310101_0001.txt"), "utf-8");
// for(int i=1;i<list.size();i++){
// ApplyLoanInfo applyLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<ApplyLoanInfo>(){}.getType());
//// applyLoanInfo.setName(interfaceUploadClient(applyLoanInfo.getName()));
//// applyLoanInfo.setMobile(interfaceUploadClient(applyLoanInfo.getMobile()));
//// applyLoanInfo.setPid(interfaceUploadClient(applyLoanInfo.getPid()));
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_C1_2019052418260303_0001_M.txt"), JSON.toJSONString(applyLoanInfo)+"\r\n", true);
// }
// System.out.println("wanshi");
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D2_2019050805310101_0001.txt"), "utf-8");
// for(int i=1;i<list.size();i++){
// LoanInfo loanInfo = new Gson().fromJson(list.get(i), new TypeToken<LoanInfo>(){}.getType());
//// loanInfo.setName(interfaceUploadClient(loanInfo.getName()));
//// loanInfo.setMobile(interfaceUploadClient(loanInfo.getMobile()));
//// loanInfo.setPid(interfaceUploadClient(loanInfo.getPid()));
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190509/鹰潭市信江广达小额贷款股份有限公司_D2_2019052418260303_0001_M.txt"), JSON.toJSONString(loanInfo)+"\r\n", true);
// }
// System.out.println("wanshi");
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Desktop/new/20190529/xinjiangguangda_D3_2019052910580303_0001.txt"), "utf-8");
// for(int i=0;i<list.size();i++){
// RepaymentLoanInfo repaymentLoanInfo = new Gson().fromJson(list.get(i), new TypeToken<RepaymentLoanInfo>(){}.getType());
// repaymentLoanInfo.setReqID(UUID.randomUUID().toString().replaceAll("-", ""));
// FileUtils.write(new File("/Users/fengjunkai/Desktop/new/20190529/xinjiangguangda_D3_2019052910580303_0002.txt"), JSON.toJSONString(repaymentLoanInfo)+"\r\n", true);
// }
// System.out.println(LocalDateTime.now().plusDays(-1).format(DateTimeFormatter.ISO_DATE));
// System.out.println(LocalDateTime.now().format(DateTimeFormatter.ISO_DATE));
// System.out.println(LocalDateTime.now().plusDays(-1).format(DateTimeFormatter.ISO_DATE));
// List<String> list = FileUtils.readLines(new File("/Users/fengjunkai/Downloads/baihang/百行2019-08-09至2019-08-10调用命中数据.txt"), "utf-8");
// for(int i=0;i<list.size();i++){
// String uuid = list.get(i);
// FileUtils.write(new File("/Users/fengjunkai/Downloads/baihang/data.txt"), uuid+"\t"+uuid+"\r\n", "utf-8", true);
// }
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
src/main/java/cn/quantgroup/report/service/baihang/ReSendBaiHangService.java
View file @
0c7340ab
...
@@ -26,7 +26,7 @@ public class ReSendBaiHangService extends BaiHangService {
...
@@ -26,7 +26,7 @@ public class ReSendBaiHangService extends BaiHangService {
*/
*/
public
void
sendLoaInfoReportToBaiHang
(
String
startTime
,
String
endTime
)
{
public
void
sendLoaInfoReportToBaiHang
(
String
startTime
,
String
endTime
)
{
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
List
<
LoanInfo
>
loanInfos
=
new
ArrayList
<>();
List
<
LoanInfo
ZhuDai
>
loanInfos
=
new
ArrayList
<>();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
try
{
Stopwatch
queryWatch
=
Stopwatch
.
createStarted
();
Stopwatch
queryWatch
=
Stopwatch
.
createStarted
();
...
@@ -34,7 +34,7 @@ public class ReSendBaiHangService extends BaiHangService {
...
@@ -34,7 +34,7 @@ public class ReSendBaiHangService extends BaiHangService {
log
.
info
(
"广达小贷TO百行放款申请报送开始, 大小: {} , 耗时: {} "
,
loanInfos
.
size
(),
queryWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
log
.
info
(
"广达小贷TO百行放款申请报送开始, 大小: {} , 耗时: {} "
,
loanInfos
.
size
(),
queryWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
for
(
int
i
=
0
;
i
<
loanInfos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
loanInfos
.
size
();
i
++)
{
LoanInfo
loanInfo
=
loanInfos
.
get
(
i
);
LoanInfo
ZhuDai
loanInfo
=
loanInfos
.
get
(
i
);
String
id
=
""
;
String
id
=
""
;
try
{
try
{
String
loanInfoReqId
=
loanInfo
.
getReqID
();
String
loanInfoReqId
=
loanInfo
.
getReqID
();
...
@@ -78,7 +78,7 @@ public class ReSendBaiHangService extends BaiHangService {
...
@@ -78,7 +78,7 @@ public class ReSendBaiHangService extends BaiHangService {
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
try
{
List
<
Repayment
LoanInfo
>
repaymentLoanInfos
=
null
;
List
<
Repayment
InfoZhuDai
>
repaymentLoanInfos
=
null
;
if
(
j
==
0
)
{
if
(
j
==
0
)
{
Stopwatch
realTimeStopWatch
=
Stopwatch
.
createStarted
();
Stopwatch
realTimeStopWatch
=
Stopwatch
.
createStarted
();
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
findRepayMentLoanInfo
(
BaiHangTimeRecord
.
builder
().
startTime
(
startTime
).
endTime
(
endTime
).
build
());
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
findRepayMentLoanInfo
(
BaiHangTimeRecord
.
builder
().
startTime
(
startTime
).
endTime
(
endTime
).
build
());
...
@@ -92,10 +92,10 @@ public class ReSendBaiHangService extends BaiHangService {
...
@@ -92,10 +92,10 @@ public class ReSendBaiHangService extends BaiHangService {
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++)
{
Repayment
LoanInfo
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
Repayment
InfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
String
id
=
""
;
String
id
=
""
;
try
{
try
{
Repayment
LoanInfo
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
build
());
Repayment
InfoZhuDai
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
build
());
if
(
j
>
0
&&
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
if
(
j
>
0
&&
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
log
.
info
(
"广达小贷TO百行征信报送实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} "
,
startTime
,
endTime
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
log
.
info
(
"广达小贷TO百行征信报送实时还款逾期跳过报送, startTime: {} , endTime: {} , bean: {} "
,
startTime
,
endTime
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
continue
;
continue
;
...
...
src/main/java/cn/quantgroup/report/service/manualTool/ManualToolService.java
View file @
0c7340ab
...
@@ -648,8 +648,8 @@ public class ManualToolService implements CommonSuperService {
...
@@ -648,8 +648,8 @@ public class ManualToolService implements CommonSuperService {
//修改D3中的reqID
//修改D3中的reqID
/*
DateFormat df_uploadTs = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
DateFormat
df_uploadTs
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
int rr = 100982
2
900;
int
rr
=
100982
3
900
;
List
<
String
>
lineList
=
ReadOrWriteTxt
.
readTxtList
(
"C:\\Users\\Administrator\\Desktop\\测试\\文件测试\\build\\tmp3.txt"
);
List
<
String
>
lineList
=
ReadOrWriteTxt
.
readTxtList
(
"C:\\Users\\Administrator\\Desktop\\测试\\文件测试\\build\\tmp3.txt"
);
for
(
int
i
=
0
;
i
<
lineList
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
lineList
.
size
();
i
++){
RepaymentInfoZhuDai
repaymentLoanInfo
=
new
Gson
().
fromJson
(
lineList
.
get
(
i
),
new
TypeToken
<
RepaymentInfoZhuDai
>(){}.
getType
());
RepaymentInfoZhuDai
repaymentLoanInfo
=
new
Gson
().
fromJson
(
lineList
.
get
(
i
),
new
TypeToken
<
RepaymentInfoZhuDai
>(){}.
getType
());
...
@@ -657,21 +657,21 @@ public class ManualToolService implements CommonSuperService {
...
@@ -657,21 +657,21 @@ public class ManualToolService implements CommonSuperService {
rr
++;
rr
++;
String
uploadTs
=
df_uploadTs
.
format
(
new
Date
());
String
uploadTs
=
df_uploadTs
.
format
(
new
Date
());
repaymentLoanInfo
.
setReqID
(
rr
+
""
);
repaymentLoanInfo
.
setReqID
(
rr
+
""
);
repaymentLoanInfo.setUploadTs(uploadTs.replace(" ","T"));
//
repaymentLoanInfo.setUploadTs(uploadTs.replace(" ","T"));
System
.
out
.
println
(
JSON
.
toJSONString
(
repaymentLoanInfo
));
System
.
out
.
println
(
JSON
.
toJSONString
(
repaymentLoanInfo
));
}
}
System.err.println(rr);
*/
System
.
err
.
println
(
rr
);
//将D2中FinTechAgencyBusinessZhuDai变成树形结构
//将D2中FinTechAgencyBusinessZhuDai变成树形结构
List
<
String
>
lineD2List
=
ReadOrWriteTxt
.
readTxtList
(
"C:\\Users\\Administrator\\Desktop\\测试\\文件测试\\build\\tmp2.txt"
);
/*
List<String> lineD2List = ReadOrWriteTxt.readTxtList("C:\\Users\\Administrator\\Desktop\\测试\\文件测试\\build\\tmp2.txt");
for(int i=0;i<lineD2List.size();i++){
for(int i=0;i<lineD2List.size();i++){
LoanInfoZhuDaiVo loanInfo = JSONObject.parseObject(lineD2List.get(i), LoanInfoZhuDaiVo.class);
LoanInfoZhuDaiVo loanInfo = JSONObject.parseObject(lineD2List.get(i), LoanInfoZhuDaiVo.class);
FinTechAgencyBusinessZhuDai finTechAgencyBusiness = JSONObject.parseObject(lineD2List.get(i), FinTechAgencyBusinessZhuDai.class);
FinTechAgencyBusinessZhuDai finTechAgencyBusiness = JSONObject.parseObject(lineD2List.get(i), FinTechAgencyBusinessZhuDai.class);
loanInfo.setFinTechAgencyBusiness(finTechAgencyBusiness);
loanInfo.setFinTechAgencyBusiness(finTechAgencyBusiness);
System.out.println(JSON.toJSONString(loanInfo));
System.out.println(JSON.toJSONString(loanInfo));
}
}
System
.
err
.
println
(
"build D2 finTechAgencyBusiness end."
);
System.err.println("build D2 finTechAgencyBusiness end.");
*/
...
...
src/main/resources/cn/quantgroup/report/mapper/baihang/LoanInfoMapper.xml
View file @
0c7340ab
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"cn.quantgroup.report.mapper.baihang.LoanInfoMapper"
>
<mapper
namespace=
"cn.quantgroup.report.mapper.baihang.LoanInfoMapper"
>
<resultMap
id=
"LoanInfoResultMap"
type=
"cn.quantgroup.report.domain.baihang.LoanInfo"
>
<resultMap
id=
"LoanInfoResultMap"
type=
"cn.quantgroup.report.domain.baihang.LoanInfo
Vo
"
>
<result
column=
"reqID"
jdbcType=
"VARCHAR"
property=
"reqID"
/>
<result
column=
"reqID"
jdbcType=
"VARCHAR"
property=
"reqID"
/>
<result
column=
"opCode"
jdbcType=
"VARCHAR"
property=
"opCode"
/>
<result
column=
"opCode"
jdbcType=
"VARCHAR"
property=
"opCode"
/>
<result
column=
"uploadTs"
jdbcType=
"VARCHAR"
property=
"uploadTs"
/>
<result
column=
"uploadTs"
jdbcType=
"VARCHAR"
property=
"uploadTs"
/>
...
...
src/main/resources/cn/quantgroup/report/mapper/baihang/RepaymentLoanInfoMapper.xml
View file @
0c7340ab
...
@@ -28,7 +28,7 @@
...
@@ -28,7 +28,7 @@
<!--实时逾期还款(百行征信报送)-->
<!--实时逾期还款(百行征信报送)-->
<select
id=
"findRepayMentLoanInfoOverdue"
<select
id=
"findRepayMentLoanInfoOverdue"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangTimeRecord"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangTimeRecord"
resultType=
"cn.quantgroup.report.domain.baihang.Repayment
LoanInfo
"
>
resultType=
"cn.quantgroup.report.domain.baihang.Repayment
InfoZhuDai
"
>
select
select
a.id reqID
a.id reqID
,'A' opCode
,'A' opCode
...
@@ -84,7 +84,7 @@
...
@@ -84,7 +84,7 @@
<!--实时还款(百行征信报送)-->
<!--实时还款(百行征信报送)-->
<select
id=
"findRepayMentLoanInfo"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangTimeRecord"
<select
id=
"findRepayMentLoanInfo"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangTimeRecord"
resultType=
"cn.quantgroup.report.domain.baihang.Repayment
LoanInfo
"
>
resultType=
"cn.quantgroup.report.domain.baihang.Repayment
InfoZhuDai
"
>
select
select
a.id reqID
a.id reqID
,'A' opCode
,'A' opCode
...
...
src/main/resources/cn/quantgroup/report/mapper/master/LoanInfoDbMapper.xml
View file @
0c7340ab
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"cn.quantgroup.report.mapper.master.LoanInfoDbMapper"
>
<mapper
namespace=
"cn.quantgroup.report.mapper.master.LoanInfoDbMapper"
>
<resultMap
id=
"LoanInfoResultMap"
type=
"cn.quantgroup.report.domain.baihang.LoanInfo"
>
<resultMap
id=
"LoanInfoResultMap"
type=
"cn.quantgroup.report.domain.baihang.LoanInfo
ZhuDai
"
>
<result
column=
"recordId"
jdbcType=
"VARCHAR"
property=
"record_id"
/>
<result
column=
"recordId"
jdbcType=
"VARCHAR"
property=
"record_id"
/>
<result
column=
"reqID"
jdbcType=
"VARCHAR"
property=
"req_id"
/>
<result
column=
"reqID"
jdbcType=
"VARCHAR"
property=
"req_id"
/>
<result
column=
"opCode"
jdbcType=
"VARCHAR"
property=
"op_Code"
/>
<result
column=
"opCode"
jdbcType=
"VARCHAR"
property=
"op_Code"
/>
...
@@ -26,19 +26,27 @@
...
@@ -26,19 +26,27 @@
<result
column=
"gracePeriod"
jdbcType=
"INTEGER"
property=
"grace_period"
/>
<result
column=
"gracePeriod"
jdbcType=
"INTEGER"
property=
"grace_period"
/>
</resultMap>
</resultMap>
<select
id=
"saveLoanInfoRecordLog"
parameterType=
"cn.quantgroup.report.domain.baihang.LoanInfo"
>
<select
id=
"saveLoanInfoRecordLog"
parameterType=
"cn.quantgroup.report.domain.baihang.LoanInfoZhuDai"
>
insert into loan_info (record_id, req_id, name, pid,mobile,op_Code,upload_ts,loan_id,guarantee_type,loan_purpose,apply_date,account_open_date,
<!--
insert into loan_info_zhudai (record_id, req_id, name, pid,mobile,op_Code,upload_ts,loan_id,guarantee_type,loan_purpose,apply_date,account_open_date,
issue_date,due_date,loan_amount,total_term,target_repay_date_type,term_period,first_repayment_date,grace_period)
issue_date,due_date,loan_amount,total_term,target_repay_date_type,term_period,first_repayment_date,grace_period)
VALUES (#{recordId},#{reqID},#{name},#{pid},#{mobile},#{opCode},#{uploadTs},#{loanId},#{guaranteeType},#{loanPurpose},#{applyDate}
VALUES (#{recordId},#{reqID},#{name},#{pid},#{mobile},#{opCode},#{uploadTs},#{loanId},#{guaranteeType},#{loanPurpose},#{applyDate}
,#{accountOpenDate},#{issueDate},#{dueDate},#{loanAmount},#{totalTerm},#{targetRepayDateType},#{termPeriod},#{firstRepaymentDate},#{gracePeriod})
,#{accountOpenDate},#{issueDate},#{dueDate},#{loanAmount},#{totalTerm},#{targetRepayDateType},#{termPeriod},#{firstRepaymentDate},#{gracePeriod})*/
-->
insert into loan_info_zhudai (record_id, req_id, name, pid,mobile,op_Code,upload_ts,loan_id,guarantee_type,loan_purpose,apply_date,account_open_date,
issue_date,due_date,loan_amount,total_term,target_repay_date_type,term_period,first_repayment_date,grace_period,
institutional_funding_partner,institutional_funding_partner_id,institutional_funding_partner_loan_id,relation_id,order_id,pre_credit_limit)
VALUES (#{recordId},#{reqID},#{name},#{pid},#{mobile},#{opCode},#{uploadTs},#{loanId},#{guaranteeType},#{loanPurpose},#{applyDate},
#{accountOpenDate},#{issueDate},#{dueDate},#{loanAmount},#{totalTerm},#{targetRepayDateType},#{termPeriod},#{firstRepaymentDate},#{gracePeriod},
#{institutionalFundingPartner},#{institutionalFundingPartnerID},#{institutionalFundingPartnerLoanID},#{relationID},#{orderID},#{preCreditLimit})
</select>
</select>
<update
id=
"updateCurrentRecordEnableFalce"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord"
>
<update
id=
"updateCurrentRecordEnableFalce"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord"
>
update loan_info set enable = #{enable, jdbcType=VARCHAR} where record_id = #{recordId, jdbcType=VARCHAR};
update loan_info
_zhudai
set enable = #{enable, jdbcType=VARCHAR} where record_id = #{recordId, jdbcType=VARCHAR};
</update>
</update>
<select
id=
"findAll"
resultMap=
"LoanInfoResultMap"
>
<select
id=
"findAll"
resultMap=
"LoanInfoResultMap"
>
select * from loan_info where enable = false;
select * from loan_info
_zhudai
where enable = false;
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
src/main/resources/cn/quantgroup/report/mapper/master/RepaymentLoanInfoDbMapper.xml
View file @
0c7340ab
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<mapper
namespace=
"cn.quantgroup.report.mapper.master.RepaymentLoanInfoDbMapper"
>
<mapper
namespace=
"cn.quantgroup.report.mapper.master.RepaymentLoanInfoDbMapper"
>
<resultMap
id=
"RepaymetnLoanInfoResultMap"
type=
"cn.quantgroup.report.domain.baihang.Repayment
LoanInfo
"
>
<resultMap
id=
"RepaymetnLoanInfoResultMap"
type=
"cn.quantgroup.report.domain.baihang.Repayment
InfoZhuDai
"
>
<result
column=
"reqID"
jdbcType=
"VARCHAR"
property=
"req_id"
/>
<result
column=
"reqID"
jdbcType=
"VARCHAR"
property=
"req_id"
/>
<result
column=
"recordId"
jdbcType=
"VARCHAR"
property=
"record_id"
/>
<result
column=
"recordId"
jdbcType=
"VARCHAR"
property=
"record_id"
/>
<result
column=
"opCode"
jdbcType=
"VARCHAR"
property=
"op_code"
/>
<result
column=
"opCode"
jdbcType=
"VARCHAR"
property=
"op_code"
/>
...
@@ -54,9 +54,9 @@
...
@@ -54,9 +54,9 @@
</resultMap>
</resultMap>
<select
id=
"saveRepaymentLoanInfoLog"
parameterType=
"cn.quantgroup.report.domain.baihang.Repayment
LoanInfo"
resultType=
"cn.quantgroup.report.domain.baihang.RepaymentLoanInfo
"
>
<select
id=
"saveRepaymentLoanInfoLog"
parameterType=
"cn.quantgroup.report.domain.baihang.Repayment
InfoZhuDai"
resultType=
"cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai
"
>
insert into
insert into
repayment_loan_info
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)
(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 (#{recordId, jdbcType=VARCHAR},#{reqID, jdbcType=VARCHAR},#{name, jdbcType=VARCHAR},#{pid, jdbcType=VARCHAR},#{mobile, jdbcType=VARCHAR},#{opCode, jdbcType=VARCHAR},
values (#{recordId, jdbcType=VARCHAR},#{reqID, jdbcType=VARCHAR},#{name, jdbcType=VARCHAR},#{pid, jdbcType=VARCHAR},#{mobile, jdbcType=VARCHAR},#{opCode, jdbcType=VARCHAR},
#{uploadTs, jdbcType=VARCHAR},#{loanId, jdbcType=VARCHAR},#{termNo, jdbcType=INTEGER},#{termStatus, jdbcType=INTEGER},#{targetRepaymentDate, jdbcType=VARCHAR},#{realRepaymentDate, jdbcType=VARCHAR},
#{uploadTs, jdbcType=VARCHAR},#{loanId, jdbcType=VARCHAR},#{termNo, jdbcType=INTEGER},#{termStatus, jdbcType=INTEGER},#{targetRepaymentDate, jdbcType=VARCHAR},#{realRepaymentDate, jdbcType=VARCHAR},
...
@@ -65,21 +65,21 @@
...
@@ -65,21 +65,21 @@
</select>
</select>
<update
id=
"updateCurrentRecordEnableFalse"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord"
>
<update
id=
"updateCurrentRecordEnableFalse"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangUpDateRecord"
>
update repayment_loan_info set enable = #{enable, jdbcType=VARCHAR}, updated_at = CURRENT_TIMESTAMP() where record_id = #{recordId, jdbcType=VARCHAR};
update repayment_loan_info
_zhudai
set enable = #{enable, jdbcType=VARCHAR}, updated_at = CURRENT_TIMESTAMP() where record_id = #{recordId, jdbcType=VARCHAR};
</update>
</update>
<select
id=
"findAll"
resultMap=
"RepaymetnLoanInfoResultMap"
>
<select
id=
"findAll"
resultMap=
"RepaymetnLoanInfoResultMap"
>
select * from repayment_loan_info where enable = false;
select * from repayment_loan_info
_zhudai
where enable = false;
</select>
</select>
<select
id=
"findLastOne"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangRepayment"
resultType=
"cn.quantgroup.report.domain.baihang.Repayment
LoanInfo
"
>
<select
id=
"findLastOne"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangRepayment"
resultType=
"cn.quantgroup.report.domain.baihang.Repayment
InfoZhuDai
"
>
select * from repayment_loan_info where loan_id = #{loanId} and term_no = #{termNo} limit 1;
select * from repayment_loan_info
_zhudai
where loan_id = #{loanId} and term_no = #{termNo} limit 1;
</select>
</select>
<!--根据日志中的reqID查询loan_id及还款信息 2019.09.25-->
<!--根据日志中的reqID查询loan_id及还款信息 2019.09.25-->
<select
id=
"findByRecordId"
resultMap=
"RepaymentLoanInfoVoResultMapByBS"
>
<select
id=
"findByRecordId"
resultMap=
"RepaymentLoanInfoVoResultMapByBS"
>
SELECT * from repayment_loan_info
SELECT * from repayment_loan_info
_zhudai
WHERE op_code='A' and record_id IN
WHERE op_code='A' and record_id IN
<foreach
collection=
"array"
item=
"recordId"
index=
"index"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"array"
item=
"recordId"
index=
"index"
open=
"("
close=
")"
separator=
","
>
#{recordId}
#{recordId}
...
...
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