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
d7569334
Commit
d7569334
authored
Dec 06, 2021
by
陈宏杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
替换表
parent
55279f2f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
10 deletions
+27
-10
ApplyLoanInfoZhuDaiMapper.java
...group/report/mapper/master/ApplyLoanInfoZhuDaiMapper.java
+3
-0
BaiHangFileReportService.java
...roup/report/service/baihang/BaiHangFileReportService.java
+11
-10
ApplyLoanInfoZhuDaiMapper.xml
...tgroup/report/mapper/master/ApplyLoanInfoZhuDaiMapper.xml
+13
-0
No files found.
src/main/java/cn/quantgroup/report/mapper/master/ApplyLoanInfoZhuDaiMapper.java
View file @
d7569334
package
cn
.
quantgroup
.
report
.
mapper
.
master
;
package
cn
.
quantgroup
.
report
.
mapper
.
master
;
import
cn.quantgroup.report.domain.baihang.ApplyLoanInfoZhuDai
;
import
cn.quantgroup.report.domain.baihang.ApplyLoanInfoZhuDai
;
import
cn.quantgroup.report.domain.baihang.ApplyLoanInfoZhuDaiRefuse
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.List
;
import
java.util.List
;
...
@@ -21,4 +22,6 @@ public interface ApplyLoanInfoZhuDaiMapper {
...
@@ -21,4 +22,6 @@ public interface ApplyLoanInfoZhuDaiMapper {
List
<
ApplyLoanInfoZhuDai
>
findByApplyId
(
String
applyId
);
List
<
ApplyLoanInfoZhuDai
>
findByApplyId
(
String
applyId
);
void
batchSaveLog
(
List
<
ApplyLoanInfoZhuDai
>
list
);
}
}
src/main/java/cn/quantgroup/report/service/baihang/BaiHangFileReportService.java
View file @
d7569334
...
@@ -253,7 +253,7 @@ public class BaiHangFileReportService {
...
@@ -253,7 +253,7 @@ public class BaiHangFileReportService {
private
String
reportA1Refuse
(
String
starTime
,
String
endTime
){
private
String
reportA1Refuse
(
String
starTime
,
String
endTime
){
String
encryptFileName
=
null
;
String
encryptFileName
=
null
;
List
<
ApplyLoanInfoZhuDai
Refuse
>
recordList
=
new
ArrayList
<>(
A1_INITIAL_CAPACITY
),
zhuDaiRefuseLogList
=
null
;
List
<
ApplyLoanInfoZhuDai
>
recordList
=
new
ArrayList
<>(
A1_INITIAL_CAPACITY
)
;
List
<
ApplyLoanInfoZhuDai
>
zhuDaiLogList
=
null
,
applyLoanInfos
=
null
;
List
<
ApplyLoanInfoZhuDai
>
zhuDaiLogList
=
null
,
applyLoanInfos
=
null
;
List
<
String
>
reportList
=
new
ArrayList
<>();
List
<
String
>
reportList
=
new
ArrayList
<>();
try
{
try
{
...
@@ -268,14 +268,14 @@ public class BaiHangFileReportService {
...
@@ -268,14 +268,14 @@ public class BaiHangFileReportService {
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
Stopwatch
sendWatch
=
Stopwatch
.
createStarted
();
reportList
.
add
(
"#applyInfo"
);
reportList
.
add
(
"#applyInfo"
);
String
reqId_log
=
""
;
String
reqId_log
=
""
;
ApplyLoanInfoZhuDai
record
=
null
;
for
(
int
i
=
0
;
i
<
applyLoanInfos
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
applyLoanInfos
.
size
();
i
++)
{
try
{
try
{
ApplyLoanInfoZhuDai
applyLoanInfo
=
applyLoanInfos
.
get
(
i
);
ApplyLoanInfoZhuDai
applyLoanInfo
=
applyLoanInfos
.
get
(
i
);
reqId_log
=
applyLoanInfo
.
getReqID
();
reqId_log
=
applyLoanInfo
.
getReqID
();
zhuDaiLogList
=
applyLoanInfoZhuDaiMapper
.
findByApplyId
(
applyLoanInfo
.
getApplyId
());
zhuDaiLogList
=
applyLoanInfoZhuDaiMapper
.
findByApplyId
(
applyLoanInfo
.
getApplyId
());
zhuDaiRefuseLogList
=
applyLoanInfoZhuDaiRefuseMapper
.
findApplyLoanInfoZhuDaiRefuseLog
(
applyLoanInfo
.
getReqID
());
if
(
CollectionUtils
.
isEmpty
(
zhuDaiLogList
))
{
if
(
CollectionUtils
.
isEmpty
(
zhuDaiLogList
)
&&
CollectionUtils
.
isEmpty
(
zhuDaiRefuseLogList
))
{
record
=
new
ApplyLoanInfoZhuDai
();
ApplyLoanInfoZhuDaiRefuse
record
=
new
ApplyLoanInfoZhuDaiRefuse
();
BeanUtils
.
copyProperties
(
applyLoanInfo
,
record
);
BeanUtils
.
copyProperties
(
applyLoanInfo
,
record
);
record
.
setRecordId
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
record
.
setRecordId
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
recordList
.
add
(
record
);
recordList
.
add
(
record
);
...
@@ -295,7 +295,7 @@ public class BaiHangFileReportService {
...
@@ -295,7 +295,7 @@ public class BaiHangFileReportService {
log
.
error
(
"量化派助贷TO百行报送(A1Refuse)-贷款申请信息异常, reqId_log: {} "
,
reqId_log
,
e
);
log
.
error
(
"量化派助贷TO百行报送(A1Refuse)-贷款申请信息异常, reqId_log: {} "
,
reqId_log
,
e
);
}
}
}
}
saveApplyLoanInfoZhuDai
Refuse
(
recordList
,
starTime
,
endTime
);
saveApplyLoanInfoZhuDai
(
recordList
,
starTime
,
endTime
);
File
file
=
new
File
(
HOST_PATH
+
"量子数科科技有限公司_A1Re_"
+
fileNameReplaceAll
(
starTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
File
file
=
new
File
(
HOST_PATH
+
"量子数科科技有限公司_A1Re_"
+
fileNameReplaceAll
(
starTime
.
split
(
"T"
)[
0
])+
"_"
+
fileNameReplaceAll
(
endTime
.
split
(
"T"
)[
0
])+
"_"
+
String
.
format
(
"%06d"
,
new
Random
().
nextInt
(
999999
))+
".txt"
);
FileUtils
.
writeLines
(
file
,
reportList
);
FileUtils
.
writeLines
(
file
,
reportList
);
if
(
reportList
.
size
()<=
1
)
{
if
(
reportList
.
size
()<=
1
)
{
...
@@ -762,18 +762,18 @@ public class BaiHangFileReportService {
...
@@ -762,18 +762,18 @@ public class BaiHangFileReportService {
}
}
}
}
private
void
saveApplyLoanInfoZhuDai
Refuse
(
List
<
ApplyLoanInfoZhuDaiRefuse
>
recordList
,
String
startTime
,
String
endTime
)
{
private
void
saveApplyLoanInfoZhuDai
(
List
<
ApplyLoanInfoZhuDai
>
recordList
,
String
startTime
,
String
endTime
)
{
if
(!
CollectionUtils
.
isEmpty
(
recordList
))
{
if
(!
CollectionUtils
.
isEmpty
(
recordList
))
{
List
<
List
<
ApplyLoanInfoZhuDai
Refuse
>>
allList
=
null
;
List
<
List
<
ApplyLoanInfoZhuDai
>>
allList
=
null
;
try
{
try
{
allList
=
Lists
.
partition
(
recordList
,
LISTS_PARTITION_SIZE
);
allList
=
Lists
.
partition
(
recordList
,
LISTS_PARTITION_SIZE
);
Stopwatch
saveStopwatch
=
Stopwatch
.
createStarted
();
Stopwatch
saveStopwatch
=
Stopwatch
.
createStarted
();
allList
.
stream
().
forEach
(
pRecordList
->
{
allList
.
stream
().
forEach
(
pRecordList
->
{
applyLoanInfoZhuDai
Refuse
Mapper
.
batchSaveLog
(
pRecordList
);
applyLoanInfoZhuDaiMapper
.
batchSaveLog
(
pRecordList
);
});
});
log
.
info
(
"量化派助贷TO百行报送(A1
Refuse
)批量插入结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} "
,
startTime
,
endTime
,
recordList
.
size
(),
(
saveStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
/
1000
)
+
".s"
);
log
.
info
(
"量化派助贷TO百行报送(A1)批量插入结束, startTime: {} , endTime: {} , 大小: {} , 耗时: {} "
,
startTime
,
endTime
,
recordList
.
size
(),
(
saveStopwatch
.
stop
().
elapsed
(
TimeUnit
.
MILLISECONDS
)
/
1000
)
+
".s"
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"量化派助贷TO百行报送(A1
Refuse
)保存异常"
,
e
);
log
.
error
(
"量化派助贷TO百行报送(A1)保存异常"
,
e
);
}
finally
{
}
finally
{
clear
(
recordList
,
allList
);
clear
(
recordList
,
allList
);
}
}
...
@@ -816,6 +816,7 @@ public class BaiHangFileReportService {
...
@@ -816,6 +816,7 @@ public class BaiHangFileReportService {
if
(
subFile
.
exists
())
{
if
(
subFile
.
exists
())
{
log
.
info
(
"开始上传文件 {} 到百行ftp服务器..."
,
fileName
);
log
.
info
(
"开始上传文件 {} 到百行ftp服务器..."
,
fileName
);
SftpUtil
.
uploadFile
(
sftp
,
baiHangFtpDataDirectory
,
HOST_PATH
+
fileName
);
SftpUtil
.
uploadFile
(
sftp
,
baiHangFtpDataDirectory
,
HOST_PATH
+
fileName
);
log
.
info
(
"文件 {} 已上传到百行ftp服务器"
,
fileName
);
}
}
}
}
}
}
...
...
src/main/resources/cn/quantgroup/report/mapper/master/ApplyLoanInfoZhuDaiMapper.xml
View file @
d7569334
...
@@ -50,5 +50,18 @@
...
@@ -50,5 +50,18 @@
where apply_id = #{applyId,jdbcType=VARCHAR}
where apply_id = #{applyId,jdbcType=VARCHAR}
</select>
</select>
<insert
id=
"batchSaveLog"
parameterType=
"java.util.List"
>
insert into apply_loan_info_zhudai (record_id,req_id,op_code,upload_ts,is_fin_tech_agency_business,apply_date,
apply_id,apply_type,name,id_type,pid,mobile,email_address,edu_background,
degree,guarantee_type,loan_purpose,custom_type,apply_amount,business_org_credit_code,
living_condition,marriage_status,spouse_name)
values
<foreach
collection=
"list"
item=
"item"
index=
"index"
separator=
","
>
(#{recordId},#{reqID},#{opCode},#{uploadTs},#{isFinTechAgencyBusiness},#{applyDate},#{applyId},#{applyType},#{name},#{idType},
#{pid},#{mobile},#{emailAddress},#{eduBackground},#{degree},#{guaranteeType},#{loanPurpose},#{customType},#{applyAmount},
#{businessOrgCreditCode},#{livingCondition},#{marriageStatus},#{spouseName})
</foreach>
</insert>
</mapper>
</mapper>
\ No newline at end of file
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