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
eb0da298
Commit
eb0da298
authored
Jun 09, 2020
by
郝彦辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
手动修复数据工具5
parent
cd991bf1
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
132 additions
and
0 deletions
+132
-0
ExZhuDaiBaiHangReSendController.java
.../controller/external/ExZhuDaiBaiHangReSendController.java
+10
-0
BaiHangZhuDaiService.java
...antgroup/report/service/baihang/BaiHangZhuDaiService.java
+122
-0
No files found.
src/main/java/cn/quantgroup/report/controller/external/ExZhuDaiBaiHangReSendController.java
View file @
eb0da298
...
...
@@ -394,5 +394,15 @@ public class ExZhuDaiBaiHangReSendController {
}
}
@RequestMapping
(
"/manual/d3_build_err_common"
)
public
String
d3_build_err_common
(
String
p3
,
String
secretKey
,
String
filePath
,
String
opCode
,
String
errorCode
,
Integer
loanStatus
){
if
(
manualToolService
.
checkSecretKey
(
p3
,
secretKey
)){
baiHangZhuDaiService
.
d3_build_err_common
(
filePath
,
opCode
,
errorCode
,
loanStatus
);
return
"d3_build_err_common任务调度完成"
;
}
else
{
return
"d3_build_err_common任务调度失败,参数错误"
;
}
}
}
src/main/java/cn/quantgroup/report/service/baihang/BaiHangZhuDaiService.java
View file @
eb0da298
...
...
@@ -2793,6 +2793,128 @@ public class BaiHangZhuDaiService {
}
//2020.06.09 修复G_001的那些数据
//发现问题,是因为,最后报的一条数据,upload_ts时间反而还比之前报过的upload_ts时间小
@Async
public
String
d3_build_err_common
(
String
filePath
,
String
opCode
,
String
errorCode
,
Integer
loanStatus
)
{
if
(
StringUtils
.
isAnyEmpty
(
filePath
,
opCode
,
errorCode
)){
return
"参数错误"
;
}
//写入文件的路径和前缀
String
writeFilePath
=
""
;
String
file_
=
""
;
if
(
filePath
.
lastIndexOf
(
"/"
)!=-
1
){
//linux
writeFilePath
=
filePath
.
substring
(
0
,
filePath
.
lastIndexOf
(
"/"
))
+
"/build20200609"
;
file_
=
filePath
.
substring
(
filePath
.
lastIndexOf
(
"/"
),
filePath
.
lastIndexOf
(
"."
));
}
else
{
//windows
writeFilePath
=
filePath
.
substring
(
0
,
filePath
.
lastIndexOf
(
"\\"
))
+
"\\build20200609"
;
file_
=
filePath
.
substring
(
filePath
.
lastIndexOf
(
"\\"
),
filePath
.
lastIndexOf
(
"."
));
}
long
starUtc
=
System
.
currentTimeMillis
();
String
SQL_QUERY_D3_log
=
" select d3.* from repayment_loan_info_zhudai d3 "
+
" join tmp_d3_bh_send_log err on d3.record_id=err.req_id and err.op_code='"
+
opCode
+
"' and err.errorCode='"
+
errorCode
+
"' "
+
" where d3.created_at > '2020-06-04 21:50:00' and d3.created_at < '2020-06-05 02:00:00' "
+
" and d3.op_code='"
+
errorCode
+
"' "
+
" and d3.term_status='normal' "
;
if
(
loanStatus
!=
null
){
SQL_QUERY_D3_log
=
SQL_QUERY_D3_log
+
" and d3.loan_status="
+
loanStatus
.
intValue
()+
"; "
;
}
else
{
SQL_QUERY_D3_log
=
SQL_QUERY_D3_log
+
";"
;
}
List
<
RepaymentInfoZhuDai
>
logBeanList
=
riskDatasourceJdbcTemplate
.
query
(
SQL_QUERY_D3_log
,
new
Object
[]{},
new
RowMapper
<
RepaymentInfoZhuDai
>()
{
@Override
public
RepaymentInfoZhuDai
mapRow
(
ResultSet
rs
,
int
rowNum
)
throws
SQLException
{
RepaymentInfoZhuDai
bean
=
new
RepaymentInfoZhuDai
();
bean
.
setRecordId
(
rs
.
getString
(
"record_id"
));
bean
.
setReqID
(
rs
.
getString
(
"req_id"
));
bean
.
setName
(
rs
.
getString
(
"name"
));
bean
.
setPid
(
rs
.
getString
(
"pid"
));
bean
.
setMobile
(
rs
.
getString
(
"mobile"
));
bean
.
setOpCode
(
rs
.
getString
(
"op_code"
));
bean
.
setUploadTs
(
rs
.
getString
(
"upload_ts"
));
bean
.
setLoanId
(
rs
.
getString
(
"loan_id"
));
bean
.
setTermNo
(
rs
.
getInt
(
"term_no"
));
bean
.
setTermStatus
(
rs
.
getString
(
"term_status"
));
bean
.
setTargetRepaymentDate
(
rs
.
getString
(
"target_repayment_date"
));
bean
.
setRealRepaymentDate
(
rs
.
getString
(
"real_repayment_date"
));
bean
.
setPlannedPayment
(
rs
.
getBigDecimal
(
"planned_payment"
));
bean
.
setTargetRepayment
(
rs
.
getBigDecimal
(
"target_repayment"
));
bean
.
setRealRepayment
(
rs
.
getBigDecimal
(
"real_repayment"
));
bean
.
setOverdueAmount
(
rs
.
getBigDecimal
(
"overdue_amount"
));
bean
.
setRemainingAmount
(
rs
.
getBigDecimal
(
"remaining_amount"
));
bean
.
setOverdueStatus
(
rs
.
getString
(
"overdue_status"
));
bean
.
setLoanStatus
(
rs
.
getInt
(
"loan_status"
));
bean
.
setStatusConfirmAt
(
rs
.
getString
(
"status_confirm_at"
));
return
bean
;
}
});
int
fsize
=
logBeanList
.
size
();
log
.
info
(
"查询数据库结束err_common, SQL: {} , 大小: {} , 耗时: {} "
,
filePath
,
fsize
,
(
System
.
currentTimeMillis
()-
starUtc
));
String
sql_d3_max_time
=
" select max(d3.upload_ts) as upload_ts from repayment_loan_info_zhudai d3 where d3.loan_id=?; "
;
for
(
int
i
=
0
;
i
<
fsize
;
i
++)
{
RepaymentInfoZhuDai
repaymentLoanInfo
=
logBeanList
.
get
(
i
);
String
str_old_ups
=
repaymentLoanInfo
.
getUploadTs
();
LocalDateTime
loca_old_ups
=
LocalDateTime
.
parse
(
str_old_ups
);
boolean
queryTime_ok
=
true
;
try
{
List
<
RepaymentInfoZhuDai
>
d3_log_maxList
=
riskDatasourceJdbcTemplate
.
query
(
sql_d3_max_time
,
new
Object
[]{
repaymentLoanInfo
.
getLoanId
()},
new
RowMapper
<
RepaymentInfoZhuDai
>()
{
@Override
public
RepaymentInfoZhuDai
mapRow
(
ResultSet
rs
,
int
rowNum
)
throws
SQLException
{
RepaymentInfoZhuDai
bean
=
new
RepaymentInfoZhuDai
();
//bean.setStatusConfirmAt(rs.getString("status_confirm_at"));
bean
.
setUploadTs
(
rs
.
getString
(
"upload_ts"
));
return
bean
;
}
});
if
(
d3_log_maxList
!=
null
&&
d3_log_maxList
.
size
()
>
0
)
{
String
max_str_ups
=
d3_log_maxList
.
get
(
0
).
getStatusConfirmAt
();
LocalDateTime
max_loca_ups
=
LocalDateTime
.
parse
(
max_str_ups
);
if
(
max_loca_ups
.
compareTo
(
loca_old_ups
)
>
0
)
{
log
.
warn
(
"err_common根据LoanId查询upload_ts结束, str_old_ups: {} , max_str_ups: {} , LoanId: {} , termNo: {} "
,
str_old_ups
,
max_str_ups
,
repaymentLoanInfo
.
getLoanId
(),
repaymentLoanInfo
.
getTermNo
());
str_old_ups
=
max_str_ups
;
}
}
else
{
queryTime_ok
=
false
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"err_common根据LoanId查询upload_ts异常, 原bean:{} "
,
JSONObject
.
toJSONString
(
repaymentLoanInfo
),
e
);
queryTime_ok
=
false
;
}
if
(
queryTime_ok
){
LocalDateTime
loca_new_ups
=
LocalDateTime
.
parse
(
str_old_ups
).
plusMinutes
(
10
);
repaymentLoanInfo
.
setUploadTs
(
loca_new_ups
.
format
(
formatter
));
repaymentLoanInfo
.
setStatusConfirmAt
(
loca_new_ups
.
format
(
formatter
));
//原始文件
this
.
wirteFile
(
writeFilePath
+
file_
+
"_Err_common_"
+
opCode
+
"_"
+
errorCode
+
"_"
+
loanStatus
+
"_saveLog.txt"
,
JSON
.
toJSONString
(
repaymentLoanInfo
)+
"\r\n"
);
//要报送的文件
repaymentLoanInfo
.
setReqID
(
repaymentLoanInfo
.
getRecordId
());
repaymentLoanInfo
.
setRecordId
(
null
);
this
.
wirteFile
(
writeFilePath
+
file_
+
"_Err_common_"
+
opCode
+
"_"
+
errorCode
+
"_"
+
loanStatus
+
"_ok.txt"
,
JSON
.
toJSONString
(
repaymentLoanInfo
)+
"\r\n"
);
}
else
{
this
.
wirteFile
(
writeFilePath
+
file_
+
"_Err_common_"
+
opCode
+
"_"
+
errorCode
+
"_"
+
loanStatus
+
"ERROR_query_upload_ts.txt"
,
JSON
.
toJSONString
(
repaymentLoanInfo
)+
"\r\n"
);
}
log
.
info
(
"err_common处理i:"
+
i
);
}
log
.
info
(
"err_common根据处理数据结束<<<"
);
return
"err_common根据处理数据结束"
;
}
private
static
void
check_ok_d3M_json
(
String
filePath
)
{
long
starUtc
=
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