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
f22080e2
Commit
f22080e2
authored
Nov 17, 2020
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增用户已有额度判断及状态和渠道判断
parent
1416a0ea
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
7 deletions
+35
-7
GenVccController.java
...in/java/cn/qg/qaplatform/controller/GenVccController.java
+10
-0
GenVccUser.java
src/main/java/cn/qg/qaplatform/domain/GenVccUser.java
+2
-6
Vcc.java
src/main/java/cn/qg/qaplatform/process/Vcc.java
+13
-0
VccDataServiceImpl.java
...ava/cn/qg/qaplatform/service/impl/VccDataServiceImpl.java
+10
-1
No files found.
src/main/java/cn/qg/qaplatform/controller/GenVccController.java
View file @
f22080e2
...
@@ -3,6 +3,8 @@ package cn.qg.qaplatform.controller;
...
@@ -3,6 +3,8 @@ package cn.qg.qaplatform.controller;
import
cn.qg.qaplatform.common.JsonResult
;
import
cn.qg.qaplatform.common.JsonResult
;
import
cn.qg.qaplatform.domain.GenVccUser
;
import
cn.qg.qaplatform.domain.GenVccUser
;
import
cn.qg.qaplatform.service.VccDataService
;
import
cn.qg.qaplatform.service.VccDataService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -10,13 +12,21 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -10,13 +12,21 @@ import org.springframework.web.bind.annotation.RestController;
@RestController
@RestController
@RequestMapping
(
"vcc"
)
@RequestMapping
(
"vcc"
)
@Api
(
tags
=
"vcc造数据"
)
public
class
GenVccController
{
public
class
GenVccController
{
@Autowired
@Autowired
VccDataService
vccDataService
;
VccDataService
vccDataService
;
@PostMapping
(
"/gen"
)
@PostMapping
(
"/gen"
)
@ApiOperation
(
value
=
"vcc造数据"
)
public
JsonResult
genVccUser
(
String
namespace
,
String
phoneNo
,
String
channel
,
Integer
status
)
throws
Exception
{
public
JsonResult
genVccUser
(
String
namespace
,
String
phoneNo
,
String
channel
,
Integer
status
)
throws
Exception
{
if
(
status
!=
0
&&
status
!=
1
)
{
return
JsonResult
.
clientFailed
(
"状态必须为0或者1"
);
}
if
(!
channel
.
equals
(
"214"
)
&&
!
channel
.
equals
(
"217"
))
{
return
JsonResult
.
clientFailed
(
"渠道必须为214或217"
);
}
GenVccUser
result
=
vccDataService
.
makeVccUser
(
namespace
,
phoneNo
,
channel
,
status
);
GenVccUser
result
=
vccDataService
.
makeVccUser
(
namespace
,
phoneNo
,
channel
,
status
);
return
JsonResult
.
success
(
result
);
return
JsonResult
.
success
(
result
);
}
}
...
...
src/main/java/cn/qg/qaplatform/domain/GenVccUser.java
View file @
f22080e2
...
@@ -14,12 +14,6 @@ public class GenVccUser {
...
@@ -14,12 +14,6 @@ public class GenVccUser {
* 开通的渠道
* 开通的渠道
*/
*/
private
String
openedChannel
;
private
String
openedChannel
;
/**
* 开通状态
* 0-授信通过,
*/
private
Integer
status
;
/**
/**
* 额度
* 额度
*/
*/
...
@@ -29,4 +23,6 @@ public class GenVccUser {
...
@@ -29,4 +23,6 @@ public class GenVccUser {
* 卡号
* 卡号
*/
*/
private
String
eacctNo
;
private
String
eacctNo
;
private
String
msg
;
}
}
src/main/java/cn/qg/qaplatform/process/Vcc.java
View file @
f22080e2
...
@@ -290,4 +290,17 @@ public class Vcc {
...
@@ -290,4 +290,17 @@ public class Vcc {
log
.
info
(
"开户结果:"
+
result
);
log
.
info
(
"开户结果:"
+
result
);
return
result
;
return
result
;
}
}
/**
* 查询用户是否已有额度
*/
public
static
boolean
checkIfAlreadyHaveQuota
(
String
namespace
,
String
uuid
)
throws
SQLException
{
DBUtils
dbUtils
=
new
DBUtils
(
namespace
,
"vcc_quota"
,
"qa"
,
"qatest"
);
String
sql
=
"select * from user_quota_record where uuid='"
+
uuid
+
"'"
;
Map
result
=
dbUtils
.
queryForMap
(
sql
);
if
(
result
.
isEmpty
())
{
return
false
;
}
return
true
;
}
}
}
src/main/java/cn/qg/qaplatform/service/impl/VccDataServiceImpl.java
View file @
f22080e2
...
@@ -28,7 +28,8 @@ public class VccDataServiceImpl implements VccDataService {
...
@@ -28,7 +28,8 @@ public class VccDataServiceImpl implements VccDataService {
String
vccChannel
=
null
;
String
vccChannel
=
null
;
if
(
openedChannel
.
equals
(
"214"
))
{
if
(
openedChannel
.
equals
(
"214"
))
{
vccChannel
=
"159904"
;
vccChannel
=
"159904"
;
}
else
if
(
openedChannel
.
equals
(
"217"
))
{
}
if
(
openedChannel
.
equals
(
"217"
))
{
vccChannel
=
"159905"
;
vccChannel
=
"159905"
;
}
}
if
(
vccChannel
==
null
)
{
if
(
vccChannel
==
null
)
{
...
@@ -38,6 +39,12 @@ public class VccDataServiceImpl implements VccDataService {
...
@@ -38,6 +39,12 @@ public class VccDataServiceImpl implements VccDataService {
Map
loginResult
=
Vcc
.
login
(
namespace
,
phoneNo
,
openedChannel
,
openedChannel
);
Map
loginResult
=
Vcc
.
login
(
namespace
,
phoneNo
,
openedChannel
,
openedChannel
);
String
token
=
loginResult
.
get
(
"token"
).
toString
();
String
token
=
loginResult
.
get
(
"token"
).
toString
();
String
uuid
=
loginResult
.
get
(
"uuid"
).
toString
();
String
uuid
=
loginResult
.
get
(
"uuid"
).
toString
();
// 检查用户是否已有额度
boolean
haveQuota
=
Vcc
.
checkIfAlreadyHaveQuota
(
namespace
,
uuid
);
if
(
haveQuota
)
{
genVccUser
.
setMsg
(
"用户已有额度!"
);
return
genVccUser
;
}
// credit url
// credit url
String
vccToken
=
Vcc
.
creditUrl
(
namespace
,
token
,
vccChannel
);
String
vccToken
=
Vcc
.
creditUrl
(
namespace
,
token
,
vccChannel
);
// 身份证正面
// 身份证正面
...
@@ -55,6 +62,7 @@ public class VccDataServiceImpl implements VccDataService {
...
@@ -55,6 +62,7 @@ public class VccDataServiceImpl implements VccDataService {
// 授信结果查询
// 授信结果查询
Vcc
.
searchCreditResult
(
namespace
,
token
,
vccChannel
);
Vcc
.
searchCreditResult
(
namespace
,
token
,
vccChannel
);
if
(
status
==
0
)
{
if
(
status
==
0
)
{
genVccUser
.
setMsg
(
"提交授信成功!"
);
return
genVccUser
;
return
genVccUser
;
}
}
if
(
status
==
1
)
{
if
(
status
==
1
)
{
...
@@ -73,6 +81,7 @@ public class VccDataServiceImpl implements VccDataService {
...
@@ -73,6 +81,7 @@ public class VccDataServiceImpl implements VccDataService {
String
eacctNo
=
data
.
get
(
"eacctNo"
).
toString
();
String
eacctNo
=
data
.
get
(
"eacctNo"
).
toString
();
genVccUser
.
setAmount
(
amount
);
genVccUser
.
setAmount
(
amount
);
genVccUser
.
setEacctNo
(
eacctNo
);
genVccUser
.
setEacctNo
(
eacctNo
);
genVccUser
.
setMsg
(
"开户成功"
);
}
}
return
genVccUser
;
return
genVccUser
;
}
}
...
...
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