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
919f020f
Commit
919f020f
authored
Jan 10, 2022
by
陈宏杰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
姓名格式错误
parent
28b3251d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
2 deletions
+48
-2
ManualToolController.java
...cn/quantgroup/report/controller/ManualToolController.java
+1
-1
BaiHangFileReportService.java
...roup/report/service/baihang/BaiHangFileReportService.java
+32
-1
StringUtil.java
src/main/java/cn/quantgroup/report/utils/StringUtil.java
+15
-0
No files found.
src/main/java/cn/quantgroup/report/controller/ManualToolController.java
View file @
919f020f
...
@@ -155,7 +155,7 @@ public class ManualToolController {
...
@@ -155,7 +155,7 @@ public class ManualToolController {
}
}
@RequestMapping
(
"/createFile"
)
@RequestMapping
(
"/createFile"
)
public
String
testD2Repost
(
String
type
,
String
startDate
,
String
endDate
,
Integer
daySpilt
,
String
loanStartDateStr
,
String
loanEndDateStr
,
String
prefix
,
String
linkPointTimeStr
){
public
String
createReportFile
(
String
type
,
String
startDate
,
String
endDate
,
Integer
daySpilt
,
String
loanStartDateStr
,
String
loanEndDateStr
,
String
prefix
,
String
linkPointTimeStr
){
try
{
try
{
fileReportService
.
createReportFile
(
type
,
startDate
,
endDate
,
daySpilt
,
loanStartDateStr
,
loanEndDateStr
,
prefix
,
linkPointTimeStr
);
fileReportService
.
createReportFile
(
type
,
startDate
,
endDate
,
daySpilt
,
loanStartDateStr
,
loanEndDateStr
,
prefix
,
linkPointTimeStr
);
return
"SUCCESS"
;
return
"SUCCESS"
;
...
...
src/main/java/cn/quantgroup/report/service/baihang/BaiHangFileReportService.java
View file @
919f020f
...
@@ -21,6 +21,7 @@ import cn.quantgroup.report.service.http.IHttpService;
...
@@ -21,6 +21,7 @@ import cn.quantgroup.report.service.http.IHttpService;
import
cn.quantgroup.report.utils.DateUtils
;
import
cn.quantgroup.report.utils.DateUtils
;
import
cn.quantgroup.report.utils.IdUtils
;
import
cn.quantgroup.report.utils.IdUtils
;
import
cn.quantgroup.report.utils.SftpUtil
;
import
cn.quantgroup.report.utils.SftpUtil
;
import
cn.quantgroup.report.utils.StringUtil
;
import
cn.quantgroup.report.utils.dingtalk.DingTalk
;
import
cn.quantgroup.report.utils.dingtalk.DingTalk
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
...
@@ -580,6 +581,16 @@ public class BaiHangFileReportService {
...
@@ -580,6 +581,16 @@ public class BaiHangFileReportService {
record
.
setRecordId
(
id
);
record
.
setRecordId
(
id
);
recordList
.
add
(
record
);
recordList
.
add
(
record
);
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setReqID
(
id
);
if
(
StringUtil
.
getLenOfStr
(
repaymentLoanInfo
.
getName
())<=
1.0
)
{
log
.
error
(
"姓名 {} 格式有误,loanId {}"
,
repaymentLoanInfo
.
getName
(),
repaymentLoanInfo
.
getLoanId
());
List
<
ApplyLoanInfoZhuDai
>
zhuDaiLogList
=
applyLoanInfoZhuDaiMapper
.
findByApplyId
(
repaymentLoanInfo
.
getLoanId
());
if
(!
CollectionUtils
.
isEmpty
(
zhuDaiLogList
))
{
repaymentLoanInfo
.
setName
(
zhuDaiLogList
.
get
(
0
).
getName
());
log
.
info
(
"loanId {} , 姓名已更改为 {}"
,
repaymentLoanInfo
.
getLoanId
(),
repaymentLoanInfo
.
getName
());
}
else
{
log
.
error
(
"loanId {} , 姓名未更改"
,
repaymentLoanInfo
.
getLoanId
());
}
}
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
...
@@ -640,7 +651,7 @@ public class BaiHangFileReportService {
...
@@ -640,7 +651,7 @@ public class BaiHangFileReportService {
if
(
stepEndDate
.
compareTo
(
idInfo
.
getRepaymentReceivedAt
())>
0
)
{
if
(
stepEndDate
.
compareTo
(
idInfo
.
getRepaymentReceivedAt
())>
0
)
{
break
;
break
;
}
}
if
(
stepEndDate
.
compareTo
(
DateUtils
.
parseDate
(
"yyyy-MM-dd HH:mm:ss"
,
linkPointTime
))<
0
)
{
if
(
StringUtils
.
isNotBlank
(
linkPointTime
)
&&
stepEndDate
.
compareTo
(
DateUtils
.
parseDate
(
"yyyy-MM-dd HH:mm:ss"
,
linkPointTime
))<
0
)
{
log
.
info
(
"每30天逾期-跳过日期 {} , loanApplicationHistoryId = {}"
,
DateUtils
.
parse
(
stepEndDate
),
idInfo
.
getLoanApplicationHistoryId
());
log
.
info
(
"每30天逾期-跳过日期 {} , loanApplicationHistoryId = {}"
,
DateUtils
.
parse
(
stepEndDate
),
idInfo
.
getLoanApplicationHistoryId
());
step
++;
step
++;
continue
;
continue
;
...
@@ -659,6 +670,16 @@ public class BaiHangFileReportService {
...
@@ -659,6 +670,16 @@ public class BaiHangFileReportService {
record
.
setRecordId
(
id
);
record
.
setRecordId
(
id
);
recordList
.
add
(
record
);
recordList
.
add
(
record
);
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setReqID
(
id
);
if
(
StringUtil
.
getLenOfStr
(
repaymentLoanInfo
.
getName
())<=
1.0
)
{
log
.
error
(
"姓名 {} 格式有误,loanId {}"
,
repaymentLoanInfo
.
getName
(),
repaymentLoanInfo
.
getLoanId
());
List
<
ApplyLoanInfoZhuDai
>
zhuDaiLogList
=
applyLoanInfoZhuDaiMapper
.
findByApplyId
(
repaymentLoanInfo
.
getLoanId
());
if
(!
CollectionUtils
.
isEmpty
(
zhuDaiLogList
))
{
repaymentLoanInfo
.
setName
(
zhuDaiLogList
.
get
(
0
).
getName
());
log
.
info
(
"loanId {} , 姓名已更改为 {}"
,
repaymentLoanInfo
.
getLoanId
(),
repaymentLoanInfo
.
getName
());
}
else
{
log
.
error
(
"loanId {} , 姓名未更改"
,
repaymentLoanInfo
.
getLoanId
());
}
}
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
...
@@ -724,6 +745,16 @@ public class BaiHangFileReportService {
...
@@ -724,6 +745,16 @@ public class BaiHangFileReportService {
record
.
setRecordId
(
id
);
record
.
setRecordId
(
id
);
recordList
.
add
(
record
);
recordList
.
add
(
record
);
repaymentLoanInfo
.
setReqID
(
id
);
repaymentLoanInfo
.
setReqID
(
id
);
if
(
StringUtil
.
getLenOfStr
(
repaymentLoanInfo
.
getName
())<=
1.0
)
{
log
.
error
(
"姓名 {} 格式有误,loanId {}"
,
repaymentLoanInfo
.
getName
(),
repaymentLoanInfo
.
getLoanId
());
List
<
ApplyLoanInfoZhuDai
>
zhuDaiLogList
=
applyLoanInfoZhuDaiMapper
.
findByApplyId
(
repaymentLoanInfo
.
getLoanId
());
if
(!
CollectionUtils
.
isEmpty
(
zhuDaiLogList
))
{
repaymentLoanInfo
.
setName
(
zhuDaiLogList
.
get
(
0
).
getName
());
log
.
info
(
"loanId {} , 姓名已更改为 {}"
,
repaymentLoanInfo
.
getLoanId
(),
repaymentLoanInfo
.
getName
());
}
else
{
log
.
error
(
"loanId {} , 姓名未更改"
,
repaymentLoanInfo
.
getLoanId
());
}
}
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setName
(
sensitiveFilter
(
repaymentLoanInfo
.
getName
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setPid
(
sensitiveFilter
(
repaymentLoanInfo
.
getPid
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
repaymentLoanInfo
.
setMobile
(
sensitiveFilter
(
repaymentLoanInfo
.
getMobile
()));
...
...
src/main/java/cn/quantgroup/report/utils/StringUtil.java
View file @
919f020f
...
@@ -86,4 +86,19 @@ public class StringUtil {
...
@@ -86,4 +86,19 @@ public class StringUtil {
}
}
}
}
public
static
double
getLenOfStr
(
String
s
)
{
double
valueLength
=
0
;
String
chinese
=
"[\u4e00-\u9fa5]"
;
//一个汉字或日韩文长度为1,英文字符长度为0.5
for
(
int
i
=
0
;
i
<
s
.
length
();
i
++)
{
String
temp
=
s
.
substring
(
i
,
i
+
1
);
if
(
temp
.
matches
(
chinese
))
{
valueLength
+=
1
;
}
else
{
valueLength
+=
0.5
;
}
}
return
Math
.
ceil
(
valueLength
);
}
}
}
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