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
5014647f
Commit
5014647f
authored
Aug 12, 2021
by
陈宏杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
不清库的重报方案
parent
5f0ec89c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
17 deletions
+39
-17
ManualToolController.java
...cn/quantgroup/report/controller/ManualToolController.java
+2
-2
BaiHangFileReportService.java
...roup/report/service/baihang/BaiHangFileReportService.java
+37
-15
No files found.
src/main/java/cn/quantgroup/report/controller/ManualToolController.java
View file @
5014647f
...
...
@@ -155,9 +155,9 @@ public class ManualToolController {
}
@RequestMapping
(
"/createFile"
)
public
String
testD2Repost
(
String
type
,
String
startDate
,
String
endDate
,
Integer
daySpilt
,
String
loanStartDateStr
,
String
loanEndDateStr
){
public
String
testD2Repost
(
String
type
,
String
startDate
,
String
endDate
,
Integer
daySpilt
,
String
loanStartDateStr
,
String
loanEndDateStr
,
String
prefix
){
try
{
fileReportService
.
createReportFile
(
type
,
startDate
,
endDate
,
daySpilt
,
loanStartDateStr
,
loanEndDateStr
);
fileReportService
.
createReportFile
(
type
,
startDate
,
endDate
,
daySpilt
,
loanStartDateStr
,
loanEndDateStr
,
prefix
);
return
"SUCCESS"
;
}
catch
(
Exception
e
){
return
e
.
getMessage
();
...
...
src/main/java/cn/quantgroup/report/service/baihang/BaiHangFileReportService.java
View file @
5014647f
...
...
@@ -84,7 +84,7 @@ public class BaiHangFileReportService {
* @param end 报送区间的截止时间 格式:"2019-05-07T00:00:00"
*/
@Async
public
void
createReportFile
(
String
type
,
String
start
,
String
end
,
int
daySplitCount
,
String
loanStartDateStr
,
String
loanEndDateStr
)
{
public
void
createReportFile
(
String
type
,
String
start
,
String
end
,
int
daySplitCount
,
String
loanStartDateStr
,
String
loanEndDateStr
,
String
prefix
)
{
try
{
if
(!
increment
(
Constant
.
QG_ZHU_DAI_CREATE_REPORT_FILE_LOCK_KEY
))
{
log
.
error
(
"创建报送文件任务已经开始执行...请勿重复操作"
);
...
...
@@ -99,18 +99,18 @@ public class BaiHangFileReportService {
Date
stepStartDate
=
DateUtils
.
parseDate
(
dateFormat
,
start
);
Date
stepEndDate
=
org
.
apache
.
commons
.
lang3
.
time
.
DateUtils
.
addDays
(
stepStartDate
,
daySplitCount
);
// D3 还款记录 防止漏期
Date
endDate
=
"D3R"
.
equalsIgnoreCase
(
type
)
?
new
Date
(
)
:
DateUtils
.
parseDate
(
dateFormat
,
end
);
Date
endDate
=
"D3R"
.
equalsIgnoreCase
(
type
)
?
org
.
apache
.
commons
.
lang3
.
time
.
DateUtils
.
addDays
(
new
Date
(),
1
)
:
DateUtils
.
parseDate
(
dateFormat
,
end
);
Date
loanStartDate
=
DateUtils
.
parseDate
(
dateFormat
,
loanStartDateStr
);
Date
loanEndDate
=
DateUtils
.
parseDate
(
dateFormat
,
loanEndDateStr
);
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
while
(
stepEndDate
.
getTime
()
<=
endDate
.
getTime
()){
createReportFile
(
type
,
stepStartDate
,
stepEndDate
,
loanStartDate
,
loanEndDate
);
createReportFile
(
type
,
stepStartDate
,
stepEndDate
,
loanStartDate
,
loanEndDate
,
prefix
);
stepStartDate
=
new
Date
(
stepEndDate
.
getTime
());
stepEndDate
=
org
.
apache
.
commons
.
lang3
.
time
.
DateUtils
.
addDays
(
stepEndDate
,
daySplitCount
);
}
log
.
info
(
"当前 {} -- {}--{} 任务执行结束 总耗时 : {}"
,
type
,
start
,
end
,
stopwatch
.
elapsed
(
TimeUnit
.
MILLISECONDS
));
if
(
stepEndDate
.
getTime
()
>
endDate
.
getTime
()){
createReportFile
(
type
,
stepStartDate
,
endDate
,
loanStartDate
,
loanEndDate
);
createReportFile
(
type
,
stepStartDate
,
endDate
,
loanStartDate
,
loanEndDate
,
prefix
);
}
}
catch
(
Exception
e
)
{
log
.
error
(
"创建报送文件异常!"
,
e
);
...
...
@@ -119,7 +119,7 @@ public class BaiHangFileReportService {
}
}
private
void
createReportFile
(
String
type
,
Date
startDate
,
Date
endDate
,
Date
loanStartDate
,
Date
loanEndDate
)
{
private
void
createReportFile
(
String
type
,
Date
startDate
,
Date
endDate
,
Date
loanStartDate
,
Date
loanEndDate
,
String
prefix
)
{
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
String
starTime
=
DateUtils
.
formatDate
(
startDate
,
"yyyy-MM-dd HH:mm:ss"
);
String
endTime
=
DateUtils
.
formatDate
(
endDate
,
"yyyy-MM-dd HH:mm:ss"
);
...
...
@@ -130,15 +130,15 @@ public class BaiHangFileReportService {
if
(
"A1"
.
equalsIgnoreCase
(
type
))
{
reportA1
(
starTime
,
endTime
);
}
else
if
(
"D2"
.
equalsIgnoreCase
(
type
))
{
reportD2
(
starTime
,
endTime
);
reportD2
(
starTime
,
endTime
,
prefix
);
}
else
if
(
"D3"
.
equalsIgnoreCase
(
type
))
{
reportD3
(
starTime
,
endTime
);
reportD3
(
starTime
,
endTime
,
prefix
);
}
else
if
(
"D3O"
.
equalsIgnoreCase
(
type
))
{
reportD3O
(
starTime
,
endTime
);
reportD3O
(
starTime
,
endTime
,
prefix
);
}
else
if
(
"D3R"
.
equalsIgnoreCase
(
type
))
{
reportD3R
(
starTime
,
endTime
,
loanStartTime
,
loanEndTime
);
reportD3R
(
starTime
,
endTime
,
loanStartTime
,
loanEndTime
,
prefix
);
}
else
if
(
"D3O30"
.
equalsIgnoreCase
(
type
))
{
reportD3OFor30Day
(
starTime
,
endTime
);
reportD3OFor30Day
(
starTime
,
endTime
,
prefix
);
}
else
{
throw
new
QGException
(
COMMON_ILLEGAL_PARAM_TOAST
,
"报送类型不正确"
);
}
...
...
@@ -214,7 +214,7 @@ public class BaiHangFileReportService {
* @param starTime 开始时间
* @param endTime 截至时间
*/
private
void
reportD2
(
String
starTime
,
String
endTime
)
{
private
void
reportD2
(
String
starTime
,
String
endTime
,
String
prefix
)
{
List
<
LoanInfoZhuDai
>
loanInfozdList
=
null
,
recordList
=
new
ArrayList
<>(
D2_INITIAL_CAPACITY
);
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
try
{
...
...
@@ -255,6 +255,12 @@ public class BaiHangFileReportService {
loanInfoVo
.
setAccountOpenDate
(
loanInfoVo
.
getIssueDate
());
loanInfoVo
.
setApplyDate
(
loanInfoVo
.
getIssueDate
());
}
if
(
isDebug
&&
StringUtils
.
isNotBlank
(
prefix
))
{
loanInfoVo
.
setReqID
(
prefix
+
loanInfoVo
.
getReqID
());
loanInfoVo
.
setLoanId
(
prefix
+
loanInfoVo
.
getLoanId
());
finTechAgencyBusiness
.
setRelationID
(
prefix
+
finTechAgencyBusiness
.
getRelationID
());
loanInfoVo
.
setFinTechAgencyBusiness
(
finTechAgencyBusiness
);
}
reportList
.
add
(
JSON
.
toJSONString
(
loanInfoVo
));
atomicInteger
.
getAndIncrement
();
}
catch
(
Exception
e
)
{
...
...
@@ -282,7 +288,7 @@ public class BaiHangFileReportService {
* @param startTime 开始时间
* @param endTime 截止时间
*/
private
void
reportD3
(
String
startTime
,
String
endTime
)
{
private
void
reportD3
(
String
startTime
,
String
endTime
,
String
prefix
)
{
for
(
int
j
=
0
;
j
<
2
;
j
++)
{
List
<
String
>
reportList
=
new
ArrayList
<>();
reportList
.
add
(
"#singleLoanRepayInfo"
);
...
...
@@ -323,6 +329,10 @@ public class BaiHangFileReportService {
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
if
(
isDebug
&&
StringUtils
.
isNotBlank
(
prefix
))
{
repaymentLoanInfo
.
setReqID
(
prefix
+
repaymentLoanInfo
.
getReqID
());
repaymentLoanInfo
.
setLoanId
(
prefix
+
repaymentLoanInfo
.
getLoanId
());
}
atomicInteger
.
getAndIncrement
();
reportList
.
add
(
JSON
.
toJSONString
(
repaymentLoanInfo
));
}
catch
(
Exception
e
)
{
...
...
@@ -397,7 +407,7 @@ public class BaiHangFileReportService {
* @param startTime 开始时间
* @param endTime 截止时间
*/
private
void
reportD3O
(
String
startTime
,
String
endTime
)
{
private
void
reportD3O
(
String
startTime
,
String
endTime
,
String
prefix
)
{
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
null
,
recordList
=
new
ArrayList
<>(
D3_INITIAL_CAPACITY
);
List
<
String
>
reportList
=
new
ArrayList
<>(
D3_INITIAL_CAPACITY
);
reportList
.
add
(
"#singleLoanRepayInfo"
);
...
...
@@ -420,6 +430,10 @@ public class BaiHangFileReportService {
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
if
(
isDebug
&&
StringUtils
.
isNotBlank
(
prefix
))
{
repaymentLoanInfo
.
setReqID
(
prefix
+
repaymentLoanInfo
.
getReqID
());
repaymentLoanInfo
.
setLoanId
(
prefix
+
repaymentLoanInfo
.
getLoanId
());
}
atomicInteger
.
getAndIncrement
();
reportList
.
add
(
JSON
.
toJSONString
(
repaymentLoanInfo
));
}
catch
(
Exception
e
)
{
...
...
@@ -445,7 +459,7 @@ public class BaiHangFileReportService {
/**
* 应还款日次日起,每30天的次日报送一次逾期记录,直至结清或转出
*/
private
void
reportD3OFor30Day
(
String
startTime
,
String
endTime
)
{
private
void
reportD3OFor30Day
(
String
startTime
,
String
endTime
,
String
prefix
)
{
List
<
LoanApplicationHistoryIdInfo
>
idInfos
=
null
;
LoanApplicationHistoryIdInfo
idInfo
=
null
;
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
new
ArrayList
<>(
D3_INITIAL_CAPACITY
),
tempRepaymentLoanInfos
=
null
,
recordList
=
new
ArrayList
<>(
D3_INITIAL_CAPACITY
);
...
...
@@ -488,6 +502,10 @@ public class BaiHangFileReportService {
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
if
(
isDebug
&&
StringUtils
.
isNotBlank
(
prefix
))
{
repaymentLoanInfo
.
setReqID
(
prefix
+
repaymentLoanInfo
.
getReqID
());
repaymentLoanInfo
.
setLoanId
(
prefix
+
repaymentLoanInfo
.
getLoanId
());
}
atomicInteger
.
getAndIncrement
();
reportList
.
add
(
JSON
.
toJSONString
(
repaymentLoanInfo
));
}
catch
(
Exception
e
)
{
...
...
@@ -515,7 +533,7 @@ public class BaiHangFileReportService {
* @param startTime 开始时间
* @param endTime 截止时间
*/
private
void
reportD3R
(
String
startTime
,
String
endTime
,
String
loanStartTime
,
String
loanEndTime
)
{
private
void
reportD3R
(
String
startTime
,
String
endTime
,
String
loanStartTime
,
String
loanEndTime
,
String
prefix
)
{
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
null
,
recordList
=
new
ArrayList
<>(
D3_INITIAL_CAPACITY
);
List
<
String
>
reportList
=
new
ArrayList
<>(
D3_INITIAL_CAPACITY
);
reportList
.
add
(
"#singleLoanRepayInfo"
);
...
...
@@ -538,6 +556,10 @@ public class BaiHangFileReportService {
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
if
(
isDebug
&&
StringUtils
.
isNotBlank
(
prefix
))
{
repaymentLoanInfo
.
setReqID
(
prefix
+
repaymentLoanInfo
.
getReqID
());
repaymentLoanInfo
.
setLoanId
(
prefix
+
repaymentLoanInfo
.
getLoanId
());
}
atomicInteger
.
getAndIncrement
();
reportList
.
add
(
JSON
.
toJSONString
(
repaymentLoanInfo
));
}
catch
(
Exception
e
)
{
...
...
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