Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
fangxinjiang
yifu-mvp
Commits
bc003539
Commit
bc003539
authored
Aug 17, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check update
parent
8765e70f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
17 deletions
+20
-17
ChecksUtil.java
...n/java/com/yifu/cloud/plus/v1/check/utils/ChecksUtil.java
+15
-11
TCheckBankNoController.java
...loud/plus/v1/check/controller/TCheckBankNoController.java
+1
-1
TCheckBankNoService.java
...yifu/cloud/plus/v1/check/service/TCheckBankNoService.java
+1
-1
TCheckBankNoServiceImpl.java
...d/plus/v1/check/service/impl/TCheckBankNoServiceImpl.java
+3
-4
No files found.
yifu-check/yifu-check-api/src/main/java/com/yifu/cloud/plus/v1/check/utils/ChecksUtil.java
View file @
bc003539
...
...
@@ -30,7 +30,7 @@ public class ChecksUtil {
private
static
final
String
API_URL
=
"https://api.253.com/open/idcard/id-card-auth"
;
private
static
final
String
API_URL_MOBILE
=
"https://api.253.com/open/unn/batch-ucheck"
;
private
static
final
String
API_URL_BANK_NO
=
"https://api.253.com/open/bankcard/card-auth"
;
private
static
final
String
API_URL_BANK_NO_T
HREE
=
"https://api.253.com/open/bankcard/card-two-auth"
;
private
static
final
String
API_URL_BANK_NO_T
WO
=
"https://api.253.com/open/bankcard/card-two-auth"
;
private
static
JsonParser
jsonParser
=
new
JsonParser
();
public
static
void
checkIdCard
(
TCheckIdCard
checkIdCard
,
boolean
canCheck
)
{
...
...
@@ -63,24 +63,19 @@ public class ChecksUtil {
* @Description 银行卡四要素标准版 校验
* @Date 17:50 2022/6/20
* @param name 姓名 是 [string]
* @param idNum 身份证号码,限单个 是 [string]
* @param cardNo 银行卡号,限单个 是 [string]
* @param mobile 银行预留手机号,仅支持国内11位号码
**/
public
static
R
<
TCheckBankNo
>
checkBankNo
(
String
name
,
String
idNum
,
String
cardNo
,
String
mobile
,
boolean
canCheck
)
{
public
static
R
<
TCheckBankNo
>
checkBankNo
Two
(
String
name
,
String
cardNo
,
boolean
canCheck
)
{
if
(
canCheck
)
{
// 1.调用身份信息校验api
return
checkBankNo
Method
(
name
,
idNum
,
cardNo
,
mobile
);
return
checkBankNo
TwoMethod
(
name
,
cardNo
);
}
else
{
return
R
.
failed
(
ChecksConstants
.
NACOS_CHECK_CONFIG_ERROR
);
}
}
private
static
R
<
TCheckBankNo
>
checkBankNoMethod
(
String
name
,
String
idNum
,
String
cardNo
,
String
mobile
)
{
final
JsonObject
jsonObject
=
ChecksUtil
.
invokeBankNo
(
name
,
idNum
,
cardNo
,
mobile
);
private
static
R
<
TCheckBankNo
>
checkBankNoTwoMethod
(
String
name
,
String
cardNo
)
{
final
JsonObject
jsonObject
=
ChecksUtil
.
invokeBankNoTwoAuth
(
name
,
cardNo
);
TCheckBankNo
checkBankNo
=
new
TCheckBankNo
();
// 2.处理返回结果
if
(
jsonObject
!=
null
)
{
...
...
@@ -102,7 +97,6 @@ public class ChecksUtil {
checkBankNo
.
setRemark
(
getJsonElementValue
(
resJson
.
getAsJsonObject
().
get
(
ChecksConstants
.
REMARK
)));
checkBankNo
.
setType
(
CommonConstants
.
ONE_STRING
);
checkBankNo
.
setName
(
name
);
checkBankNo
.
setIdNum
(
idNum
);
}
}
else
{
// 记录错误日志,正式项目中请换成log打印
...
...
@@ -233,4 +227,14 @@ public class ChecksUtil {
// 解析json,并返回结果
return
jsonParser
.
parse
(
result
).
getAsJsonObject
();
}
private
static
JsonObject
invokeBankNoTwoAuth
(
String
name
,
String
cardNo
)
{
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
ChecksConstants
.
APP_ID
,
APP_ID
);
params
.
put
(
ChecksConstants
.
APP_KEY
,
APP_KEY_IDCARD
);
params
.
put
(
ChecksConstants
.
NAME
,
name
);
String
result
=
HttpUtils
.
post
(
API_URL_BANK_NO_TWO
,
params
);
// 解析json,并返回结果
return
jsonParser
.
parse
(
result
).
getAsJsonObject
();
}
}
yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/controller/TCheckBankNoController.java
View file @
bc003539
...
...
@@ -121,6 +121,6 @@ public class TCheckBankNoController {
@Inner
@PostMapping
(
"/inner/checkBankNo"
)
public
CheckBankNoVo
checkBankNoInner
(
@RequestBody
TCheckBankNo
checkBankNo
)
{
return
tCheckBankNoService
.
checkBankNo
(
checkBankNo
.
getName
(),
checkBankNo
.
getIdNum
(),
checkBankNo
.
getBankNo
(),
checkBankNo
.
getMobile
());
return
tCheckBankNoService
.
checkBankNo
Two
(
checkBankNo
.
getName
(),
checkBankNo
.
getBankNo
());
}
}
yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/service/TCheckBankNoService.java
View file @
bc003539
...
...
@@ -30,5 +30,5 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
*/
public
interface
TCheckBankNoService
extends
IService
<
TCheckBankNo
>
{
CheckBankNoVo
checkBankNo
(
String
name
,
String
idNum
,
String
cardNo
,
String
mobile
);
CheckBankNoVo
checkBankNoTwo
(
String
name
,
String
cardNo
);
}
yifu-check/yifu-check-biz/src/main/java/com/yifu/cloud/plus/v1/check/service/impl/TCheckBankNoServiceImpl.java
View file @
bc003539
...
...
@@ -45,10 +45,10 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh
private
final
TCanCheckService
canCheckService
;
@Override
public
CheckBankNoVo
checkBankNo
(
String
name
,
String
idNum
,
String
cardNo
,
String
mobile
)
{
public
CheckBankNoVo
checkBankNo
Two
(
String
name
,
String
cardNo
)
{
R
<
TCheckBankNo
>
res
;
CheckBankNoVo
vo
=
new
CheckBankNoVo
();
if
(
Common
.
isEmpty
(
name
)
||
Common
.
isEmpty
(
idNum
)
||
Common
.
isEmpty
(
cardNo
)){
if
(
Common
.
isEmpty
(
name
)
||
Common
.
isEmpty
(
cardNo
)){
vo
.
setRes
(
R
.
failed
(
MsgUtils
.
getMessage
(
ErrorCodes
.
CHECKS_BANK_NO_REQUEST_PARAM_ERROR
)));
return
vo
;
}
...
...
@@ -56,13 +56,12 @@ public class TCheckBankNoServiceImpl extends ServiceImpl<TCheckBankNoMapper, TCh
TCheckBankNo
checkBankNo
=
baseMapper
.
selectOne
(
Wrappers
.<
TCheckBankNo
>
query
().
lambda
()
.
eq
(
TCheckBankNo:
:
getBankNo
,
cardNo
)
.
eq
(
TCheckBankNo:
:
getName
,
name
)
.
eq
(
TCheckBankNo:
:
getIdNum
,
idNum
)
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
checkBankNo
)){
vo
.
setRes
(
R
.
ok
(
checkBankNo
));
return
vo
;
}
R
<
TCheckBankNo
>
resR
=
ChecksUtil
.
checkBankNo
(
name
,
idNum
,
cardNo
,
mobile
,
canCheckService
.
getCanCheck
());
R
<
TCheckBankNo
>
resR
=
ChecksUtil
.
checkBankNo
Two
(
name
,
cardNo
,
canCheckService
.
getCanCheck
());
if
(
Common
.
isNotNull
(
resR
)
&&
Common
.
isNotNull
(
resR
.
getData
())){
baseMapper
.
insert
(
resR
.
getData
());
}
...
...
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