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
045a3689
Commit
045a3689
authored
Apr 28, 2021
by
郑建
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
文件报送手动模式
parent
f1ae6c26
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
20 deletions
+31
-20
QuantGroupZhuDaiReportToBaiHang.java
...uantgroup/report/job/QuantGroupZhuDaiReportToBaiHang.java
+1
-1
RoutineWorkTask.java
src/main/java/cn/quantgroup/report/job/RoutineWorkTask.java
+2
-2
BaiHangZhuDaiService.java
...antgroup/report/service/baihang/BaiHangZhuDaiService.java
+23
-12
BhFileCreditApiClient.java
.../report/service/baihang/client/BhFileCreditApiClient.java
+1
-1
BaihangReportApplicationTests.java
...a/cn/quantgroup/report/BaihangReportApplicationTests.java
+4
-4
No files found.
src/main/java/cn/quantgroup/report/job/QuantGroupZhuDaiReportToBaiHang.java
View file @
045a3689
...
...
@@ -45,7 +45,7 @@ public class QuantGroupZhuDaiReportToBaiHang {
// @Async
//@Scheduled(cron = "0 0 05 * * ?")
@Scheduled
(
cron
=
"0 0 03 * * ?"
)
//
@Scheduled(cron = "0 0 03 * * ?")
public
void
startZhuDaiReport
(){
if
(
increment
()){
redisTemplate
.
expire
(
Constant
.
QG_ZHU_DAI_REPORT_LOCK_KEY
,
10
,
TimeUnit
.
SECONDS
);
...
...
src/main/java/cn/quantgroup/report/job/RoutineWorkTask.java
View file @
045a3689
...
...
@@ -68,7 +68,7 @@ public class RoutineWorkTask {
public
String
BACKLOG_DELAY_DAY
;
@Async
@Scheduled
(
cron
=
"0 0 18 * * ?"
)
//
@Scheduled(cron = "0 0 18 * * ?")
public
void
downloadLog
()
{
//if (increment(ROUTINE_WORK_BH_LOCK_KEY_1)) {
// redisTemplate.expire(ROUTINE_WORK_BH_LOCK_KEY_1, 10, TimeUnit.SECONDS);
...
...
@@ -160,7 +160,7 @@ public class RoutineWorkTask {
@Async
@Scheduled
(
cron
=
"0 10 18 * * ?"
)
//
@Scheduled(cron = "0 10 18 * * ?")
public
void
sendBaoSong
()
{
//if (increment(ROUTINE_WORK_BH_LOCK_KEY_2)) {
// redisTemplate.expire(ROUTINE_WORK_BH_LOCK_KEY_2, 10, TimeUnit.SECONDS);
...
...
src/main/java/cn/quantgroup/report/service/baihang/BaiHangZhuDaiService.java
View file @
045a3689
...
...
@@ -1579,6 +1579,7 @@ public class BaiHangZhuDaiService {
AtomicInteger
atomicInteger
=
new
AtomicInteger
();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
List
<
String
>
reportList
=
new
ArrayList
<>();
reportList
.
add
(
"#singleLoanAccountInfo"
);
for
(
int
i
=
0
;
i
<
loanInfozdList
.
size
();
i
++)
{
LoanInfoZhuDai
loanInfo
=
loanInfozdList
.
get
(
i
);
String
id
=
""
;
...
...
@@ -1587,9 +1588,9 @@ public class BaiHangZhuDaiService {
List
<
String
>
targetRepaymentDayList
=
loanInfoMapper
.
findTargetRepaymentDayList
(
loanInfoReqId
);
if
(
targetRepaymentDayList
!=
null
&&
targetRepaymentDayList
.
size
()
>
0
)
{
loanInfo
.
setTargetRepayDateList
(
String
.
join
(
","
,
targetRepaymentDayList
));
log
.
info
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfo
.
getTotalTerm
()
+
",targetRepaymentDayList size="
+
targetRepaymentDayList
.
size
());
//
log.info("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList size=" + targetRepaymentDayList.size());
}
else
{
log
.
warn
(
"比较还款总期数&账单日列表totalTerm="
+
loanInfo
.
getTotalTerm
()
+
",targetRepaymentDayList is null."
);
//
log.warn("比较还款总期数&账单日列表totalTerm=" + loanInfo.getTotalTerm() + ",targetRepaymentDayList is null.");
}
UUID
loanInfoId
=
UUID
.
randomUUID
();
id
=
loanInfoId
.
toString
().
replaceAll
(
"-"
,
""
);
...
...
@@ -1597,7 +1598,7 @@ public class BaiHangZhuDaiService {
LoanInfoZhuDai
record
=
new
LoanInfoZhuDai
();
BeanUtils
.
copyProperties
(
loanInfo
,
record
);
record
.
setRecordId
(
id
);
loanInfoDbMapper
.
saveLoanInfoRecordLog
(
record
);
//
loanInfoDbMapper.saveLoanInfoRecordLog(record);
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送-放款申请保存记录失败"
,
e
);
}
...
...
@@ -1607,11 +1608,12 @@ public class BaiHangZhuDaiService {
loanInfoVo
.
setFinTechAgencyBusiness
(
finTechAgencyBusiness
);
loanInfoVo
.
setReqID
(
id
);
loanInfoVo
.
setName
(
interfaceUploadClient
(
loanInfo
.
getName
()));
loanInfoVo
.
setPid
(
interfaceUploadClient
(
loanInfo
.
getPid
()));
loanInfoVo
.
setMobile
(
interfaceUploadClient
(
loanInfo
.
getMobile
()));
loanInfoVo
.
setName
(
tuomin
(
loanInfo
.
getName
()));
loanInfoVo
.
setPid
(
tuomin
(
loanInfo
.
getPid
()));
loanInfoVo
.
setMobile
(
tuomin
(
loanInfo
.
getMobile
()));
if
(
DateUtils
.
parseDate
(
"yyyy-MM-dd'T'hh:mm:ss"
,
loanInfoVo
.
getIssueDate
()).
getTime
()
<
DateUtils
.
parseDate
(
"yyyy-MM-dd'T'hh:mm:ss"
,
loanInfoVo
.
getAccountOpenDate
()).
getTime
()){
loanInfoVo
.
setAccountOpenDate
(
loanInfoVo
.
getIssueDate
());
loanInfoVo
.
setApplyDate
(
loanInfoVo
.
getIssueDate
());
}
reportList
.
add
(
JSON
.
toJSONString
(
loanInfoVo
));
// String resultStr = iHttpService.postBaiHang(baiHangLoanInfoUrl, getHeader(), JSON.toJSONString(loanInfoVo));
...
...
@@ -1627,8 +1629,9 @@ public class BaiHangZhuDaiService {
log
.
error
(
"量化派助贷TO百行报送-放款信息异常, recordId: {} , loanId: {} "
,
id
,
loanInfo
.
getLoanId
(),
e
);
}
}
File
file
=
new
File
(
"
量子数科科技有限公司_D2_"
+
endTime
.
split
(
"T"
)[
0
].
replaceAll
(
"-"
,
""
)+
"_"
+
UUID
.
randomUUID
().
toString
()+
".cry
"
);
File
file
=
new
File
(
"
F:\\9_QFNEW\\baihang-report\\D3\\量子数科科技有限公司_D2_"
+
endTime
.
split
(
"T"
)[
0
].
replaceAll
(
"-"
,
""
)+
"_0002"
+
".txt
"
);
FileUtils
.
writeLines
(
file
,
reportList
);
createFile
(
file
.
getName
());
log
.
info
(
"量化派助贷TO百行报送-放款申请完成, 实际大小: {} , 报送成功大小: {} , 耗时: {} "
,
loanInfozdList
.
size
(),
atomicInteger
.
get
(),
sendWatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
));
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送-异常"
,
e
);
...
...
@@ -1636,8 +1639,9 @@ public class BaiHangZhuDaiService {
}
else
if
(
"D3"
.
equalsIgnoreCase
(
type
))
{
//非循环贷款贷后数据信息(D3)
List
<
String
>
reportList
=
new
ArrayList
<>();
for
(
int
j
=
0
;
j
<
2
;
j
++)
{
List
<
String
>
reportList
=
new
ArrayList
<>();
reportList
.
add
(
"#singleLoanRepayInfo"
);
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
try
{
List
<
RepaymentInfoZhuDai
>
repaymentLoanInfos
=
null
;
...
...
@@ -1673,9 +1677,9 @@ public class BaiHangZhuDaiService {
}
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
set
Pid
(
interfaceUploadClient
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
set
Name
(
interfaceUploadClient
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setMobile
(
interfaceUploadClient
(
repaymentLoanInfo
.
getMobile
()));
repaymentLoanInfo
.
set
Name
(
tuomin
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
set
Pid
(
tuomin
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
tuomin
(
repaymentLoanInfo
.
getMobile
()));
// String resultStr = iHttpService.postBaiHang(baiHangRepayMentLoanInfoUrl, getHeader(), JSON.toJSONString(repaymentLoanInfo));
// log.info("助贷还款用户报送结果, param: {} , resultStr: {} ", JSON.toJSONString(repaymentLoanInfo), resultStr);
// if (Objects.isNull(resultStr) || !"success".equalsIgnoreCase(JSON.parseObject(resultStr).getString("status"))) {
...
...
@@ -1698,7 +1702,6 @@ public class BaiHangZhuDaiService {
log
.
error
(
"量化派助贷TO百行报送-异常 J: {} , 开始时间: {} , 结束时间: {} "
,
j
,
starTime
,
endTime
,
e
);
}
}
}
else
{
return
"其他未知类型type="
+
type
;
}
...
...
@@ -2452,5 +2455,13 @@ public class BaiHangZhuDaiService {
}
private
static
String
tuomin
(
String
s
){
if
(
StringUtils
.
isNumeric
(
s
)
||
s
.
contains
(
"X"
)
||
s
.
contains
(
"x"
)){
return
s
.
substring
(
0
,
s
.
length
()-
4
)+
"0000"
;
}
else
{
return
s
.
substring
(
0
,
1
)+
"零"
;
}
}
}
src/main/java/cn/quantgroup/report/service/baihang/client/BhFileCreditApiClient.java
View file @
045a3689
...
...
@@ -91,7 +91,7 @@ public class BhFileCreditApiClient {
//设置压缩加密后的文件路径
response
.
setEncryptFilePath
(
req
.
getTargetFilePath
());
//设置压缩加密后的文件名
response
.
setEncryptFileName
(
srcFile
.
getName
().
substring
(
0
,
srcFile
.
getName
().
lastIndexOf
(
"."
))+
"-
V
.cry"
);
response
.
setEncryptFileName
(
srcFile
.
getName
().
substring
(
0
,
srcFile
.
getName
().
lastIndexOf
(
"."
))+
"-
R
.cry"
);
//压缩文件
File
encryptFile
=
new
File
(
response
.
getEncryptFilePath
()+
File
.
separator
+
response
.
getEncryptFileName
());
if
(
encryptFile
.
exists
()){
...
...
src/test/java/cn/quantgroup/report/BaihangReportApplicationTests.java
View file @
045a3689
...
...
@@ -38,13 +38,13 @@ public class BaihangReportApplicationTests {
@Test
public
void
testD2Repost
(){
Stopwatch
stopwatch
=
Stopwatch
.
createStarted
();
D
3
();
D
2
();
log
.
info
(
"跑了 {}"
,
stopwatch
.
elapsed
(
TimeUnit
.
MILLISECONDS
));
}
//2020-07-01
private
void
D2
(){
String
startTime
=
"2020-0
6-12
"
,
endTime
=
"2020-07-01"
;
String
startTime
=
"2020-0
7-01
"
,
endTime
=
"2020-07-01"
;
Date
startDate
;
Date
endDate
=
DateUtils
.
parseDate
(
"yyyy-MM-dd"
,
endTime
);
while
(
endDate
.
getTime
()
<
System
.
currentTimeMillis
()){
...
...
@@ -58,7 +58,7 @@ public class BaihangReportApplicationTests {
}
private
void
D3
(){
String
startTime
=
"2020-0
6-12
"
,
endTime
=
"2020-07-01"
;
String
startTime
=
"2020-0
7-01
"
,
endTime
=
"2020-07-01"
;
Date
startDate
;
Date
endDate
=
DateUtils
.
parseDate
(
"yyyy-MM-dd"
,
endTime
);
while
(
endDate
.
getTime
()
<
System
.
currentTimeMillis
()){
...
...
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