Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qa-platform
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
QA
qa-platform
Commits
0d94b29d
Commit
0d94b29d
authored
May 11, 2021
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
将上传ocr及提交授信的域名改成by namespace
parent
3ecfef88
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
84 additions
and
3 deletions
+84
-3
Vcc.java
src/main/java/cn/qg/qaplatform/zdata/process/Vcc.java
+78
-0
VccDataServiceImpl.java
...qaplatform/zdata/service/vcc/impl/VccDataServiceImpl.java
+6
-3
No files found.
src/main/java/cn/qg/qaplatform/zdata/process/Vcc.java
View file @
0d94b29d
...
...
@@ -108,6 +108,39 @@ public class Vcc {
log
.
info
(
"上传身份证正面结果:"
+
result
);
}
/**
* 身份证正面-namespace
*/
public
static
void
uploadFrontIdCardNew
(
String
namespace
,
String
vccToken
,
String
uuid
,
String
vccChannel
)
throws
IOException
{
String
url
=
"https://auth-"
+
namespace
+
".liangkebang.net/auth-center/h5/api/ocr/auth_sdk.json"
;
Map
<
String
,
Object
>
headers
=
new
HashMap
<>();
headers
.
put
(
"x-auth-token"
,
vccToken
);
// 待参数化
headers
.
put
(
"vccchannel"
,
vccChannel
);
headers
.
put
(
"content-type"
,
"application/x-www-form-urlencoded"
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"clarity"
,
74
);
map
.
put
(
"multiWarning"
,
"00010010"
);
map
.
put
(
"birth"
,
"19900104"
);
map
.
put
(
"nation"
,
"汉"
);
map
.
put
(
"type"
,
"xyqb"
);
map
.
put
(
"code"
,
0
);
map
.
put
(
"isShootPagePortrait"
,
true
);
map
.
put
(
"address"
,
"北京市海淀区码农村22号"
);
map
.
put
(
"idNo"
,
"320101199001040432"
);
map
.
put
(
"orderNo"
,
uuid
.
concat
(
"1"
));
map
.
put
(
"warning"
,
"00010000"
);
map
.
put
(
"msg"
,
"OCR获取成功"
);
map
.
put
(
"name"
,
"张三"
);
map
.
put
(
"sex"
,
"男"
);
String
frontBase64Str
=
Vcc
.
readTxt
(
"front.txt"
);
map
.
put
(
"base64Str"
,
frontBase64Str
);
params
.
put
(
"idCard"
,
JSON
.
toJSONString
(
map
));
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
log
.
info
(
"上传身份证正面结果:"
+
result
);
}
/**
* 身份证反面
*/
...
...
@@ -137,6 +170,35 @@ public class Vcc {
log
.
info
(
"上传身份证反面:"
+
result
);
}
/**
* 上传身份证反面-namespace
*/
public
static
void
uploadBackIdCardNew
(
String
namespace
,
String
vccToken
,
String
uuid
,
String
vccChannel
)
throws
IOException
{
String
url
=
"https://auth-"
+
namespace
+
".liangkebang.net/auth-center/h5/api/ocr/auth_sdk.json"
;
Map
<
String
,
Object
>
headers
=
new
HashMap
<>();
headers
.
put
(
"x-auth-token"
,
vccToken
);
// 待参数化
headers
.
put
(
"vccchannel"
,
vccChannel
);
headers
.
put
(
"content-type"
,
"application/x-www-form-urlencoded"
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"validDate"
,
"20051008-20251008"
);
map
.
put
(
"authority"
,
"上海市公安局徐汇分局"
);
map
.
put
(
"isShootPagePortrait"
,
false
);
map
.
put
(
"code"
,
0
);
map
.
put
(
"orderNo"
,
uuid
.
concat
(
"2"
));
map
.
put
(
"clarity"
,
60
);
map
.
put
(
"msg"
,
"OCR获取成功"
);
map
.
put
(
"type"
,
"xyqb"
);
map
.
put
(
"warning"
,
"00010000"
);
map
.
put
(
"multiWarning"
,
"00010000"
);
String
backBase64Str
=
Vcc
.
readTxt
(
"back.txt"
);
map
.
put
(
"base64Str"
,
backBase64Str
);
params
.
put
(
"idCard"
,
JsonTransUtils
.
mapToJson
(
map
));
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
log
.
info
(
"上传身份证反面:"
+
result
);
}
/**
* 避免身份证重复,修改
*/
...
...
@@ -178,6 +240,22 @@ public class Vcc {
log
.
info
(
"提交OCR:"
+
result
);
}
/**
* 提交ocr-namespace
*/
public
static
void
submitOcrNew
(
String
namespace
,
String
vccToken
,
String
vccChannel
)
{
String
url
=
"https://auth-"
+
namespace
+
".liangkebang.net/auth-center/h5/api/ocr/submit.json"
;
Map
<
String
,
Object
>
headers
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
headers
.
put
(
"x-auth-token"
,
vccToken
);
headers
.
put
(
"vccchannel"
,
vccChannel
);
headers
.
put
(
"content-type"
,
"application/x-www-form-urlencoded"
);
params
.
put
(
"real_name"
,
"张三"
);
params
.
put
(
"id_card_no"
,
"320101199001040432"
);
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
log
.
info
(
"提交OCR:"
+
result
);
}
/**
* 提交授信
*/
...
...
src/main/java/cn/qg/qaplatform/zdata/service/vcc/impl/VccDataServiceImpl.java
View file @
0d94b29d
...
...
@@ -83,15 +83,18 @@ public class VccDataServiceImpl implements VccDataService {
// credit url
String
vccToken
=
Vcc
.
creditUrl
(
namespace
,
token
,
vccChannel
);
// 身份证正面
Vcc
.
uploadFrontIdCard
(
vccToken
,
uuid
,
vccChannel
);
// Vcc.uploadFrontIdCard(vccToken, uuid, vccChannel);
Vcc
.
uploadFrontIdCardNew
(
namespace
,
vccToken
,
uuid
,
vccChannel
);
// 身份证反面
Vcc
.
uploadBackIdCard
(
vccToken
,
uuid
,
vccChannel
);
// Vcc.uploadBackIdCard(vccToken, uuid, vccChannel);
Vcc
.
uploadBackIdCardNew
(
namespace
,
vccToken
,
uuid
,
vccChannel
);
// 放置身份证重复
Vcc
.
modifyExistIdNo
(
namespace
);
// talos保存用户信息
Vcc
.
saveUserDetails
(
namespace
,
token
,
vccChannel
);
// 提交ocr
Vcc
.
submitOcr
(
vccToken
,
vccChannel
);
// Vcc.submitOcr(vccToken, vccChannel);
Vcc
.
submitOcrNew
(
namespace
,
vccToken
,
vccChannel
);
// 提交授信
Vcc
.
submitCredit
(
namespace
,
token
,
vccChannel
);
// 授信结果查询
...
...
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