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
049870b0
Commit
049870b0
authored
Nov 13, 2019
by
郝彦辉
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A1,D2格式校验错误修改。
parent
4e653ae8
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
485 additions
and
22 deletions
+485
-22
ExZhuDaiBaiHangReSendController.java
.../controller/external/ExZhuDaiBaiHangReSendController.java
+44
-0
BaiHangZhuDaiService.java
...antgroup/report/service/baihang/BaiHangZhuDaiService.java
+134
-14
TuoMinUtils.java
...n/quantgroup/report/service/baihang/util/TuoMinUtils.java
+59
-1
ManualToolService.java
...antgroup/report/service/manualTool/ManualToolService.java
+248
-7
No files found.
src/main/java/cn/quantgroup/report/controller/external/ExZhuDaiBaiHangReSendController.java
View file @
049870b0
...
@@ -2,6 +2,11 @@ package cn.quantgroup.report.controller.external;
...
@@ -2,6 +2,11 @@ package cn.quantgroup.report.controller.external;
import
cn.quantgroup.report.response.GlobalResponse
;
import
cn.quantgroup.report.response.GlobalResponse
;
import
cn.quantgroup.report.service.baihang.BaiHangZhuDaiService
;
import
cn.quantgroup.report.service.baihang.BaiHangZhuDaiService
;
import
cn.quantgroup.report.utils.ReadOrWriteTxt
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -9,8 +14,11 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -9,8 +14,11 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.io.File
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
/**
* 百行征信报送出现错误的贷款记录信息重新报送
* 百行征信报送出现错误的贷款记录信息重新报送
...
@@ -247,4 +255,40 @@ public class ExZhuDaiBaiHangReSendController {
...
@@ -247,4 +255,40 @@ public class ExZhuDaiBaiHangReSendController {
}
}
}
}
@RequestMapping
(
"/test/bulidD2"
)
public
GlobalResponse
bulidD2
(
String
jsonFile
){
try
{
String
sourceStr
=
FileUtils
.
readFileToString
(
new
File
(
jsonFile
),
"utf-8"
);
JSONObject
sourceJson
=
JSON
.
parseObject
(
sourceStr
);
JSONArray
recordsJsonArr
=
sourceJson
.
getJSONArray
(
"RECORDS"
);
List
<
String
>
lineList
=
new
ArrayList
<>(
recordsJsonArr
.
size
());
for
(
int
i
=
0
;
i
<
recordsJsonArr
.
size
();
i
++){
lineList
.
add
(
recordsJsonArr
.
get
(
i
).
toString
());
}
baiHangZhuDaiService
.
sendHandLoaInfoReportToBaiHang
(
false
,
lineList
);
return
GlobalResponse
.
generate
(
"百行征信助贷模式手动报送D2数据成功"
);
}
catch
(
Exception
e
){
log
.
error
(
"百行征信助贷模式报送放款异常"
,
e
);
return
GlobalResponse
.
generate
(
"百行征信助贷模式手动报送D2数据失败"
);
}
}
@RequestMapping
(
"/test/bulidA1"
)
public
GlobalResponse
bulidA1
(
String
jsonFile
){
try
{
List
<
String
>
lineList
=
ReadOrWriteTxt
.
readTxtList
(
"D:\\用户目录\\Downloads\\A1_M.txt"
);
System
.
out
.
println
(
"lineList:"
+
lineList
.
size
());
baiHangZhuDaiService
.
build_A1
(
lineList
);
return
GlobalResponse
.
generate
(
"百行征信助贷模式手动报送D2数据成功"
);
}
catch
(
Exception
e
){
log
.
error
(
"百行征信助贷模式报送放款异常"
,
e
);
return
GlobalResponse
.
generate
(
"百行征信助贷模式手动报送D2数据失败"
);
}
}
}
}
src/main/java/cn/quantgroup/report/service/baihang/BaiHangZhuDaiService.java
View file @
049870b0
This diff is collapsed.
Click to expand it.
src/main/java/cn/quantgroup/report/service/baihang/util/TuoMinUtils.java
View file @
049870b0
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
...
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSON;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.tools.ant.Project
;
import
org.apache.tools.ant.Project
;
import
org.apache.tools.ant.taskdefs.Expand
;
import
org.apache.tools.ant.taskdefs.Expand
;
import
org.apache.tools.ant.taskdefs.Zip
;
import
org.apache.tools.ant.taskdefs.Zip
;
...
@@ -14,6 +15,8 @@ import java.io.File;
...
@@ -14,6 +15,8 @@ import java.io.File;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.Random
;
import
java.util.Random
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
public
class
TuoMinUtils
{
public
class
TuoMinUtils
{
...
@@ -72,6 +75,46 @@ public class TuoMinUtils {
...
@@ -72,6 +75,46 @@ public class TuoMinUtils {
}
}
public
static
boolean
checkEmail
(
String
email
)
{
//电子邮件
if
(
StringUtils
.
isBlank
(
email
)){
return
false
;
}
String
regex
=
"^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9]+(-[a-z0-9]+)?\\.)+[a-z]{2,}$"
;
//"^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$"
//"^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$"
//"^\\s*\\w+(?:\\.{0,1}[\\w-]+)*@[a-zA-Z0-9]+(?:[-.][a-zA-Z0-9]+)*\\.[a-zA-Z]+\\s*$"
boolean
b1
=
Pattern
.
compile
(
regex
).
matcher
(
email
).
matches
();
//email.matches(email);
String
ends
=
""
;
if
(
email
.
contains
(
"@"
)){
ends
=
email
.
substring
(
email
.
lastIndexOf
(
"@"
),
email
.
length
());
}
boolean
b2
=
Pattern
.
compile
(
"\\s+"
).
matcher
(
ends
).
find
();;
String
regex2
=
".*[A-Z]+.*"
;
//"[A-Z]*"
boolean
b3
=
Pattern
.
compile
(
regex2
).
matcher
(
ends
).
matches
();
return
b1
&&
!
b2
&&
!
b3
;
}
//判断Email合法性
public
static
boolean
isEmail
(
String
email
)
{
if
(
email
==
null
)
return
false
;
String
rule
=
"[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[\\w](?:[\\w-]*[\\w])?"
;
Pattern
pattern
=
Pattern
.
compile
(
rule
);
Matcher
matcher
=
pattern
.
matcher
(
email
);
if
(
matcher
.
matches
())
return
true
;
else
return
false
;
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
//System.out.println(random_name("郝彦辉"));
//System.out.println(random_name("郝彦辉"));
...
@@ -80,7 +123,7 @@ public class TuoMinUtils {
...
@@ -80,7 +123,7 @@ public class TuoMinUtils {
// System.out.println(random_mobile("18010105506"));
// System.out.println(random_mobile("18010105506"));
String
readAddr
=
"E:\\桌面_工作\\数据备份\\201911061315贷款申请关联用户.json"
;
/*
String readAddr = "E:\\桌面_工作\\数据备份\\201911061315贷款申请关联用户.json";
String writeAddr = "E:\\桌面_工作\\数据备份\\201911061315用户脱敏.txt";
String writeAddr = "E:\\桌面_工作\\数据备份\\201911061315用户脱敏.txt";
try {
try {
long log_stUtc = System.currentTimeMillis();
long log_stUtc = System.currentTimeMillis();
...
@@ -115,7 +158,22 @@ public class TuoMinUtils {
...
@@ -115,7 +158,22 @@ public class TuoMinUtils {
} catch (IOException e) {
} catch (IOException e) {
e.printStackTrace();
e.printStackTrace();
}
}
*/
String
email
=
"630226318@QQ.COM"
;
//String email = "294603191@qq.c0m";
//String email = "139@139.com13902502392";
//System.out.println(checkEmail(email));
//System.out.println(isEmail(email));
System
.
out
.
println
(
checkEmail
(
"630226318@qq.com"
));
System
.
out
.
println
(
checkEmail
(
"630226318@QQ.C OM"
));
System
.
out
.
println
(
checkEmail
(
"630226318@QQ.COM"
));
System
.
out
.
println
(
checkEmail
(
"139@139.com13902502392"
));
System
.
out
.
println
(
checkEmail
(
"294603191@qq.c0m"
));
}
}
}
}
src/main/java/cn/quantgroup/report/service/manualTool/ManualToolService.java
View file @
049870b0
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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