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
049870b0
Commit
049870b0
authored
Nov 13, 2019
by
郝彦辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A1,D2格式校验错误修改。
parent
4e653ae8
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
485 additions
and
22 deletions
+485
-22
ExZhuDaiBaiHangReSendController.java
.../controller/external/ExZhuDaiBaiHangReSendController.java
+44
-0
BaiHangZhuDaiService.java
...antgroup/report/service/baihang/BaiHangZhuDaiService.java
+134
-14
TuoMinUtils.java
...n/quantgroup/report/service/baihang/util/TuoMinUtils.java
+59
-1
ManualToolService.java
...antgroup/report/service/manualTool/ManualToolService.java
+248
-7
No files found.
src/main/java/cn/quantgroup/report/controller/external/ExZhuDaiBaiHangReSendController.java
View file @
049870b0
...
@@ -2,6 +2,11 @@ package cn.quantgroup.report.controller.external;
...
@@ -2,6 +2,11 @@ package cn.quantgroup.report.controller.external;
import
cn.quantgroup.report.response.GlobalResponse
;
import
cn.quantgroup.report.response.GlobalResponse
;
import
cn.quantgroup.report.service.baihang.BaiHangZhuDaiService
;
import
cn.quantgroup.report.service.baihang.BaiHangZhuDaiService
;
import
cn.quantgroup.report.utils.ReadOrWriteTxt
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -9,8 +14,11 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -9,8 +14,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.File
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* 百行征信报送出现错误的贷款记录信息重新报送
* 百行征信报送出现错误的贷款记录信息重新报送
...
@@ -247,4 +255,40 @@ public class ExZhuDaiBaiHangReSendController {
...
@@ -247,4 +255,40 @@ public class ExZhuDaiBaiHangReSendController {
}
}
}
}
@RequestMapping
(
"/test/bulidD2"
)
public
GlobalResponse
bulidD2
(
String
jsonFile
){
try
{
String
sourceStr
=
FileUtils
.
readFileToString
(
new
File
(
jsonFile
),
"utf-8"
);
JSONObject
sourceJson
=
JSON
.
parseObject
(
sourceStr
);
JSONArray
recordsJsonArr
=
sourceJson
.
getJSONArray
(
"RECORDS"
);
List
<
String
>
lineList
=
new
ArrayList
<>(
recordsJsonArr
.
size
());
for
(
int
i
=
0
;
i
<
recordsJsonArr
.
size
();
i
++){
lineList
.
add
(
recordsJsonArr
.
get
(
i
).
toString
());
}
baiHangZhuDaiService
.
sendHandLoaInfoReportToBaiHang
(
false
,
lineList
);
return
GlobalResponse
.
generate
(
"百行征信助贷模式手动报送D2数据成功"
);
}
catch
(
Exception
e
){
log
.
error
(
"百行征信助贷模式报送放款异常"
,
e
);
return
GlobalResponse
.
generate
(
"百行征信助贷模式手动报送D2数据失败"
);
}
}
@RequestMapping
(
"/test/bulidA1"
)
public
GlobalResponse
bulidA1
(
String
jsonFile
){
try
{
List
<
String
>
lineList
=
ReadOrWriteTxt
.
readTxtList
(
"D:\\用户目录\\Downloads\\A1_M.txt"
);
System
.
out
.
println
(
"lineList:"
+
lineList
.
size
());
baiHangZhuDaiService
.
build_A1
(
lineList
);
return
GlobalResponse
.
generate
(
"百行征信助贷模式手动报送D2数据成功"
);
}
catch
(
Exception
e
){
log
.
error
(
"百行征信助贷模式报送放款异常"
,
e
);
return
GlobalResponse
.
generate
(
"百行征信助贷模式手动报送D2数据失败"
);
}
}
}
}
src/main/java/cn/quantgroup/report/service/baihang/BaiHangZhuDaiService.java
View file @
049870b0
...
@@ -193,6 +193,11 @@ public class BaiHangZhuDaiService {
...
@@ -193,6 +193,11 @@ public class BaiHangZhuDaiService {
applyLoanInfo
.
setName
(
interfaceUploadClient
(
applyLoanInfo
.
getName
()));
applyLoanInfo
.
setName
(
interfaceUploadClient
(
applyLoanInfo
.
getName
()));
applyLoanInfo
.
setMobile
(
interfaceUploadClient
(
applyLoanInfo
.
getMobile
()));
applyLoanInfo
.
setMobile
(
interfaceUploadClient
(
applyLoanInfo
.
getMobile
()));
applyLoanInfo
.
setPid
(
interfaceUploadClient
(
applyLoanInfo
.
getPid
()));
applyLoanInfo
.
setPid
(
interfaceUploadClient
(
applyLoanInfo
.
getPid
()));
//邮箱有错误的就不传
if
(!
TuoMinUtils
.
checkEmail
(
applyLoanInfo
.
getEmailAddress
())){
applyLoanInfo
.
setEmailAddress
(
null
);
}
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangApplyLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
applyLoanInfo
));
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangApplyLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
applyLoanInfo
));
log
.
info
(
"助贷贷款申请A1报送结果, param: {} , resultStr: {} "
,
JSON
.
toJSONString
(
applyLoanInfo
),
resultStr
);
log
.
info
(
"助贷贷款申请A1报送结果, param: {} , resultStr: {} "
,
JSON
.
toJSONString
(
applyLoanInfo
),
resultStr
);
//if (Objects.isNull(resultStr) || !(resultStr.contains("queryHistory") && resultStr.contains("nonRevolvingLoan") && resultStr.contains("revolvingLoan"))) {
//if (Objects.isNull(resultStr) || !(resultStr.contains("queryHistory") && resultStr.contains("nonRevolvingLoan") && resultStr.contains("revolvingLoan"))) {
...
@@ -241,20 +246,34 @@ public class BaiHangZhuDaiService {
...
@@ -241,20 +246,34 @@ public class BaiHangZhuDaiService {
String
id
=
""
;
String
id
=
""
;
try
{
try
{
String
loanInfoReqId
=
loanInfozd_tmp
.
getReqID
();
String
loanInfoReqId
=
loanInfozd_tmp
.
getReqID
();
if
(
loanInfozd_tmp
.
getTotalTerm
()
>
1
)
{
/* if (loanInfozd_tmp.getTotalTerm() > 1) {
List<String> targetRepaymentDayList = loanInfoMapper.findTargetRepaymentDayList(loanInfoReqId);
loanInfozd_tmp.setTargetRepayDateList(String.join(",", targetRepaymentDayList));
}*/
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
if
(
targetRepaymentDayList
!=
null
&&
targetRepaymentDayList
.
size
()>
0
){
loanInfozd_tmp
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
loanInfozd_tmp
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
log
.
info
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfozd_tmp
.
getTotalTerm
()+
",targetRepaymentDayList size="
+
targetRepaymentDayList
.
size
());
}
else
{
log
.
warn
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfozd_tmp
.
getTotalTerm
()+
",targetRepaymentDayList is null."
);
}
}
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
if
(
relationID
!=
null
){
if
(
relationID
!=
null
){
if
(
relationID
.
length
()>
36
){
//长度[1,
2
6]
if
(
relationID
.
length
()>
36
){
//长度[1,
3
6]
//lhp_1911049771615765816566b49a2db1c429
//lhp_1911049771615765816566b49a2db1c429
if
(
relationID
.
startsWith
(
"lhp_"
)){
if
(
relationID
.
startsWith
(
"lhp_"
)){
loanInfozd_tmp
.
setRelationID
(
relationID
.
replace
(
"lhp_"
,
"L"
));
String
tmp
=
relationID
.
substring
(
4
,
relationID
.
length
());
if
(
tmp
.
length
()>
35
){
//lhp_1909279744718808613622e008da4c110000
loanInfozd_tmp
.
setRelationID
(
"H"
+
tmp
.
substring
(
0
,
35
));
}
else
{
loanInfozd_tmp
.
setRelationID
(
"L"
+
tmp
);
}
}
else
{
}
else
{
log
.
error
(
"量化派助贷TO百行报送-放款返回结果不正确, 发现其他类型的relationID并且长度大于36,relationID="
+
relationID
+
",loanId="
+
loanInfozd_tmp
.
getLoanId
());
log
.
error
(
"量化派助贷TO百行报送-放款返回结果不正确, 发现其他类型的relationID并且长度大于36,relationID="
+
relationID
+
",loanId="
+
loanInfozd_tmp
.
getLoanId
());
continue
;
//continue;
loanInfozd_tmp
.
setRelationID
(
"X"
+
relationID
.
substring
(
0
,
35
));
}
}
}
}
}
}
...
@@ -413,6 +432,12 @@ public class BaiHangZhuDaiService {
...
@@ -413,6 +432,12 @@ public class BaiHangZhuDaiService {
applyInfo
.
setName
(
interfaceUploadClient
(
applyInfo
.
getName
()));
applyInfo
.
setName
(
interfaceUploadClient
(
applyInfo
.
getName
()));
applyInfo
.
setMobile
(
interfaceUploadClient
(
applyInfo
.
getMobile
()));
applyInfo
.
setMobile
(
interfaceUploadClient
(
applyInfo
.
getMobile
()));
applyInfo
.
setPid
(
interfaceUploadClient
(
applyInfo
.
getPid
()));
applyInfo
.
setPid
(
interfaceUploadClient
(
applyInfo
.
getPid
()));
//邮箱有错误的就不传
if
(!
TuoMinUtils
.
checkEmail
(
applyInfo
.
getEmailAddress
())){
applyInfo
.
setEmailAddress
(
null
);
}
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangApplyLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
applyInfo
));
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangApplyLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
applyInfo
));
/*if (Objects.isNull(resultStr) || !(resultStr.contains("queryHistory") && resultStr.contains("nonRevolvingLoan") && resultStr.contains("revolvingLoan"))) {
/*if (Objects.isNull(resultStr) || !(resultStr.contains("queryHistory") && resultStr.contains("nonRevolvingLoan") && resultStr.contains("revolvingLoan"))) {
log.info("量化派助贷TO百行报送-贷款申请返回结果不正确, loanId: {} ", applyInfo.getLoanId());
log.info("量化派助贷TO百行报送-贷款申请返回结果不正确, loanId: {} ", applyInfo.getLoanId());
...
@@ -452,20 +477,37 @@ public class BaiHangZhuDaiService {
...
@@ -452,20 +477,37 @@ public class BaiHangZhuDaiService {
log
.
info
(
"众信利民助贷模式TO百行手动报送放款单个数据, {}"
,
JSON
.
toJSONString
(
loanInfozd_tmp
));
log
.
info
(
"众信利民助贷模式TO百行手动报送放款单个数据, {}"
,
JSON
.
toJSONString
(
loanInfozd_tmp
));
String
loanInfoReqId
=
loanInfozd_tmp
.
getReqID
();
String
loanInfoReqId
=
loanInfozd_tmp
.
getReqID
();
if
(
loanInfozd_tmp
.
getTotalTerm
()
>
1
){
/*if(loanInfozd_tmp.getTotalTerm() > 1){
List<String> targetRepaymentDayList = loanInfoMapper.findTargetRepaymentDayList(loanInfoReqId);
loanInfozd_tmp.setTargetRepayDateList(String.join(",", targetRepaymentDayList));
System.out.println("比较还款总期数&账单日列表totalTerm="+loanInfozd_tmp.getTotalTerm()+",targetRepaymentDayList size="+targetRepaymentDayList.size());
}else{
System.err.println("比较还款总期数&账单日列表totalTerm="+loanInfozd_tmp.getTotalTerm());
}*/
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
if
(
targetRepaymentDayList
!=
null
&&
targetRepaymentDayList
.
size
()>
0
){
loanInfozd_tmp
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
loanInfozd_tmp
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
log
.
info
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfozd_tmp
.
getTotalTerm
()+
",targetRepaymentDayList size="
+
targetRepaymentDayList
.
size
());
}
else
{
log
.
warn
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfozd_tmp
.
getTotalTerm
()+
",targetRepaymentDayList is null."
);
}
}
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
if
(
relationID
!=
null
){
if
(
relationID
!=
null
){
if
(
relationID
.
length
()>
36
){
//长度[1,2
6]
if
(
relationID
.
length
()>
36
){
//长度[1,3
6]
//lhp_1911049771615765816566b49a2db1c429
//lhp_1911049771615765816566b49a2db1c429
if
(
relationID
.
startsWith
(
"lhp_"
)){
if
(
relationID
.
startsWith
(
"lhp_"
)){
loanInfozd_tmp
.
setRelationID
(
relationID
.
replace
(
"lhp_"
,
"L"
));
String
tmp
=
relationID
.
substring
(
4
,
relationID
.
length
());
if
(
tmp
.
length
()>
35
){
//lhp_1909279744718808613622e008da4c110000
loanInfozd_tmp
.
setRelationID
(
"H"
+
tmp
.
substring
(
0
,
35
));
}
else
{
loanInfozd_tmp
.
setRelationID
(
"L"
+
tmp
);
}
}
else
{
}
else
{
log
.
error
(
"众信利民助贷模式TO百行手动报送-数据不正确, 发现其他类型的relationID并且长度大于36,relationID="
+
relationID
+
",loanId="
+
loanInfozd_tmp
.
getLoanId
());
log
.
error
(
"众信利民助贷模式TO百行手动报送-数据不正确, 发现其他类型的relationID并且长度大于36,relationID="
+
relationID
+
",loanId="
+
loanInfozd_tmp
.
getLoanId
());
continue
;
//continue;
loanInfozd_tmp
.
setRelationID
(
"X"
+
relationID
.
substring
(
0
,
35
));
}
}
}
}
}
}
...
@@ -489,6 +531,24 @@ public class BaiHangZhuDaiService {
...
@@ -489,6 +531,24 @@ 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
);
//存量测试手动整理
/*loanInfozd_tmp.setRecordId(null);
String jsonStr = JSONObject.toJSONString(loanInfozd_tmp);
LoanInfoZhuDaiVo loanInfoZhuDaiVo = JSONObject.parseObject(jsonStr, LoanInfoZhuDaiVo.class);
FinTechAgencyBusinessZhuDai finTechAgencyBusiness = JSONObject.parseObject(jsonStr, FinTechAgencyBusinessZhuDai.class);
loanInfoZhuDaiVo.setFinTechAgencyBusiness(finTechAgencyBusiness);
String id = UUID.randomUUID().toString().replaceAll("-", "");
loanInfoZhuDaiVo.setReqID(id);
try {
FileUtils.write(new File("D:\\用户目录\\Downloads\\build_D2_01_M.txt"), JSON.toJSONString(loanInfoZhuDaiVo)+"\r\n", "UTF-8", true);
//脱敏数据写一份
testTuoMinFileWrite("D:\\用户目录\\Downloads\\build_D2_TEST_01_M.txt","20101113",null,loanInfoZhuDaiVo,null);
} catch (Exception e) {
log.error("放款存量数据处理异常, startTime: {} , endTime: {} , recordId: {} , loanId: {} ",null, null, id, loanInfoZhuDaiVo.getLoanId(), e);
}*/
}
}
log
.
info
(
"众信利民助贷模式TO百行手动报送放款记录结束, 大小: {} , 耗时: {} "
,
handLoanInfos
.
size
(),
((
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
));
log
.
info
(
"众信利民助贷模式TO百行手动报送放款记录结束, 大小: {} , 耗时: {} "
,
handLoanInfos
.
size
(),
((
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)/
1000
)+
".s"
));
}
}
...
@@ -613,7 +673,12 @@ public class BaiHangZhuDaiService {
...
@@ -613,7 +673,12 @@ public class BaiHangZhuDaiService {
try
{
try
{
ApplyLoanInfoZhuDai
applyLoanInfo
=
applyLoanInfoList
.
get
(
i
);
ApplyLoanInfoZhuDai
applyLoanInfo
=
applyLoanInfoList
.
get
(
i
);
applyLoanInfo
.
setUploadTs
(
upladTs
);
applyLoanInfo
.
setUploadTs
(
upladTs
);
applyLoanInfo
.
setReqID
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
//???
applyLoanInfo
.
setReqID
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
//邮箱有错误的就不传
if
(!
TuoMinUtils
.
checkEmail
(
applyLoanInfo
.
getEmailAddress
())){
applyLoanInfo
.
setEmailAddress
(
null
);
}
FileUtils
.
write
(
new
File
(
fileName
+
"_01.txt"
),
JSON
.
toJSONString
(
applyLoanInfo
)+
"\r\n"
,
"UTF-8"
,
true
);
FileUtils
.
write
(
new
File
(
fileName
+
"_01.txt"
),
JSON
.
toJSONString
(
applyLoanInfo
)+
"\r\n"
,
"UTF-8"
,
true
);
...
@@ -700,15 +765,23 @@ public class BaiHangZhuDaiService {
...
@@ -700,15 +765,23 @@ public class BaiHangZhuDaiService {
if
(
listSize
>
0
){
if
(
listSize
>
0
){
for
(
int
i
=
0
;
i
<
listSize
;
i
++)
{
for
(
int
i
=
0
;
i
<
listSize
;
i
++)
{
LoanInfoZhuDai
loanInfozd_tmp
=
loanInfozdList
.
get
(
i
);
LoanInfoZhuDai
loanInfozd_tmp
=
loanInfozdList
.
get
(
i
);
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
String
relationID
=
loanInfozd_tmp
.
getRelationID
();
if
(
relationID
!=
null
){
if
(
relationID
!=
null
){
if
(
relationID
.
length
()>
36
){
//长度[1,
2
6]
if
(
relationID
.
length
()>
36
){
//长度[1,
3
6]
//lhp_1911049771615765816566b49a2db1c429
//lhp_1911049771615765816566b49a2db1c429
if
(
relationID
.
startsWith
(
"lhp_"
)){
if
(
relationID
.
startsWith
(
"lhp_"
)){
loanInfozd_tmp
.
setRelationID
(
relationID
.
replace
(
"lhp_"
,
"L"
));
String
tmp
=
relationID
.
substring
(
4
,
relationID
.
length
());
if
(
tmp
.
length
()>
35
){
//lhp_1909279744718808613622e008da4c110000
loanInfozd_tmp
.
setRelationID
(
"H"
+
tmp
.
substring
(
0
,
35
));
}
else
{
loanInfozd_tmp
.
setRelationID
(
"L"
+
tmp
);
}
}
else
{
}
else
{
log
.
error
(
"量化派助贷TO百行报送-放款返回结果不正确, 发现其他类型的relationID并且长度大于36,relationID: {} , startTime: {} , endTime: {} , loanId: {} "
,
relationID
,
starTime
,
endTime
,
loanInfozd_tmp
.
getLoanId
());
log
.
error
(
"量化派助贷TO百行报送-放款返回结果不正确, 发现其他类型的relationID并且长度大于36,relationID: {} , startTime: {} , endTime: {} , loanId: {} "
,
relationID
,
starTime
,
endTime
,
loanInfozd_tmp
.
getLoanId
());
continue
;
//continue;
loanInfozd_tmp
.
setRelationID
(
"X"
+
relationID
.
substring
(
0
,
35
));
}
}
}
}
}
}
...
@@ -722,10 +795,19 @@ public class BaiHangZhuDaiService {
...
@@ -722,10 +795,19 @@ public class BaiHangZhuDaiService {
String
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
String
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
try
{
try
{
String
loanInfoReqId
=
loanInfoZhuDaiVo
.
getReqID
();
String
loanInfoReqId
=
loanInfoZhuDaiVo
.
getReqID
();
if
(
loanInfoZhuDaiVo
.
getTotalTerm
()
>
1
)
{
/*if (loanInfoZhuDaiVo.getTotalTerm() > 1) {
List<String> targetRepaymentDayList = loanInfoMapper.findTargetRepaymentDayList(loanInfoReqId);
loanInfoZhuDaiVo.setTargetRepayDateList(String.join(",", targetRepaymentDayList));
}*/
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
if
(
targetRepaymentDayList
!=
null
&&
targetRepaymentDayList
.
size
()>
0
){
loanInfoZhuDaiVo
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
loanInfoZhuDaiVo
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
log
.
info
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfoZhuDaiVo
.
getTotalTerm
()+
",targetRepaymentDayList size="
+
targetRepaymentDayList
.
size
());
}
else
{
log
.
warn
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfoZhuDaiVo
.
getTotalTerm
()+
",targetRepaymentDayList is null."
);
}
}
loanInfoZhuDaiVo
.
setReqID
(
id
);
loanInfoZhuDaiVo
.
setReqID
(
id
);
FileUtils
.
write
(
new
File
(
fileName
+
"_01.txt"
),
JSON
.
toJSONString
(
loanInfoZhuDaiVo
)+
"\r\n"
,
"UTF-8"
,
true
);
FileUtils
.
write
(
new
File
(
fileName
+
"_01.txt"
),
JSON
.
toJSONString
(
loanInfoZhuDaiVo
)+
"\r\n"
,
"UTF-8"
,
true
);
...
@@ -1143,9 +1225,16 @@ public class BaiHangZhuDaiService {
...
@@ -1143,9 +1225,16 @@ public class BaiHangZhuDaiService {
String
id
=
""
;
String
id
=
""
;
try
{
try
{
String
loanInfoReqId
=
loanInfo
.
getReqID
();
String
loanInfoReqId
=
loanInfo
.
getReqID
();
if
(
loanInfo
.
getTotalTerm
()
>
1
)
{
/* if (loanInfo.getTotalTerm() > 1) {
List<String> targetRepaymentDayList = loanInfoMapper.findTargetRepaymentDayList(loanInfoReqId);
loanInfo.setTargetRepayDateList(String.join(",", targetRepaymentDayList));
}*/
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
if
(
targetRepaymentDayList
!=
null
&&
targetRepaymentDayList
.
size
()>
0
){
loanInfo
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
loanInfo
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
log
.
info
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfo
.
getTotalTerm
()+
",targetRepaymentDayList size="
+
targetRepaymentDayList
.
size
());
}
else
{
log
.
warn
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfo
.
getTotalTerm
()+
",targetRepaymentDayList is null."
);
}
}
/*UUID loanInfoId = UUID.randomUUID();
/*UUID loanInfoId = UUID.randomUUID();
...
@@ -1450,4 +1539,35 @@ public class BaiHangZhuDaiService {
...
@@ -1450,4 +1539,35 @@ public class BaiHangZhuDaiService {
log
.
info
(
"All还款||逾期整理结束, 大小: {} , 总耗时: {} "
,
recordsJsonArr
.
size
(),
((
System
.
currentTimeMillis
()
-
log_stUtc
)
/
1000
)
+
".s"
);
log
.
info
(
"All还款||逾期整理结束, 大小: {} , 总耗时: {} "
,
recordsJsonArr
.
size
(),
((
System
.
currentTimeMillis
()
-
log_stUtc
)
/
1000
)
+
".s"
);
return
"百行-助贷还款整理结束"
;
return
"百行-助贷还款整理结束"
;
}
}
public
void
build_A1
(
List
<
String
>
lineList
)
throws
IOException
{
log
.
info
(
"lineList:"
+
lineList
.
size
());
for
(
int
i
=
0
;
i
<
lineList
.
size
();
i
++){
String
str
=
lineList
.
get
(
i
);
if
(
str
.
startsWith
(
"----------"
)){
log
.
info
(
str
);
continue
;
}
ApplyLoanInfoZhuDai
applyInfo
=
new
Gson
().
fromJson
(
str
,
new
TypeToken
<
ApplyLoanInfoZhuDai
>(){}.
getType
());
log
.
info
(
"众信利民助贷模式TO百行手动报送申请单个数据, {}"
,
JSON
.
toJSONString
(
applyInfo
));
String
emailAddress
=
applyInfo
.
getEmailAddress
();
if
(
TuoMinUtils
.
checkEmail
(
emailAddress
)){
log
.
error
(
"emailAddress="
+
emailAddress
+
" is ok."
);
}
else
{
applyInfo
.
setEmailAddress
(
""
);
log
.
warn
(
"emailAddress="
+
emailAddress
+
" is error."
);
}
try
{
FileUtils
.
write
(
new
File
(
"D:\\用户目录\\Downloads\\build_A1_TEST_01_M.txt"
),
JSON
.
toJSONString
(
applyInfo
)+
"\r\n"
,
"UTF-8"
,
true
);
//脱敏数据写一份
//testTuoMinFileWrite("D:\\用户目录\\Downloads\\build_A1_TEST_01_M.txt",null,applyInfo,null,null);
}
catch
(
Exception
e
)
{
log
.
error
(
"申请存量数据处理异常, startTime: {} , endTime: {} "
,
null
,
null
,
e
);
}
}
log
.
info
(
"处理A1结束"
);
}
}
}
src/main/java/cn/quantgroup/report/service/baihang/util/TuoMinUtils.java
View file @
049870b0
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -5,6 +5,7 @@ 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
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.tools.ant.Project
;
import
org.apache.tools.ant.Project
;
import
org.apache.tools.ant.taskdefs.Expand
;
import
org.apache.tools.ant.taskdefs.Expand
;
import
org.apache.tools.ant.taskdefs.Zip
;
import
org.apache.tools.ant.taskdefs.Zip
;
...
@@ -14,6 +15,8 @@ import java.io.File;
...
@@ -14,6 +15,8 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.Random
;
import
java.util.Random
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
public
class
TuoMinUtils
{
public
class
TuoMinUtils
{
...
@@ -72,6 +75,46 @@ public class TuoMinUtils {
...
@@ -72,6 +75,46 @@ public class TuoMinUtils {
}
}
public
static
boolean
checkEmail
(
String
email
)
{
//电子邮件
if
(
StringUtils
.
isBlank
(
email
)){
return
false
;
}
String
regex
=
"^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9]+(-[a-z0-9]+)?\\.)+[a-z]{2,}$"
;
//"^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"
//"^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$"
//"^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$"
boolean
b1
=
Pattern
.
compile
(
regex
).
matcher
(
email
).
matches
();
//email.matches(email);
String
ends
=
""
;
if
(
email
.
contains
(
"@"
)){
ends
=
email
.
substring
(
email
.
lastIndexOf
(
"@"
),
email
.
length
());
}
boolean
b2
=
Pattern
.
compile
(
"\\s+"
).
matcher
(
ends
).
find
();;
String
regex2
=
".*[A-Z]+.*"
;
//"[A-Z]*"
boolean
b3
=
Pattern
.
compile
(
regex2
).
matcher
(
ends
).
matches
();
return
b1
&&
!
b2
&&
!
b3
;
}
//判断Email合法性
public
static
boolean
isEmail
(
String
email
)
{
if
(
email
==
null
)
return
false
;
String
rule
=
"[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?"
;
Pattern
pattern
=
Pattern
.
compile
(
rule
);
Matcher
matcher
=
pattern
.
matcher
(
email
);
if
(
matcher
.
matches
())
return
true
;
else
return
false
;
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
//System.out.println(random_name("郝彦辉"));
//System.out.println(random_name("郝彦辉"));
...
@@ -80,7 +123,7 @@ public class TuoMinUtils {
...
@@ -80,7 +123,7 @@ public class TuoMinUtils {
// System.out.println(random_mobile("18010105506"));
// System.out.println(random_mobile("18010105506"));
String
readAddr
=
"E:\\桌面_工作\\数据备份\\201911061315贷款申请关联用户.json"
;
/*
String readAddr = "E:\\桌面_工作\\数据备份\\201911061315贷款申请关联用户.json";
String writeAddr = "E:\\桌面_工作\\数据备份\\201911061315用户脱敏.txt";
String writeAddr = "E:\\桌面_工作\\数据备份\\201911061315用户脱敏.txt";
try {
try {
long log_stUtc = System.currentTimeMillis();
long log_stUtc = System.currentTimeMillis();
...
@@ -115,7 +158,22 @@ public class TuoMinUtils {
...
@@ -115,7 +158,22 @@ public class TuoMinUtils {
} catch (IOException e) {
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace();
}
}
*/
String
email
=
"630226318@QQ.COM"
;
//String email = "294603191@qq.c0m";
//String email = "139@139.com13902502392";
//System.out.println(checkEmail(email));
//System.out.println(isEmail(email));
System
.
out
.
println
(
checkEmail
(
"630226318@qq.com"
));
System
.
out
.
println
(
checkEmail
(
"630226318@QQ.C OM"
));
System
.
out
.
println
(
checkEmail
(
"630226318@QQ.COM"
));
System
.
out
.
println
(
checkEmail
(
"139@139.com13902502392"
));
System
.
out
.
println
(
checkEmail
(
"294603191@qq.c0m"
));
}
}
}
}
src/main/java/cn/quantgroup/report/service/manualTool/ManualToolService.java
View file @
049870b0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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