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
3ba3a5f4
Commit
3ba3a5f4
authored
Jan 07, 2020
by
郝彦辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
D3逾期报送逻辑优化。
parent
5d775bef
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
419 additions
and
16 deletions
+419
-16
BaiHangZhuDaiService.java
...antgroup/report/service/baihang/BaiHangZhuDaiService.java
+17
-14
ManualToolService.java
...antgroup/report/service/manualTool/ManualToolService.java
+398
-1
RepaymentLoanInfoDbMapper.xml
...tgroup/report/mapper/master/RepaymentLoanInfoDbMapper.xml
+4
-1
No files found.
src/main/java/cn/quantgroup/report/service/baihang/BaiHangZhuDaiService.java
View file @
3ba3a5f4
...
@@ -391,20 +391,23 @@ public class BaiHangZhuDaiService {
...
@@ -391,20 +391,23 @@ public class BaiHangZhuDaiService {
String
id
=
""
;
String
id
=
""
;
String
reqId_log
=
repaymentLoanInfo
.
getReqID
();
String
reqId_log
=
repaymentLoanInfo
.
getReqID
();
try
{
try
{
RepaymentInfoZhuDai
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
build
());
if
(
j
>
0
){
//逾期
if
(
j
>
0
&&
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
//逾期的,跳过
RepaymentInfoZhuDai
repaymentLoanInfo1
=
repaymentLoanInfoDbMapper
.
findLastOne
(
BaiHangRepayment
.
builder
().
loanId
(
repaymentLoanInfo
.
getLoanId
()).
termNo
(
repaymentLoanInfo
.
getTermNo
()).
sendDate
(
startnyr
).
build
());
tg_atomicInt
.
getAndIncrement
();
////if (j > 0 && Objects.nonNull(repaymentLoanInfo1)) { //逾期的,跳过
log
.
info
(
"量化派助贷TO百行报送-实时还款逾期跳过报送, reqId_log: {} , loanId: {} , termNo: {} , startnyr: {} , endnyr: {} , bean: {} "
,
reqId_log
,
repaymentLoanInfo
.
getLoanId
(),
repaymentLoanInfo
.
getTermNo
(),
startnyr
,
endnyr
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
if
(
Objects
.
nonNull
(
repaymentLoanInfo1
))
{
//逾期的,跳过
tg_atomicInt
.
getAndIncrement
();
//----------2020.02.02 保存跳过的数据,用于以后补全
log
.
info
(
"量化派助贷TO百行报送-实时还款逾期跳过报送, reqId_log: {} , loanId: {} , termNo: {} , startnyr: {} , endnyr: {} , bean: {} "
,
reqId_log
,
repaymentLoanInfo
.
getLoanId
(),
repaymentLoanInfo
.
getTermNo
(),
startnyr
,
endnyr
,
JSON
.
toJSONString
(
repaymentLoanInfo1
));
try
{
FileUtils
.
write
(
new
File
(
"/home/quant_group/baihang-report/data/baihang/D3/yuqi_tg/"
+
startnyr
+
"_"
+
endnyr
+
".json"
),
//----------2020.02.02 保存跳过的数据,用于以后补全
JSON
.
toJSONString
(
repaymentLoanInfo
)+
"\r\n"
,
"UTF-8"
,
true
);
try
{
}
catch
(
Exception
e
){
FileUtils
.
write
(
new
File
(
"/home/quant_group/baihang-report/data/baihang/D3/yuqi_tg/"
+
startnyr
+
"_"
+
endnyr
+
".json"
),
log
.
error
(
"量化派助贷TO百行报送-实时逾期跳过, Json数据保存文件异常,"
,
e
);
JSON
.
toJSONString
(
repaymentLoanInfo
)+
"\r\n"
,
"UTF-8"
,
true
);
}
}
catch
(
Exception
e
){
log
.
error
(
"量化派助贷TO百行报送-实时逾期跳过, Json数据保存文件异常,"
,
e
);
}
continue
;
continue
;
}
}
}
totail_atomicInt
.
getAndIncrement
();
totail_atomicInt
.
getAndIncrement
();
...
@@ -426,7 +429,7 @@ public class BaiHangZhuDaiService {
...
@@ -426,7 +429,7 @@ public class BaiHangZhuDaiService {
repaymentLoanInfo
.
setMobile
(
interfaceUploadClient
(
repaymentLoanInfo
.
getMobile
()));
repaymentLoanInfo
.
setMobile
(
interfaceUploadClient
(
repaymentLoanInfo
.
getMobile
()));
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangRepayMentLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
repaymentLoanInfo
));
String
resultStr
=
iHttpService
.
postBaiHang
(
baiHangRepayMentLoanInfoUrl
,
getHeader
(),
JSON
.
toJSONString
(
repaymentLoanInfo
));
log
.
info
(
"助贷还款用户报送结果,
param: {} , resultStr: {} "
,
logJson
,
resultStr
);
log
.
info
(
"助贷还款用户报送结果,
J: {} , param: {} , resultStr: {} "
,
j
,
logJson
,
resultStr
);
if
(
Objects
.
isNull
(
resultStr
)
||
!
"success"
.
equalsIgnoreCase
(
JSON
.
parseObject
(
resultStr
).
getString
(
"status"
)))
{
if
(
Objects
.
isNull
(
resultStr
)
||
!
"success"
.
equalsIgnoreCase
(
JSON
.
parseObject
(
resultStr
).
getString
(
"status"
)))
{
log
.
info
(
"量化派助贷TO百行报送-还款返回结果不正确, 开始时间: {} , 结束时间: {} , reqId_log: {} , recordId: {} , loanId: {} , bean: {} "
,
startnyr
,
endnyr
,
reqId_log
,
id
,
repaymentLoanInfo
.
getLoanId
(),
JSON
.
toJSONString
(
repaymentLoanInfo
));
log
.
info
(
"量化派助贷TO百行报送-还款返回结果不正确, 开始时间: {} , 结束时间: {} , reqId_log: {} , recordId: {} , loanId: {} , bean: {} "
,
startnyr
,
endnyr
,
reqId_log
,
id
,
repaymentLoanInfo
.
getLoanId
(),
JSON
.
toJSONString
(
repaymentLoanInfo
));
repaymentLoanInfoDbMapper
.
updateCurrentRecordEnableFalse
(
BaiHangUpDateRecord
.
builder
().
enable
(
"0"
).
recordId
(
id
).
build
());
repaymentLoanInfoDbMapper
.
updateCurrentRecordEnableFalse
(
BaiHangUpDateRecord
.
builder
().
enable
(
"0"
).
recordId
(
id
).
build
());
...
...
src/main/java/cn/quantgroup/report/service/manualTool/ManualToolService.java
View file @
3ba3a5f4
...
@@ -2747,6 +2747,395 @@ public class ManualToolService implements CommonSuperService {
...
@@ -2747,6 +2747,395 @@ public class ManualToolService implements CommonSuperService {
}
}
private
static
void
d2_build_20200106
()
{
try
{
List
<
String
>
jsonList_1
=
ReadOrWriteTxt
.
readTxtList
(
"D:\\用户目录\\Downloads\\tmp_recordId.tmp"
);
HashMap
<
String
,
String
>
map_recordId
=
new
HashMap
<>();
for
(
String
str
:
jsonList_1
){
JSONObject
success
=
JSONObject
.
parseObject
(
str
.
trim
());
//{"loanId":"SP634998595419688159659395","reqID":"c6c6dcefc1584f96ac81385a844ff9d7","status":"success"}
map_recordId
.
put
(
success
.
getString
(
"loanId"
)
,
success
.
getString
(
"reqID"
));
}
log
.
info
(
"d2_build_20200106 read files jsonList_1 size:{} , map_recordId siez:{} "
,
jsonList_1
.
size
(),
map_recordId
.
size
());
List
<
String
>
d2JsonList
=
ReadOrWriteTxt
.
readTxtList
(
"D:\\用户目录\\Downloads\\lhp_D2_20200105_20200106_01.txt"
);
log
.
info
(
"files d2JsonList size="
+
d2JsonList
.
size
());
for
(
int
i
=
0
;
i
<
d2JsonList
.
size
();
i
++){
String
jsonStr
=
d2JsonList
.
get
(
i
).
trim
();
if
(
jsonStr
.
length
()<
30
){
continue
;
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonStr
);
String
loanId
=
jsonObject
.
getString
(
"loanId"
);
if
(
map_recordId
.
containsKey
(
loanId
)){
jsonObject
.
put
(
"recordId"
,
map_recordId
.
get
(
loanId
));
jsonObject
.
put
(
"opCode"
,
"M"
);
FileUtils
.
write
(
new
File
(
"D:\\用户目录\\Downloads\\ok_d2.txt"
),
JSON
.
toJSONString
(
jsonObject
)+
"\n"
,
"UTF-8"
,
true
);
map_recordId
.
remove
(
loanId
);
}
else
{
log
.
error
(
"loanId:{}, not find, json:{} "
,
loanId
,
jsonStr
);
}
}
log
.
info
(
"All D2 LOG:保存放款记录结束"
);
if
(
map_recordId
.
size
()>
0
){
for
(
String
key
:
map_recordId
.
keySet
()){
log
.
info
(
"map_recordId key:{}, value:{}"
,
key
,
map_recordId
.
get
(
key
));
}
}
}
catch
(
Exception
e
){
log
.
error
(
"处理放款记录异常!"
,
e
);
}
}
private
static
void
d3_build_20200106
()
{
try
{
List
<
String
>
jsonList_1
=
ReadOrWriteTxt
.
readTxtList
(
"D:\\用户目录\\Downloads\\tmp_d3.tmp"
);
HashMap
<
String
,
String
>
map_recordId
=
new
HashMap
<>();
int
index
=
0
;
for
(
String
str
:
jsonList_1
){
// 1 SP608186771475507996705018
String
[]
arry
=
str
.
trim
().
split
(
"[ ]"
);
map_recordId
.
put
(
arry
[
1
],
""
+(++
index
));
}
log
.
info
(
"d2_build_20200106 read files jsonList_1 size:{} , map_recordId siez:{} "
,
jsonList_1
.
size
(),
map_recordId
.
size
());
List
<
String
>
d2JsonList
=
ReadOrWriteTxt
.
readTxtList
(
"D:\\用户目录\\Downloads\\lhp_D3_20200105_20200106_01.txt"
);
log
.
info
(
"files d2JsonList size="
+
d2JsonList
.
size
());
for
(
int
i
=
0
;
i
<
d2JsonList
.
size
();
i
++){
String
jsonStr
=
d2JsonList
.
get
(
i
).
trim
();
if
(
jsonStr
.
length
()<
30
){
continue
;
}
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonStr
);
String
loanId
=
jsonObject
.
getString
(
"loanId"
);
if
(
map_recordId
.
containsKey
(
loanId
)){
log
.
error
(
"find loanId:{} , json:{} "
,
loanId
,
jsonStr
);
map_recordId
.
remove
(
loanId
);
}
else
{
if
(
jsonObject
.
containsKey
(
"realRepayment"
)
&&
jsonObject
.
getIntValue
(
"realRepayment"
)!=
0
){
if
(
jsonObject
.
containsKey
(
"realRepaymentDate"
)
&&
StringUtils
.
isNotEmpty
(
jsonObject
.
getString
(
"realRepaymentDate"
))){
FileUtils
.
write
(
new
File
(
"D:\\用户目录\\Downloads\\ok_d3.txt"
),
JSON
.
toJSONString
(
jsonObject
)+
"\n"
,
"UTF-8"
,
true
);
}
}
FileUtils
.
write
(
new
File
(
"D:\\用户目录\\Downloads\\ok2_d3.txt"
),
JSON
.
toJSONString
(
jsonObject
)+
"\n"
,
"UTF-8"
,
true
);
}
}
log
.
info
(
"All D2 LOG:保存放款记录结束"
);
if
(
map_recordId
.
size
()>
0
){
for
(
String
key
:
map_recordId
.
keySet
()){
log
.
info
(
"map_recordId key:{}, value:{}"
,
key
,
map_recordId
.
get
(
key
));
}
}
}
catch
(
Exception
e
){
log
.
error
(
"处理放款记录异常!"
,
e
);
}
}
//=================================================================
private
static
void
a1_build_manual
()
{
String
path
=
"C:\\Users\\Administrator\\Desktop\\助贷\\2020-01-06_07\\"
;
try
{
List
<
String
>
jsonList_1
=
ReadOrWriteTxt
.
readTxtList
(
path
+
"zhudai_a1_07_succ.tmp"
);
HashMap
<
String
,
String
>
map_recordId
=
new
HashMap
<>();
int
index
=
0
;
for
(
String
str
:
jsonList_1
){
/*// 1 SP608186771475507996705018
String[] arry= str.trim().split("[ ]");
map_recordId.put(arry[1], ""+(++index));*/
JSONObject
success
=
JSONObject
.
parseObject
(
str
.
trim
());
//{"loanId":"SP634998595419688159659395","reqID":"c6c6dcefc1584f96ac81385a844ff9d7","status":"success"}
map_recordId
.
put
(
success
.
getString
(
"applyId"
)
,
success
.
getString
(
"reqID"
));
}
//map_recordId.remove("SP486140436893103307393850");
log
.
info
(
"a1_build_manual() read files jsonList_1 size:{} , map_recordId siez:{} "
,
jsonList_1
.
size
(),
map_recordId
.
size
());
List
<
String
>
d2JsonList
=
ReadOrWriteTxt
.
readTxtList
(
path
+
"lhp_A1_20200106_20200107_01.txt"
);
log
.
info
(
"a1_build_manual() files d2JsonList size="
+
d2JsonList
.
size
());
for
(
int
i
=
0
;
i
<
d2JsonList
.
size
();
i
++){
String
jsonStr
=
d2JsonList
.
get
(
i
).
trim
();
if
(
jsonStr
.
length
()<
30
){
continue
;
}
log
.
info
(
"ST:"
+
i
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonStr
);
String
loanId
=
jsonObject
.
getString
(
"applyId"
);
if
(
map_recordId
.
containsKey
(
loanId
)){
jsonObject
.
put
(
"reqID"
,
map_recordId
.
get
(
loanId
));
jsonObject
.
put
(
"opCode"
,
"M"
);
FileUtils
.
write
(
new
File
(
path
+
"build_in_A1.txt"
),
JSON
.
toJSONString
(
jsonObject
)+
"\n"
,
"UTF-8"
,
true
);
map_recordId
.
remove
(
loanId
);
}
else
{
//jsonObject.put("reqID", UUID.randomUUID().toString().replaceAll("-", ""));
jsonObject
.
put
(
"opCode"
,
"A"
);
FileUtils
.
write
(
new
File
(
path
+
"build_notin_A1.txt"
),
JSON
.
toJSONString
(
jsonObject
)+
"\n"
,
"UTF-8"
,
true
);
}
}
log
.
info
(
"a1_build_manual() All A1 LOG:保存放款记录结束"
);
if
(
map_recordId
.
size
()>
0
){
for
(
String
key
:
map_recordId
.
keySet
()){
log
.
error
(
"map_recordId key:{}, value:{}"
,
key
,
map_recordId
.
get
(
key
));
}
}
}
catch
(
Exception
e
){
log
.
error
(
"a1_build_manual()处理放款记录异常!"
,
e
);
}
}
private
static
void
d2_build_manual
()
{
String
path
=
"C:\\Users\\Administrator\\Desktop\\助贷\\2020-01-06_07\\"
;
try
{
List
<
String
>
jsonList_1
=
ReadOrWriteTxt
.
readTxtList
(
path
+
"zhudai_d2_07_succ.tmp"
);
HashMap
<
String
,
String
>
map_recordId
=
new
HashMap
<>();
int
index
=
0
;
for
(
String
str
:
jsonList_1
){
/*// 1 SP608186771475507996705018
String[] arry= str.trim().split("[ ]");
map_recordId.put(arry[1], ""+(++index));*/
JSONObject
success
=
JSONObject
.
parseObject
(
str
.
trim
());
//{"loanId":"SP634998595419688159659395","reqID":"c6c6dcefc1584f96ac81385a844ff9d7","status":"success"}
map_recordId
.
put
(
success
.
getString
(
"loanId"
)
,
success
.
getString
(
"reqID"
));
}
//map_recordId.remove("SP486140436893103307393850");
log
.
info
(
"d2_build_manual() read files jsonList_1 size:{} , map_recordId siez:{} "
,
jsonList_1
.
size
(),
map_recordId
.
size
());
List
<
String
>
d2JsonList
=
ReadOrWriteTxt
.
readTxtList
(
path
+
"lhp_D2_20200106_20200107_01.txt"
);
log
.
info
(
"d2_build_manual() files d2JsonList size="
+
d2JsonList
.
size
());
for
(
int
i
=
0
;
i
<
d2JsonList
.
size
();
i
++){
String
jsonStr
=
d2JsonList
.
get
(
i
).
trim
();
if
(
jsonStr
.
length
()<
30
){
continue
;
}
log
.
info
(
"ST:"
+
i
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonStr
);
String
loanId
=
jsonObject
.
getString
(
"loanId"
);
if
(
map_recordId
.
containsKey
(
loanId
)){
jsonObject
.
put
(
"recordId"
,
map_recordId
.
get
(
loanId
));
jsonObject
.
put
(
"opCode"
,
"M"
);
FileUtils
.
write
(
new
File
(
path
+
"build_in_D2.txt"
),
JSON
.
toJSONString
(
jsonObject
)+
"\n"
,
"UTF-8"
,
true
);
map_recordId
.
remove
(
loanId
);
}
else
{
jsonObject
.
put
(
"recordId"
,
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
jsonObject
.
put
(
"opCode"
,
"A"
);
FileUtils
.
write
(
new
File
(
path
+
"build_notin_D2.txt"
),
JSON
.
toJSONString
(
jsonObject
)+
"\n"
,
"UTF-8"
,
true
);
}
}
log
.
info
(
"d2_build_manual() All D2 LOG:保存放款记录结束"
);
if
(
map_recordId
.
size
()>
0
){
for
(
String
key
:
map_recordId
.
keySet
()){
log
.
error
(
"map_recordId key:{}, value:{}"
,
key
,
map_recordId
.
get
(
key
));
}
}
}
catch
(
Exception
e
){
log
.
error
(
"d2_build_manual()处理放款记录异常!"
,
e
);
}
}
private
static
void
d3_build_checkCF
()
{
try
{
String
path
=
"C:\\Users\\Administrator\\Desktop\\助贷\\2020-01-06_07\\"
;
List
<
String
>
d3JsonList_hk
=
ReadOrWriteTxt
.
readTxtList
(
path
+
"lhp_D3_20200106_20200107_01.txt"
);
log
.
info
(
"d3_build_manua() files d3JsonList_hk size="
+
d3JsonList_hk
.
size
());
//List<String> d3JsonList_yq = ReadOrWriteTxt.readTxtList(path+"广达06-07_d3_逾期.txt");
List
<
String
>
d3JsonList_yq
=
new
ArrayList
<>();
log
.
info
(
"d3_build_manua() files d3JsonList_yq size="
+
d3JsonList_yq
.
size
());
//检测有没有loanId+termNo重复的
HashMap
<
String
,
Integer
>
all_map
=
new
HashMap
<>();
for
(
String
str:
d3JsonList_hk
){
JSONObject
bean
=
JSONObject
.
parseObject
(
str
.
trim
());
String
key
=
bean
.
getString
(
"loanId"
)
+
"|"
+
bean
.
getString
(
"termNo"
);
if
(
all_map
.
containsKey
(
key
)){
all_map
.
put
(
key
,
all_map
.
get
(
key
)+
1
);
}
else
{
all_map
.
put
(
key
,
1
);
}
}
log
.
info
(
"d3JsonList_hk大小:{} , map大小:{} "
,
d3JsonList_hk
.
size
(),
all_map
.
size
());
for
(
String
str:
d3JsonList_yq
){
JSONObject
bean
=
JSONObject
.
parseObject
(
str
.
trim
());
String
key
=
bean
.
getString
(
"loanId"
)
+
"|"
+
bean
.
getString
(
"termNo"
);
if
(
all_map
.
containsKey
(
key
)){
all_map
.
put
(
key
,
all_map
.
get
(
key
)+
1
);
}
else
{
all_map
.
put
(
key
,
1
);
}
}
log
.
info
(
"总查询大小:{} , map大小:{} "
,
(
d3JsonList_hk
.
size
()+
d3JsonList_yq
.
size
()),
all_map
.
size
());
for
(
String
key
:
all_map
.
keySet
()){
if
(
all_map
.
get
(
key
)
>
1
){
log
.
error
(
"all_map key:{}, value:{}"
,
key
,
all_map
.
get
(
key
));
}
}
log
.
info
(
"d3_build_manua() All D3还款 LOG:保存记录结束"
);
}
catch
(
Exception
e
){
log
.
error
(
"d3_build_manua()处理还款记录异常!"
,
e
);
}
}
private
static
void
d3_build_manua
()
{
try
{
String
path
=
"C:\\Users\\Administrator\\Desktop\\助贷\\2020-01-06_07\\"
;
List
<
String
>
jsonList_1
=
ReadOrWriteTxt
.
readTxtList
(
path
+
"zhudai_d3_all_succ_20200107.tmp"
);
HashMap
<
String
,
String
>
map_recordId
=
new
HashMap
<>();
int
index
=
0
;
for
(
String
str
:
jsonList_1
){
/*// 1 SP608186771475507996705018
String[] arry= str.trim().split("[ ]");
map_recordId.put(arry[1], ""+(++index));*/
//{"loanId":"SP553608198775803578218481","loanStatus":3,"mobile":"IArdaUFgL+GDSyFLI9ZaPJunwHg3xfbZnjh9G5jH8qq8E2rSiWdFAVc2S24gjLZMLxIFyHgddP/oFRuTvDVaEY61tPdrPWHnG0n+quOtjwcMNCgNLMI1Lroex5uDBwYbmTYmDAFw12nfQEBgIQD97uImnJdvwcV7XL5bEwlRXT4=","name":"OYKbIVwxrIONdVFM3B2yuXvxoPfonwWMpGQY5nUeiSgPUCwq5kDUDyvtQOdJt/BMLjVDYN32YimhA3yP3bKssTrzrXhOuF6JfMytta5r0NDv+rSdVx+GWrmQQuxcQW3j2qdHUhilTwl65EFs7QoBuCMz2pt0GWRL2rDEcSbKr5k=","opCode":"A","overdueAmount":0,"overdueStatus":"","pid":"Qz0BDafzmrSlr2UMSh+N9GR6pAsQqiamGfan9Mti3O5p9qU+A2YXt/hCwKEnze955mqzLLW69x8Zj02j1/PZnCKMnABwM39RGZaKIZ6cJOkG2Q60EVEjjqhND/QD3yEdRFdK/Tityb/AFh57QW1icOKgF5Rj71FtpuuribTCVU4=","plannedPayment":544.99,"realRepayment":544.99,"realRepaymentDate":"2020-01-06T20:48:20","remainingAmount":0,"reqID":"7cbfdbe6ed054365ab11b8220dee7c23","statusConfirmAt":"2020-01-07T00:00:00","targetRepayment":544.99,"targetRepaymentDate":"2020-01-04","termNo":3,"termStatus":"normal","uploadTs":"2020-01-07T05:30:09"} , resultStr: {"loanId":"SP553608198775803578218481","reqID":"7cbfdbe6ed054365ab11b8220dee7c23","status":"success"}
String
[]
arry
=
str
.
trim
().
split
(
", resultStr:"
);
JSONObject
sendData
=
JSONObject
.
parseObject
(
arry
[
0
].
trim
());
map_recordId
.
put
(
sendData
.
getString
(
"loanId"
)
+
"|"
+
sendData
.
getString
(
"termNo"
),
sendData
.
getString
(
"reqID"
));
}
//map_recordId.remove("SP486140436893103307393850");
log
.
info
(
"d3_build_manua() read files jsonList_1 size:{} , map_recordId siez:{} "
,
jsonList_1
.
size
(),
map_recordId
.
size
());
List
<
String
>
d3JsonList_hk
=
ReadOrWriteTxt
.
readTxtList
(
path
+
"lhp_D3_20200106_20200107_01.txt"
);
log
.
info
(
"d3_build_manua() files d3JsonList_hk size="
+
d3JsonList_hk
.
size
());
for
(
int
i
=
0
;
i
<
d3JsonList_hk
.
size
();
i
++){
String
jsonStr
=
d3JsonList_hk
.
get
(
i
).
trim
();
if
(
jsonStr
.
length
()<
30
){
continue
;
}
log
.
info
(
"ST:"
+
i
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonStr
);
// 删掉 本次还款金额 实际还款时间 为空的一条
// "realRepayment":0,"realRepaymentDate":""
/* if(jsonObject.containsKey("realRepayment") && jsonObject.getIntValue("realRepayment")!=0
&& jsonObject.containsKey("realRepaymentDate") && StringUtils.isNotEmpty(jsonObject.getString("realRepayment"))){*/
String
key
=
jsonObject
.
getString
(
"loanId"
)
+
"|"
+
jsonObject
.
getString
(
"termNo"
);
if
(
map_recordId
.
containsKey
(
key
)){
jsonObject
.
put
(
"recordId"
,
map_recordId
.
get
(
key
));
jsonObject
.
put
(
"opCode"
,
"M"
);
FileUtils
.
write
(
new
File
(
path
+
"build_in_d3.txt"
),
JSON
.
toJSONString
(
jsonObject
)+
"\n"
,
"UTF-8"
,
true
);
map_recordId
.
remove
(
key
);
}
else
{
jsonObject
.
put
(
"recordId"
,
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
jsonObject
.
put
(
"opCode"
,
"A"
);
FileUtils
.
write
(
new
File
(
path
+
"build_notIn_d3.txt"
),
JSON
.
toJSONString
(
jsonObject
)+
"\n"
,
"UTF-8"
,
true
);
}
/* }else{
log.warn("跳过:"+jsonStr);
}*/
}
log
.
info
(
"d3_build_manua() All D3还款 LOG:保存记录结束"
);
if
(
map_recordId
.
size
()>
0
){
for
(
String
key
:
map_recordId
.
keySet
()){
log
.
error
(
"map_recordId key:{}, value:{}"
,
key
,
map_recordId
.
get
(
key
));
FileUtils
.
write
(
new
File
(
path
+
"d3_map_is_not_empty.txt"
),
key
+
","
+
map_recordId
.
get
(
key
)+
"\n"
,
"UTF-8"
,
true
);
}
}
}
catch
(
Exception
e
){
log
.
error
(
"d3_build_manua()处理还款记录异常!"
,
e
);
}
}
private
static
void
checkTGd3_build
()
{
try
{
String
path
=
"C:\\Users\\Administrator\\Desktop\\助贷\\2020-01-06_07\\"
;
/*List<String> jsonList_1 = ReadOrWriteTxt.readTxtList(path+"zhudai_d3_all_succ_20200107.tmp");
HashMap<String,String> map_recordId = new HashMap<>();
int index=0;
for(String str : jsonList_1){
// 1 SP608186771475507996705018
//String[] arry= str.trim().split("[ ]");
//map_recordId.put(arry[1], ""+(++index));
//{"loanId":"SP553608198775803578218481","loanStatus":3,"mobile":"IArdaUFgL+GDSyFLI9ZaPJunwHg3xfbZnjh9G5jH8qq8E2rSiWdFAVc2S24gjLZMLxIFyHgddP/oFRuTvDVaEY61tPdrPWHnG0n+quOtjwcMNCgNLMI1Lroex5uDBwYbmTYmDAFw12nfQEBgIQD97uImnJdvwcV7XL5bEwlRXT4=","name":"OYKbIVwxrIONdVFM3B2yuXvxoPfonwWMpGQY5nUeiSgPUCwq5kDUDyvtQOdJt/BMLjVDYN32YimhA3yP3bKssTrzrXhOuF6JfMytta5r0NDv+rSdVx+GWrmQQuxcQW3j2qdHUhilTwl65EFs7QoBuCMz2pt0GWRL2rDEcSbKr5k=","opCode":"A","overdueAmount":0,"overdueStatus":"","pid":"Qz0BDafzmrSlr2UMSh+N9GR6pAsQqiamGfan9Mti3O5p9qU+A2YXt/hCwKEnze955mqzLLW69x8Zj02j1/PZnCKMnABwM39RGZaKIZ6cJOkG2Q60EVEjjqhND/QD3yEdRFdK/Tityb/AFh57QW1icOKgF5Rj71FtpuuribTCVU4=","plannedPayment":544.99,"realRepayment":544.99,"realRepaymentDate":"2020-01-06T20:48:20","remainingAmount":0,"reqID":"7cbfdbe6ed054365ab11b8220dee7c23","statusConfirmAt":"2020-01-07T00:00:00","targetRepayment":544.99,"targetRepaymentDate":"2020-01-04","termNo":3,"termStatus":"normal","uploadTs":"2020-01-07T05:30:09"} , resultStr: {"loanId":"SP553608198775803578218481","reqID":"7cbfdbe6ed054365ab11b8220dee7c23","status":"success"}
String[] arry = str.trim().split(", resultStr:");
JSONObject sendData = JSONObject.parseObject(arry[0].trim());
map_recordId.put(sendData.getString("loanId") +"|"+ sendData.getString("termNo"), sendData.getString("reqID"));
}
//map_recordId.remove("SP486140436893103307393850");
log.info("d3_build_manua() read files jsonList_1 size:{} , map_recordId siez:{} ", jsonList_1.size(), map_recordId.size());
*/
List
<
String
>
d3JsonList_hk
=
ReadOrWriteTxt
.
readTxtList
(
path
+
"build_in_d3.txt"
);
log
.
info
(
"d3_build_manua() files d3JsonList_hk size="
+
d3JsonList_hk
.
size
());
for
(
int
i
=
0
;
i
<
d3JsonList_hk
.
size
();
i
++){
String
jsonStr
=
d3JsonList_hk
.
get
(
i
).
trim
();
if
(
jsonStr
.
length
()<
30
){
continue
;
}
log
.
info
(
"ST:"
+
i
);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonStr
);
// 删掉 本次还款金额 实际还款时间 为空的一条
// "realRepayment":0,"realRepaymentDate":""
if
(
jsonObject
.
containsKey
(
"realRepayment"
)
&&
jsonObject
.
getIntValue
(
"realRepayment"
)!=
0
&&
jsonObject
.
containsKey
(
"realRepaymentDate"
)
&&
StringUtils
.
isNotEmpty
(
jsonObject
.
getString
(
"realRepayment"
))){
FileUtils
.
write
(
new
File
(
path
+
"not_tiaoguo-In.txt"
),
jsonStr
+
"\n"
,
"UTF-8"
,
true
);
/* String key = jsonObject.getString("loanId") +"|"+ jsonObject.getString("termNo");
if(map_recordId.containsKey(key)){
jsonObject.put("recordId",map_recordId.get(key));
jsonObject.put("opCode","M");
FileUtils.write(new File(path+"build_in_d3.txt"), JSON.toJSONString(jsonObject)+"\n", "UTF-8", true);
map_recordId.remove(key);
}else{
jsonObject.put("recordId", UUID.randomUUID().toString().replaceAll("-", ""));
jsonObject.put("opCode","A");
FileUtils.write(new File(path+"build_notIn_d3.txt"), JSON.toJSONString(jsonObject)+"\n", "UTF-8", true);
}*/
}
else
{
log
.
warn
(
"跳过:"
+
jsonStr
);
}
}
log
.
info
(
"d3_build_manua() All D3还款 LOG:保存记录结束"
);
}
catch
(
Exception
e
){
log
.
error
(
"d3_build_manua()处理还款记录异常!"
,
e
);
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
// List<String> lineList = ReadOrWriteTxt.readTxtList("D:\\用户目录\\Downloads\\D2_M_01.txt");
// List<String> lineList = ReadOrWriteTxt.readTxtList("D:\\用户目录\\Downloads\\D2_M_01.txt");
// System.out.println("lineList:"+lineList.size());
// System.out.println("lineList:"+lineList.size());
...
@@ -2820,9 +3209,17 @@ public class ManualToolService implements CommonSuperService {
...
@@ -2820,9 +3209,17 @@ public class ManualToolService implements CommonSuperService {
//transaction_call2();
//transaction_call2();
//transaction_call3();
//transaction_call3();
buildSelectSql
();
//buildSelectSql();
//d2_build_20200106();
//d3_build_20200106();
//a1_build_manual();
//d2_build_manual();
//d3_build_checkCF();
//d3_build_manua();
checkTGd3_build
();
}
}
...
...
src/main/resources/cn/quantgroup/report/mapper/master/RepaymentLoanInfoDbMapper.xml
View file @
3ba3a5f4
...
@@ -76,7 +76,10 @@
...
@@ -76,7 +76,10 @@
<select
id=
"findLastOne"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangRepayment"
resultType=
"cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai"
>
<select
id=
"findLastOne"
parameterType=
"cn.quantgroup.report.domain.baihang.BaiHangRepayment"
resultType=
"cn.quantgroup.report.domain.baihang.RepaymentInfoZhuDai"
>
select id, record_id, req_id, loan_id, term_no, status_confirm_at, term_status
select id, record_id, req_id, loan_id, term_no, status_confirm_at, term_status
from repayment_loan_info_zhudai where loan_id = #{loanId} and term_no = #{termNo} limit 1;
from repayment_loan_info_zhudai where loan_id = #{loanId} and term_no = #{termNo}
<!--2020.01.07 17:55 值针对当天,还款报了,逾期又有一条的情况 DATE_FORMAT(now(),'%Y-%m-%d') -->
and created_at >= #{sendDate}
limit 1;
</select>
</select>
...
...
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