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
dd855d1f
Commit
dd855d1f
authored
Jun 04, 2020
by
haoyanhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工具方法优化2
parent
4ef9e937
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
50 additions
and
2 deletions
+50
-2
ExZhuDaiBaiHangReSendController.java
.../controller/external/ExZhuDaiBaiHangReSendController.java
+14
-0
RepaymentInfoZhuDai.java
...quantgroup/report/domain/baihang/RepaymentInfoZhuDai.java
+0
-2
BaiHangZhuDaiService.java
...antgroup/report/service/baihang/BaiHangZhuDaiService.java
+36
-0
No files found.
src/main/java/cn/quantgroup/report/controller/external/ExZhuDaiBaiHangReSendController.java
View file @
dd855d1f
...
@@ -339,4 +339,18 @@ public class ExZhuDaiBaiHangReSendController {
...
@@ -339,4 +339,18 @@ public class ExZhuDaiBaiHangReSendController {
return
"d3_saveDbLog任务调度失败,参数错误"
;
return
"d3_saveDbLog任务调度失败,参数错误"
;
}
}
}
}
@RequestMapping
(
"/manual/d3_build2"
)
public
String
d3_build2
(
String
p3
,
String
secretKey
,
String
filePath
,
String
writeFilePath
){
if
(
StringUtils
.
isEmpty
(
writeFilePath
)){
return
"d3_build2任务调度失败,参数为空"
;
}
if
(
manualToolService
.
checkSecretKey
(
p3
,
secretKey
)){
baiHangZhuDaiService
.
d3_build2
(
filePath
,
writeFilePath
);
return
"d3_build2任务调度完成"
;
}
else
{
return
"d3_build2任务调度失败,参数错误"
;
}
}
}
}
src/main/java/cn/quantgroup/report/domain/baihang/RepaymentInfoZhuDai.java
View file @
dd855d1f
...
@@ -40,6 +40,4 @@ public class RepaymentInfoZhuDai implements Serializable {
...
@@ -40,6 +40,4 @@ public class RepaymentInfoZhuDai implements Serializable {
private
String
recordId
;
private
String
recordId
;
public
boolean
getRecordId
;
}
}
src/main/java/cn/quantgroup/report/service/baihang/BaiHangZhuDaiService.java
View file @
dd855d1f
...
@@ -1858,6 +1858,7 @@ public class BaiHangZhuDaiService {
...
@@ -1858,6 +1858,7 @@ public class BaiHangZhuDaiService {
}
}
}
}
//分析跑出来的D3存量,看那些是要M修改的,那些是要新增的
@Async
@Async
public
String
d3CheckToJson
(
String
filePath
)
{
public
String
d3CheckToJson
(
String
filePath
)
{
//写入文件的路径和前缀
//写入文件的路径和前缀
...
@@ -2168,6 +2169,7 @@ public class BaiHangZhuDaiService {
...
@@ -2168,6 +2169,7 @@ public class BaiHangZhuDaiService {
return
"处理D3数据结束 "
;
return
"处理D3数据结束 "
;
}
}
//检测存量跑出的A型D3,根据loan_id在不在D2日志中
@Async
@Async
public
String
d3IsHaveD2
(
String
filePath
)
{
public
String
d3IsHaveD2
(
String
filePath
)
{
//写入文件的路径和前缀
//写入文件的路径和前缀
...
@@ -2234,6 +2236,7 @@ public class BaiHangZhuDaiService {
...
@@ -2234,6 +2236,7 @@ public class BaiHangZhuDaiService {
}
}
//将存量跑出来的数据保存日志表,并且RecordId赋值给ReqID
@Async
@Async
public
void
d3_saveDbLog
(
String
filePath
,
String
writeFilePath
)
{
public
void
d3_saveDbLog
(
String
filePath
,
String
writeFilePath
)
{
long
starUtc
=
System
.
currentTimeMillis
();
long
starUtc
=
System
.
currentTimeMillis
();
...
@@ -2276,4 +2279,37 @@ public class BaiHangZhuDaiService {
...
@@ -2276,4 +2279,37 @@ public class BaiHangZhuDaiService {
//d3_saveDbLog跑的数据多了"getRecordId":false, 去掉
@Async
public
void
d3_build2
(
String
filePath
,
String
writeFilePath
)
{
long
starUtc
=
System
.
currentTimeMillis
();
List
<
String
>
d3InfosList
=
null
;
try
{
d3InfosList
=
FileUtils
.
readLines
(
new
File
(
filePath
),
"utf-8"
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
int
fsize
=
d3InfosList
.
size
();
log
.
info
(
"d3_build2读取文件: {} , 大小: {} , 耗时: {} "
,
filePath
,
fsize
,
(
System
.
currentTimeMillis
()-
starUtc
));
int
saveCount
=
0
;
for
(
int
i
=
0
;
i
<
fsize
;
i
++){
String
strJson
=
d3InfosList
.
get
(
i
);
try
{
if
(
strJson
.
length
()
<
30
){
//#singleLoanRepayInfo
log
.
warn
(
"d3InfosList筛选文件内容时发现数据错误, 文件: {} , 内容: {} "
,
filePath
,
strJson
);
continue
;
}
RepaymentInfoZhuDai
repaymentLoanInfo
=
new
Gson
().
fromJson
(
strJson
,
new
TypeToken
<
RepaymentInfoZhuDai
>(){}.
getType
());
this
.
wirteFile
(
writeFilePath
,
JSON
.
toJSONString
(
repaymentLoanInfo
)+
"\r\n"
);
saveCount
++;
}
catch
(
Exception
e
){
log
.
error
(
"d3_build2写数据记录失败, fileName: {} , DATA: {} , 第i: {} "
,
filePath
,
strJson
,
i
,
e
);
}
log
.
info
(
"d3_build2写数据记录结束, 第i: {} <<<"
,
i
);
}
log
.
info
(
"d3_build2写数据记录结束, 文件:{} ,list大小:{} , 保存成功:{} "
,
filePath
,
fsize
,
saveCount
);
}
}
}
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