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
bc15550b
Commit
bc15550b
authored
Dec 26, 2019
by
郝彦辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将存量D2的json数据保存到loan_info_zhudai表
parent
93e35f2c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
98 additions
and
0 deletions
+98
-0
ManualToolController.java
...cn/quantgroup/report/controller/ManualToolController.java
+6
-0
ManualToolService.java
...antgroup/report/service/manualTool/ManualToolService.java
+92
-0
No files found.
src/main/java/cn/quantgroup/report/controller/ManualToolController.java
View file @
bc15550b
...
...
@@ -136,4 +136,10 @@ public class ManualToolController {
return
"调用结束"
;
}
@RequestMapping
(
"/d2_saveLog"
)
public
String
d2_saveLog
(
String
d2JsonFileName
,
String
reqIdFileName
,
String
no_reqId_start
){
manualToolService
.
d2_saveLog
(
d2JsonFileName
,
reqIdFileName
,
no_reqId_start
);
return
"d2_saveLog调用结束"
;
}
}
src/main/java/cn/quantgroup/report/service/manualTool/ManualToolService.java
View file @
bc15550b
...
...
@@ -7,11 +7,13 @@ import cn.quantgroup.report.config.aop.MonitorType;
import
cn.quantgroup.report.domain.baihang.*
;
import
cn.quantgroup.report.mapper.baihang.LoanInfoMapper
;
import
cn.quantgroup.report.mapper.master.ApplyLoanInfoDbMapper
;
import
cn.quantgroup.report.mapper.master.LoanInfoDbMapper
;
import
cn.quantgroup.report.mapper.master.RepaymentLoanInfoDbMapper
;
import
cn.quantgroup.report.response.GlobalResponse
;
import
cn.quantgroup.report.service.CommonSuperService
;
import
cn.quantgroup.report.service.baihang.util.TuoMinUtils
;
import
cn.quantgroup.report.utils.ReadOrWriteTxt
;
import
cn.quantgroup.report.utils.StringUtil
;
import
cn.quantgroup.report.utils.commonutil.AesCrypto
;
import
cn.quantgroup.report.utils.commonutil.Base64
;
import
cn.quantgroup.report.utils.commonutil.MD5Util
;
...
...
@@ -59,6 +61,10 @@ public class ManualToolService implements CommonSuperService {
@Autowired
private
ApplyLoanInfoDbMapper
applyLoanInfoDbMapper
;
@Autowired
public
LoanInfoDbMapper
loanInfoDbMapper
;
//@Autowired
...
...
@@ -1925,6 +1931,92 @@ public class ManualToolService implements CommonSuperService {
System
.
out
.
println
(
"build_key() D3 end."
);
}
@Async
public
void
d2_saveLog
(
String
d2JsonFileName
,
String
reqIdFileName
,
String
no_reqId_start
)
{
boolean
haveReqID
=
false
;
List
<
String
>
reqID_Str_List
=
null
;
HashMap
<
String
,
String
>
reqID_Map
=
null
;
try
{
if
(
StringUtils
.
isNotEmpty
(
reqIdFileName
)){
reqID_Str_List
=
ReadOrWriteTxt
.
readTxtList
(
reqIdFileName
);
log
.
info
(
"files reqID_Str_List size="
+
reqID_Str_List
.
size
());
reqID_Map
=
new
HashMap
<>(
reqID_Str_List
.
size
());
String
[]
arry
=
null
;
//oldReqID=30067778,newReqID=199bbec95c0b41178055f1c5164bd7fb
for
(
String
str
:
reqID_Str_List
){
if
(
str
.
length
()<
2
){
continue
;
}
arry
=
str
.
split
(
"="
);
reqID_Map
.
put
(
arry
[
2
],
arry
[
1
].
split
(
","
)[
0
]);
}
haveReqID
=
true
;
}
log
.
info
(
"param haveReqID: {} , reqID_Str_List: {} , reqID_Map: {} "
,
haveReqID
,
(
reqID_Str_List
!=
null
?
reqID_Str_List
.
size
()
:
"null"
),
(
reqID_Map
!=
null
?
reqID_Map
.
size
()
:
"null"
));
reqID_Str_List
=
null
;
List
<
String
>
d2JsonList
=
ReadOrWriteTxt
.
readTxtList
(
d2JsonFileName
);
log
.
info
(
"files d2JsonList size="
+
d2JsonList
.
size
());
int
no_reqId
=
0
,
saveCount
=
0
;
if
(
StringUtils
.
isNotEmpty
(
no_reqId_start
)){
no_reqId
=
Integer
.
parseInt
(
no_reqId_start
);
}
for
(
int
i
=
0
;
i
<
d2JsonList
.
size
();
i
++){
String
jsonStr
=
d2JsonList
.
get
(
i
);
if
(
jsonStr
.
length
()<
30
){
continue
;
}
//LoanInfoZhuDaiVo loanInfo
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
jsonStr
);
JSONObject
business
=
jsonObject
.
getJSONObject
(
"finTechAgencyBusiness"
);
FinTechAgencyBusinessZhuDai
finTechAgencyBusiness
=
JSONObject
.
parseObject
(
business
.
toJSONString
(),
FinTechAgencyBusinessZhuDai
.
class
);
LoanInfoZhuDai
loanInfozd_tmp
=
JSONObject
.
parseObject
(
jsonStr
,
LoanInfoZhuDai
.
class
);
loanInfozd_tmp
.
setInstitutionalFundingPartner
(
finTechAgencyBusiness
.
getInstitutionalFundingPartner
());
loanInfozd_tmp
.
setInstitutionalFundingPartnerID
(
finTechAgencyBusiness
.
getInstitutionalFundingPartnerID
());
loanInfozd_tmp
.
setRelationID
(
finTechAgencyBusiness
.
getRelationID
());
loanInfozd_tmp
.
setInstitutionalFundingPartnerLoanID
(
finTechAgencyBusiness
.
getInstitutionalFundingPartnerLoanID
());
loanInfozd_tmp
.
setOrderID
(
finTechAgencyBusiness
.
getOrderID
());
loanInfozd_tmp
.
setPreCreditLimit
(
finTechAgencyBusiness
.
getPreCreditLimit
());
loanInfozd_tmp
.
setRecordId
(
loanInfozd_tmp
.
getReqID
());
loanInfozd_tmp
.
setReqID
(
null
);
if
(
haveReqID
&&
reqID_Map
.
containsKey
(
loanInfozd_tmp
.
getRecordId
())){
loanInfozd_tmp
.
setReqID
(
reqID_Map
.
get
(
loanInfozd_tmp
.
getRecordId
()));
reqID_Map
.
remove
(
loanInfozd_tmp
.
getRecordId
());
}
if
(
StringUtils
.
isEmpty
(
loanInfozd_tmp
.
getReqID
())){
no_reqId
++;
loanInfozd_tmp
.
setReqID
(
"no_"
+
no_reqId
);
}
try
{
loanInfoDbMapper
.
saveLoanInfoRecordLog
(
loanInfozd_tmp
);
saveCount
++;
}
catch
(
Exception
e
){
log
.
error
(
"保存放款记录失败, DATA: {} "
,
jsonStr
,
e
);
}
log
.
info
(
"Build End:"
+
i
);
}
log
.
info
(
"All D2 LOG:保存放款记录结束, d2JsonList: {} , no_reqId: {} , saveCount: {} "
,
d2JsonList
.
size
(),
no_reqId
,
saveCount
);
}
catch
(
Exception
e
){
log
.
error
(
"处理放款记录异常!"
,
e
);
}
}
public
static
void
main
(
String
[]
args
)
{
// List<String> lineList = ReadOrWriteTxt.readTxtList("D:\\用户目录\\Downloads\\D2_M_01.txt");
// System.out.println("lineList:"+lineList.size());
...
...
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