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
1e366106
Commit
1e366106
authored
Jul 31, 2021
by
陈宏杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
D3O
parent
4d20c0c7
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
275 additions
and
0 deletions
+275
-0
RepaymentLoanInfoMapper.java
...tgroup/report/mapper/baihang/RepaymentLoanInfoMapper.java
+10
-0
BaiHangFileReportService.java
...roup/report/service/baihang/BaiHangFileReportService.java
+106
-0
RepaymentLoanInfoMapper.xml
...ntgroup/report/mapper/baihang/RepaymentLoanInfoMapper.xml
+159
-0
No files found.
src/main/java/cn/quantgroup/report/mapper/baihang/RepaymentLoanInfoMapper.java
View file @
1e366106
...
...
@@ -104,4 +104,14 @@ public interface RepaymentLoanInfoMapper {
List
<
RepaymentInfoZhuDai
>
repairNormalLH
(
@Param
(
"planIds"
)
List
<
Long
>
planIds
);
/**
* 查询D3逾期记录
*/
List
<
RepaymentInfoZhuDai
>
queryOverdueRecordOfD3
(
BaiHangTimeRecord
baiHangTimeRecord
);
/**
* 查询D3还款记录
*/
List
<
RepaymentInfoZhuDai
>
queryRepayMentRecordOfD3
(
BaiHangTimeRecord
baiHangTimeRecord
);
}
src/main/java/cn/quantgroup/report/service/baihang/BaiHangFileReportService.java
View file @
1e366106
...
...
@@ -103,6 +103,10 @@ public class BaiHangFileReportService {
reportD2
(
starTime
,
endTime
);
}
else
if
(
"D3"
.
equalsIgnoreCase
(
type
))
{
reportD3
(
starTime
,
endTime
);
}
else
if
(
"D3O"
.
equalsIgnoreCase
(
type
))
{
reportD3O
(
starTime
,
endTime
);
}
else
if
(
"D3R"
.
equalsIgnoreCase
(
type
))
{
reportD3R
(
starTime
,
endTime
);
}
else
{
throw
new
QGException
(
COMMON_ILLEGAL_PARAM_TOAST
,
"报送类型不正确"
);
}
...
...
@@ -306,6 +310,108 @@ public class BaiHangFileReportService {
}
}
/**
* 非循环贷款贷后数据信息(D3)逾期记录
* @param startTime 开始时间
* @param endTime 截止时间
*/
private
void
reportD3O
(
String
startTime
,
String
endTime
)
{
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
null
;
List
<
String
>
reportList
=
new
ArrayList
<>();
reportList
.
add
(
"#singleLoanRepayInfo"
);
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
Stopwatch
queryStopwatch
=
Stopwatch
.
createStarted
();
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
queryOverdueRecordOfD3
(
BaiHangTimeRecord
.
builder
().
startTime
(
startTime
).
endTime
(
endTime
).
build
());
log
.
info
(
"量化派助贷TO百行报送(D3)-逾期记录查询结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} "
,
startTime
,
endTime
,
repaymentLoanInfos
.
size
(),
(
queryStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
/
1000
)
+
".s"
);
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
String
id
=
""
;
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++)
{
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
try
{
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
try
{
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
record
.
setRecordId
(
id
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
record
);
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-逾期记录保存异常"
,
e
);
}
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
atomicInteger
.
getAndIncrement
();
reportList
.
add
(
JSON
.
toJSONString
(
repaymentLoanInfo
));
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-逾期记录处理异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
}
}
File
file
=
new
File
(
"量子数科科技有限公司_D3O_"
+
fileNameReplaceAll
(
startTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
FileUtils
.
writeLines
(
file
,
reportList
);
if
(
reportList
.
size
()<=
1
)
{
log
.
info
(
"量化派助贷TO百行报送(D3)-逾期记录为空,加密文件不生成!starTime={},endTime={}"
,
startTime
,
endTime
);
}
else
{
createFile
(
file
.
getAbsolutePath
());
}
log
.
info
(
"量化派助贷TO百行报送(D3)-逾期记录完成,开始时间: {} , 结束时间: {} , 实际大小: {} , 报送成功大小: {} , 耗时: {} "
,
startTime
,
endTime
,
repaymentLoanInfos
.
size
(),
atomicInteger
.
get
(),
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-逾期记录处理异常,开始时间: {} , 结束时间: {} "
,
startTime
,
endTime
,
e
);
}
}
/**
* 非循环贷款贷后数据信息(D3)还款记录
* @param startTime 开始时间
* @param endTime 截止时间
*/
private
void
reportD3R
(
String
startTime
,
String
endTime
)
{
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
null
;
List
<
String
>
reportList
=
new
ArrayList
<>();
reportList
.
add
(
"#singleLoanRepayInfo"
);
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
Stopwatch
queryStopwatch
=
Stopwatch
.
createStarted
();
repaymentLoanInfos
=
repaymentLoanInfoMapper
.
queryRepayMentRecordOfD3
(
BaiHangTimeRecord
.
builder
().
startTime
(
startTime
).
endTime
(
endTime
).
build
());
log
.
info
(
"量化派助贷TO百行报送(D3)-还款记录查询结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} "
,
startTime
,
endTime
,
repaymentLoanInfos
.
size
(),
(
queryStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
/
1000
)
+
".s"
);
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
String
id
=
""
;
for
(
int
i
=
0
;
i
<
repaymentLoanInfos
.
size
();
i
++)
{
RepaymentInfoZhuDai
repaymentLoanInfo
=
repaymentLoanInfos
.
get
(
i
);
try
{
id
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
try
{
RepaymentInfoZhuDai
record
=
new
RepaymentInfoZhuDai
();
BeanUtils
.
copyProperties
(
repaymentLoanInfo
,
record
);
record
.
setRecordId
(
id
);
repaymentLoanInfoDbMapper
.
saveRepaymentLoanInfoLog
(
record
);
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-还款记录保存异常"
,
e
);
}
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
atomicInteger
.
getAndIncrement
();
reportList
.
add
(
JSON
.
toJSONString
(
repaymentLoanInfo
));
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-还款记录处理异常, recordId: {} , loanId: {} "
,
id
,
repaymentLoanInfo
.
getLoanId
(),
e
);
}
}
File
file
=
new
File
(
"量子数科科技有限公司_D3R_"
+
fileNameReplaceAll
(
startTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
FileUtils
.
writeLines
(
file
,
reportList
);
if
(
reportList
.
size
()<=
1
)
{
log
.
info
(
"量化派助贷TO百行报送(D3)-还款记录为空,加密文件不生成!starTime={},endTime={}"
,
startTime
,
endTime
);
}
else
{
createFile
(
file
.
getAbsolutePath
());
}
log
.
info
(
"量化派助贷TO百行报送(D3)-还款记录完成,开始时间: {} , 结束时间: {} , 实际大小: {} , 报送成功大小: {} , 耗时: {} "
,
startTime
,
endTime
,
repaymentLoanInfos
.
size
(),
atomicInteger
.
get
(),
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(D3)-还款记录处理异常,开始时间: {} , 结束时间: {} "
,
startTime
,
endTime
,
e
);
}
}
/**
* 根据传入的文件路径将加密后的文件生成到 {@link BaiHangFileReportService#HOST_PATH}中
* @param filePath 需要加密的文件路径
...
...
src/main/resources/cn/quantgroup/report/mapper/baihang/RepaymentLoanInfoMapper.xml
View file @
1e366106
This diff is collapsed.
Click to expand it.
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