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
5514970f
Commit
5514970f
authored
Sep 06, 2020
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新乐信
parent
65d302d3
Changes
19
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
1271 additions
and
350 deletions
+1271
-350
pom.xml
pom.xml
+6
-0
ChannelEnum.java
src/main/java/cn/qg/qaplatform/common/enums/ChannelEnum.java
+2
-1
FundEnum.java
src/main/java/cn/qg/qaplatform/common/enums/FundEnum.java
+2
-1
GenLoanUserDataController.java
...n/qg/qaplatform/controller/GenLoanUserDataController.java
+59
-44
ApplyDataVo.java
src/main/java/cn/qg/qaplatform/domain/ApplyDataVo.java
+50
-0
ApplyLoanInfo.java
src/main/java/cn/qg/qaplatform/domain/ApplyLoanInfo.java
+0
-71
Common.java
src/main/java/cn/qg/qaplatform/process/Common.java
+135
-0
Lexin.java
src/main/java/cn/qg/qaplatform/process/Lexin.java
+155
-0
Xyqb.java
src/main/java/cn/qg/qaplatform/process/Xyqb.java
+5
-5
LexinDataService.java
src/main/java/cn/qg/qaplatform/service/LexinDataService.java
+12
-0
QueryInProcessStatusService.java
...cn/qg/qaplatform/service/QueryInProcessStatusService.java
+16
-0
XyqbDataService.java
src/main/java/cn/qg/qaplatform/service/XyqbDataService.java
+10
-11
LexinDataServiceImpl.java
...a/cn/qg/qaplatform/service/impl/LexinDataServiceImpl.java
+86
-0
QueryInProcessStatusServiceImpl.java
...latform/service/impl/QueryInProcessStatusServiceImpl.java
+58
-0
XyqbDataServiceImpl.java
...va/cn/qg/qaplatform/service/impl/XyqbDataServiceImpl.java
+108
-152
LexinEncrypt.java
...ain/java/cn/qg/qaplatform/utils/Encrypt/LexinEncrypt.java
+292
-0
HttpClientUtils.java
src/main/java/cn/qg/qaplatform/utils/HttpClientUtils.java
+6
-2
Lexin.java
src/test/java/cn/qg/qaplatform/test/Lexin.java
+200
-0
Xyqb.java
src/test/java/cn/qg/qaplatform/test/Xyqb.java
+69
-63
No files found.
pom.xml
View file @
5514970f
...
@@ -165,6 +165,12 @@
...
@@ -165,6 +165,12 @@
<artifactId>
spring-boot-starter-websocket
</artifactId>
<artifactId>
spring-boot-starter-websocket
</artifactId>
</dependency>
</dependency>
<dependency>
<groupId>
javax.validation
</groupId>
<artifactId>
validation-api
</artifactId>
<version>
2.0.1.Final
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
src/main/java/cn/qg/qaplatform/common/enums/ChannelEnum.java
View file @
5514970f
...
@@ -5,7 +5,8 @@ package cn.qg.qaplatform.common.enums;
...
@@ -5,7 +5,8 @@ package cn.qg.qaplatform.common.enums;
*/
*/
public
enum
ChannelEnum
{
public
enum
ChannelEnum
{
XYQB
(
"信用钱包"
,
1
);
XYQB
(
"信用钱包"
,
1
),
LEXIN
(
"乐信"
,
159886
);
private
String
name
;
private
String
name
;
private
Integer
channelId
;
private
Integer
channelId
;
...
...
src/main/java/cn/qg/qaplatform/common/enums/FundEnum.java
View file @
5514970f
...
@@ -7,7 +7,8 @@ public enum FundEnum {
...
@@ -7,7 +7,8 @@ public enum FundEnum {
GYXD
(
"广达小贷"
,
480
),
GYXD
(
"广达小贷"
,
480
),
YNXT
(
"云南信托"
,
1040
),
YNXT
(
"云南信托"
,
1040
),
PDSB
(
"平顶山银行"
,
1030
);
PDSB
(
"平顶山银行"
,
1030
),
GDLX
(
"广达乐信"
,
1010
);
private
String
name
;
private
String
name
;
private
Integer
fundId
;
private
Integer
fundId
;
...
...
src/main/java/cn/qg/qaplatform/controller/GenLoanUserDataController.java
View file @
5514970f
...
@@ -3,18 +3,19 @@ package cn.qg.qaplatform.controller;
...
@@ -3,18 +3,19 @@ package cn.qg.qaplatform.controller;
import
cn.qg.qaplatform.common.JsonResult
;
import
cn.qg.qaplatform.common.JsonResult
;
import
cn.qg.qaplatform.common.enums.ChannelEnum
;
import
cn.qg.qaplatform.common.enums.ChannelEnum
;
import
cn.qg.qaplatform.common.enums.FundEnum
;
import
cn.qg.qaplatform.common.enums.FundEnum
;
import
cn.qg.qaplatform.domain.Apply
LoanInf
o
;
import
cn.qg.qaplatform.domain.Apply
DataV
o
;
import
cn.qg.qaplatform.domain.GenLoanUser
;
import
cn.qg.qaplatform.domain.GenLoanUser
;
import
cn.qg.qaplatform.service.GenUserDataService
;
import
cn.qg.qaplatform.service.LexinDataService
;
import
cn.qg.qaplatform.service.XyqbDataService
;
import
cn.qg.qaplatform.service.QueryBasicLoanStatusDataService
;
import
cn.qg.qaplatform.service.QueryBasicLoanStatusDataService
;
import
cn.qg.qaplatform.utils.EnumUtils
;
import
cn.qg.qaplatform.utils.EnumUtils
;
import
cn.qg.qaplatform.utils.RandomDataUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
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.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.LinkedList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -25,53 +26,24 @@ import java.util.Map;
...
@@ -25,53 +26,24 @@ import java.util.Map;
public
class
GenLoanUserDataController
{
public
class
GenLoanUserDataController
{
@Autowired
@Autowired
GenUserDataService
genUserDataService
;
XyqbDataService
xyqbDataService
;
@Autowired
LexinDataService
lexinDataService
;
@Autowired
@Autowired
QueryBasicLoanStatusDataService
queryBasicLoanStatusDataService
;
QueryBasicLoanStatusDataService
queryBasicLoanStatusDataService
;
@ApiOperation
(
value
=
"造数据接口"
)
@ApiOperation
(
value
=
"造数据接口"
)
@PostMapping
(
"/loanUser"
)
@PostMapping
(
"/data"
)
public
JsonResult
genLoanUserData
(
@RequestBody
ApplyLoanInfo
applyLoanInfo
)
throws
Exception
{
public
JsonResult
genLoanUserData
(
@RequestBody
ApplyDataVo
applyDataVo
)
throws
Exception
{
if
(
applyLoanInfo
.
getNamespace
()
==
null
)
{
boolean
result
=
false
;
return
JsonResult
.
clientFailed
(
"namespace不能为空!"
);
if
(
applyDataVo
.
getChannel
().
equals
(
ChannelEnum
.
XYQB
.
getChannelId
()))
{
}
result
=
xyqbDataService
.
genLoanUser
(
applyDataVo
);
if
(
applyLoanInfo
.
getChannel
()
==
null
)
{
return
JsonResult
.
clientFailed
(
"渠道不能为空!"
);
}
if
(
applyLoanInfo
.
getFundId
()
==
null
)
{
return
JsonResult
.
clientFailed
(
"资方不能为空!"
);
}
if
(
applyLoanInfo
.
getStatus
()
==
null
)
{
return
JsonResult
.
clientFailed
(
"借款状态不能为空!"
);
}
// 如果手机号为空,则生成一个user库里没有的手机号
if
(
applyLoanInfo
.
getPhoneNo
()
==
null
)
{
while
(
true
)
{
String
phoneNo
=
RandomDataUtils
.
createMobile
();
if
(!
queryBasicLoanStatusDataService
.
queryIfPhoneExist
(
applyLoanInfo
.
getNamespace
(),
phoneNo
))
{
applyLoanInfo
.
setPhoneNo
(
phoneNo
);
break
;
}
}
}
}
if
(
apply
LoanInfo
.
getAmount
()
==
null
)
{
if
(
apply
DataVo
.
getChannel
().
equals
(
ChannelEnum
.
LEXIN
.
getChannelId
())
)
{
applyLoanInfo
.
setAmount
(
10000
);
result
=
lexinDataService
.
genLexinData
(
applyDataVo
);
}
}
if
(
applyLoanInfo
.
getTerm
()
==
null
)
{
applyLoanInfo
.
setTerm
(
6
);
}
if
(
applyLoanInfo
.
getName
()
==
null
)
{
applyLoanInfo
.
setName
(
"刘志国"
);
}
if
(
applyLoanInfo
.
getCardNo
()
==
null
)
{
applyLoanInfo
.
setCardNo
(
"6222800003478997463"
);
applyLoanInfo
.
setBankCode
(
"CCB"
);
}
if
(
applyLoanInfo
.
getBankCode
()
==
null
)
{
applyLoanInfo
.
setBankCode
(
"CCB"
);
}
boolean
result
=
genUserDataService
.
genLoanUser
(
applyLoanInfo
);
return
JsonResult
.
success
(
result
);
return
JsonResult
.
success
(
result
);
}
}
...
@@ -90,8 +62,51 @@ public class GenLoanUserDataController {
...
@@ -90,8 +62,51 @@ public class GenLoanUserDataController {
@GetMapping
(
"/userStatus"
)
@GetMapping
(
"/userStatus"
)
public
JsonResult
queryUserStatus
(
@RequestParam
String
namespace
,
public
JsonResult
queryUserStatus
(
@RequestParam
String
namespace
,
@RequestParam
String
phoneNo
)
{
@RequestParam
String
phoneNo
)
{
GenLoanUser
genLoanUser
=
genUser
DataService
.
queryUserStatus
(
namespace
,
phoneNo
);
GenLoanUser
genLoanUser
=
xyqb
DataService
.
queryUserStatus
(
namespace
,
phoneNo
);
return
JsonResult
.
success
(
genLoanUser
);
return
JsonResult
.
success
(
genLoanUser
);
}
}
@GetMapping
(
"/channelMappedFund"
)
public
JsonResult
mapFund
(
@RequestParam
Integer
channel
)
{
List
<
Map
<
String
,
Object
>>
supportFund
=
EnumUtils
.
enumToListMap
(
FundEnum
.
class
);
List
<
Map
>
resultFundList
=
new
LinkedList
<>();
if
(
channel
==
1
)
{
for
(
Map
<
String
,
Object
>
temp:
supportFund
)
{
if
(
temp
.
get
(
"fundId"
).
equals
(
480
)
||
temp
.
get
(
"fundId"
).
equals
(
1030
)
||
temp
.
get
(
"fundId"
).
equals
(
1040
))
{
resultFundList
.
add
(
temp
);
}
}
}
if
(
channel
==
159886
)
{
for
(
Map
<
String
,
Object
>
temp:
supportFund
)
{
if
(
temp
.
get
(
"fundId"
).
equals
(
1010
))
{
resultFundList
.
add
(
temp
);
}
}
}
return
JsonResult
.
success
(
resultFundList
);
}
@GetMapping
(
"/fundMappedChannel"
)
public
JsonResult
mapChannel
(
@RequestParam
Integer
fundId
)
{
List
<
Map
<
String
,
Object
>>
supportChannel
=
EnumUtils
.
enumToListMap
(
ChannelEnum
.
class
);
List
<
Map
>
resultChannelList
=
new
LinkedList
<>();
if
(
fundId
==
480
||
fundId
==
1030
||
fundId
==
1040
)
{
for
(
Map
<
String
,
Object
>
temp:
supportChannel
)
{
if
(
temp
.
get
(
"channelId"
).
equals
(
1
))
{
resultChannelList
.
add
(
temp
);
}
}
}
if
(
fundId
==
1010
)
{
for
(
Map
<
String
,
Object
>
temp:
supportChannel
)
{
if
(
temp
.
get
(
"channelId"
).
equals
(
159886
))
{
resultChannelList
.
add
(
temp
);
}
}
}
return
JsonResult
.
success
(
resultChannelList
);
}
}
}
src/main/java/cn/qg/qaplatform/domain/ApplyDataVo.java
0 → 100644
View file @
5514970f
package
cn
.
qg
.
qaplatform
.
domain
;
import
lombok.Data
;
import
javax.validation.constraints.NotNull
;
/**
* 造Xyqb数据传递的参数实体类
*/
@Data
public
class
ApplyDataVo
{
@NotNull
(
message
=
"借款状态不能为空!"
)
private
Integer
status
;
@NotNull
(
message
=
"环境不能为空!"
)
private
String
namespace
;
@NotNull
(
message
=
"手机号不能为空!"
)
private
String
phoneNo
;
private
Integer
channel
=
1
;
private
Integer
fundId
=
480
;
private
Integer
amount
=
10000
;
private
Integer
term
=
3
;
private
Integer
rate
;
private
String
name
=
"刘志国"
;
private
String
idCardNo
=
"330212198511195794"
;
private
String
bankCardNo
=
"6222800003478997463"
;
private
String
bankName
=
"中国建设银行"
;
private
String
bankCode
=
"CCB"
;
private
Integer
fixedBillDay
=
2
;
private
Integer
fixedRepayDay
=
12
;
/**
* websocket通信标志位
*/
private
String
symbol
=
null
;
}
src/main/java/cn/qg/qaplatform/domain/ApplyLoanInfo.java
deleted
100644 → 0
View file @
65d302d3
package
cn
.
qg
.
qaplatform
.
domain
;
import
lombok.Data
;
/**
* 造数据传递的参数实体类
*/
@Data
public
class
ApplyLoanInfo
{
/**
* 状态
*/
private
Integer
status
;
/**
* 环境
*/
private
String
namespace
;
/**
* 手机号
*/
private
String
phoneNo
;
/**
* 渠道
*/
private
Integer
channel
;
/**
* 资方
*/
private
Integer
fundId
;
/**
* 借款金额
*/
private
Integer
amount
;
/**
* 借款期数
*/
private
Integer
term
;
/**
* 姓名
*/
private
String
name
;
/**
* 身份证号
*/
private
String
idNo
;
/**
* 银行卡号
*/
private
String
cardNo
;
/**
* 银行code
*/
private
String
bankCode
;
/**
* websocket通信标志位
*/
private
String
symbol
;
}
src/main/java/cn/qg/qaplatform/process/Common.java
0 → 100644
View file @
5514970f
package
cn
.
qg
.
qaplatform
.
process
;
import
cn.qg.qaplatform.config.WebSocketServer
;
import
cn.qg.qaplatform.utils.DBUtils
;
import
cn.qg.qaplatform.utils.Encrypt.LexinEncrypt
;
import
cn.qg.qaplatform.utils.HttpClientUtils
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
io.swagger.models.auth.In
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.DigestUtils
;
import
java.net.URISyntaxException
;
import
java.sql.SQLException
;
import
java.util.*
;
@Slf4j
public
class
Common
{
public
static
String
MD5Keywy
=
"qEAxMJBv"
;
public
static
String
AESKeywy
=
"sxD8KO79EDK0N0AJ"
;
/**
* 登录KA联调平台
*/
public
static
String
loginKA
(
String
namespace
)
{
String
url
=
"http://boss-"
+
namespace
+
".liangkebang.net/login"
;
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"username"
,
"wenhaiyuan"
);
params
.
put
(
"password"
,
"123"
);
String
jsonParams
=
JSON
.
toJSONString
(
params
);
JSONObject
result
=
HttpClientUtils
.
doPostJson
(
url
,
jsonParams
);
System
.
out
.
println
(
result
);
return
result
.
get
(
"data"
).
toString
();
}
/**
* 渠道订单审核通过
*/
public
static
boolean
channelOrderApprove
(
String
namespace
,
String
orderNo
,
Integer
amount
,
String
fundType
,
boolean
isPass
,
Integer
term
)
{
String
token
=
loginKA
(
namespace
);
String
url
=
"http://boss-"
+
namespace
+
".liangkebang.net/order/approve"
;
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
headers
=
new
HashMap
<>();
headers
.
put
(
"Content-Type"
,
"application/json"
);
headers
.
put
(
"boss-token"
,
token
);
params
.
put
(
"amount"
,
amount
.
toString
());
params
.
put
(
"channelOrderNumber"
,
orderNo
);
params
.
put
(
"fundType"
,
fundType
);
params
.
put
(
"isPass"
,
isPass
);
params
.
put
(
"period"
,
term
);
String
jsonParams
=
JSON
.
toJSONString
(
params
);
JSONObject
result
=
HttpClientUtils
.
doPostJson
(
url
,
jsonParams
,
headers
);
System
.
out
.
println
(
result
);
return
(
boolean
)
result
.
get
(
"data"
);
}
/**
* 提现
*/
public
static
boolean
withDraw
(
String
namespace
,
String
channelCode
,
String
channelOrderNumber
,
String
bankCardNumber
,
String
bankCode
,
String
bankName
,
String
reservePhoneNumber
)
{
String
url
=
"http://qapi-"
+
namespace
+
".liangkebang.net/ex/api/v2/withdraw/"
+
channelCode
;
Map
<
String
,
Object
>
bizData
=
new
HashMap
<>();
bizData
.
put
(
"channelOrderNumber"
,
channelOrderNumber
);
bizData
.
put
(
"bankCardNumber"
,
bankCardNumber
);
bizData
.
put
(
"bankCode"
,
bankCode
);
bizData
.
put
(
"bankName"
,
bankName
);
bizData
.
put
(
"reservePhoneNumber"
,
reservePhoneNumber
);
String
bizDataStr
=
JSONObject
.
toJSONString
(
bizData
);
String
signStr
=
DigestUtils
.
md5DigestAsHex
((
bizDataStr
+
MD5Keywy
).
getBytes
()).
toLowerCase
();
Map
<
String
,
String
>
content
=
new
HashMap
<>();
content
.
put
(
"sign"
,
signStr
);
content
.
put
(
"bizData"
,
bizDataStr
);
String
contentStr
=
LexinEncrypt
.
encryptAndBase64Encode
(
JSONObject
.
toJSONString
(
content
),
AESKeywy
);
Map
<
String
,
Object
>
headers
=
new
HashMap
<>();
headers
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
"content="
+
contentStr
);
String
response
=
LexinEncrypt
.
decryptAfterBase64Decode
(
result
.
get
(
"content"
).
toString
(),
AESKeywy
);
log
.
info
(
"提现后结果为:"
+
response
);
return
true
;
}
/**
* 查询渠道订单号
*/
public
static
String
queryChannelOrderNoByPhone
(
String
namespace
,
String
phoneNo
,
Integer
channel
)
throws
SQLException
{
String
userId
=
Xyqb
.
checkUserId
(
namespace
,
phoneNo
).
get
(
"id"
).
toString
();
String
sql
=
"SELECT channel_order_no FROM order_mapping WHERE qg_user_id="
+
userId
+
" and registered_from="
+
channel
+
" order by id desc limit 0,1"
;
DBUtils
dbUtils
=
new
DBUtils
(
namespace
,
"cash_loan_flow"
,
"qa"
,
"qatest"
);
Map
map
=
dbUtils
.
queryForMap
(
sql
);
String
channelOrderNo
=
map
.
get
(
"channel_order_no"
).
toString
();
log
.
info
(
"{}查询到的渠道订单号为:{}"
,
phoneNo
,
channelOrderNo
);
return
channelOrderNo
;
}
/**
* 查询loanId
*/
public
static
Integer
queryLoanId
(
String
namespace
,
String
phoneNo
,
Integer
channel
)
throws
SQLException
{
String
userId
=
Xyqb
.
checkUserId
(
namespace
,
phoneNo
).
get
(
"id"
).
toString
();
String
sql
=
"SELECT id FROM loan_application_history WHERE user_id="
+
userId
+
" order by id desc limit 0,1"
;
DBUtils
dbUtils
=
new
DBUtils
(
namespace
,
"xyqb"
,
"qa"
,
"qatest"
);
Map
map
=
dbUtils
.
queryForMap
(
sql
);
String
loanId
=
map
.
get
(
"id"
).
toString
();
log
.
info
(
"{}查询到的loanId为:{}"
,
phoneNo
,
loanId
);
return
Integer
.
parseInt
(
loanId
);
}
public
static
boolean
assignFundCorp
(
String
namespace
,
Integer
fundId
)
{
// 登录资金方OP
String
fundOpToken
=
Xyqb
.
loginFundOP
(
namespace
);
boolean
isAleadyAssign
=
false
;
// 检查是否已分配资产计划
try
{
isAleadyAssign
=
Xyqb
.
assignFundOrNot
(
namespace
,
fundId
,
fundOpToken
);
}
catch
(
URISyntaxException
e
)
{
e
.
printStackTrace
();
}
boolean
assignResult
=
false
;
boolean
unblockResult
=
false
;
// 如果未分配
if
(!
isAleadyAssign
)
{
// 分配资产计划
assignResult
=
Xyqb
.
setFundPlan
(
namespace
,
fundId
,
fundOpToken
);
// 打开推送放款
unblockResult
=
Xyqb
.
unblockLoan
(
namespace
,
fundId
,
fundOpToken
);
if
(
assignResult
&&
unblockResult
)
{
return
true
;
}
return
false
;
}
else
{
return
true
;
}
}
}
src/main/java/cn/qg/qaplatform/process/Lexin.java
0 → 100644
View file @
5514970f
This diff is collapsed.
Click to expand it.
src/main/java/cn/qg/qaplatform/process/
xyqb/MainProcess
.java
→
src/main/java/cn/qg/qaplatform/process/
Xyqb
.java
View file @
5514970f
package
cn
.
qg
.
qaplatform
.
process
.
xyqb
;
package
cn
.
qg
.
qaplatform
.
process
;
import
cn.qg.qaplatform.config.WebSocketServer
;
import
cn.qg.qaplatform.config.WebSocketServer
;
import
cn.qg.qaplatform.utils.DBUtils
;
import
cn.qg.qaplatform.utils.DBUtils
;
...
@@ -19,7 +19,7 @@ import java.util.List;
...
@@ -19,7 +19,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
@Slf4j
@Slf4j
public
class
MainProcess
{
public
class
Xyqb
{
public
static
String
symbol
=
null
;
public
static
String
symbol
=
null
;
...
@@ -68,7 +68,7 @@ public class MainProcess {
...
@@ -68,7 +68,7 @@ public class MainProcess {
DBUtils
dbUtils
=
new
DBUtils
(
namespace
,
"xyqb_user"
,
"qa"
,
"qatest"
);
DBUtils
dbUtils
=
new
DBUtils
(
namespace
,
"xyqb_user"
,
"qa"
,
"qatest"
);
Map
result
=
dbUtils
.
queryForMap
(
sql
);
Map
result
=
dbUtils
.
queryForMap
(
sql
);
String
uuid
=
result
.
get
(
"uuid"
).
toString
();
String
uuid
=
result
.
get
(
"uuid"
).
toString
();
Long
userId
=
(
Long
)
result
.
get
(
"id"
);
String
userId
=
result
.
get
(
"id"
).
toString
(
);
log
.
info
(
"查询用户中心结果: "
+
result
);
log
.
info
(
"查询用户中心结果: "
+
result
);
if
(
symbol
!=
null
)
{
if
(
symbol
!=
null
)
{
WebSocketServer
.
sendInfo
(
"查询用户中心id:"
+
result
,
symbol
);
WebSocketServer
.
sendInfo
(
"查询用户中心id:"
+
result
,
symbol
);
...
@@ -521,7 +521,7 @@ public class MainProcess {
...
@@ -521,7 +521,7 @@ public class MainProcess {
/**
/**
* 二次风控
* 二次风控
*/
*/
public
static
boolean
externalQuotaOrderAuditNotify
(
String
namespace
,
String
token
,
String
uuid
,
Integer
loanId
,
Integer
bizType
,
boolean
auditResult
)
{
public
static
boolean
externalQuotaOrderAuditNotify
(
String
namespace
,
Integer
bizChannel
,
String
token
,
String
uuid
,
Integer
loanId
,
Integer
bizType
,
boolean
auditResult
)
{
String
url
=
"http://clotho-"
+
namespace
+
".liangkebang.net"
+
"/external/quota/order_audit/notify"
;
String
url
=
"http://clotho-"
+
namespace
+
".liangkebang.net"
+
"/external/quota/order_audit/notify"
;
Map
<
String
,
Object
>
headers
=
new
HashMap
<>();
Map
<
String
,
Object
>
headers
=
new
HashMap
<>();
headers
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
headers
.
put
(
"Content-Type"
,
"application/x-www-form-urlencoded"
);
...
@@ -529,7 +529,7 @@ public class MainProcess {
...
@@ -529,7 +529,7 @@ public class MainProcess {
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"code"
,
0
);
params
.
put
(
"code"
,
0
);
params
.
put
(
"msg"
,
"success"
);
params
.
put
(
"msg"
,
"success"
);
params
.
put
(
"bizChannel"
,
1
);
params
.
put
(
"bizChannel"
,
bizChannel
);
params
.
put
(
"uuid"
,
uuid
);
params
.
put
(
"uuid"
,
uuid
);
params
.
put
(
"bizNo"
,
loanId
);
params
.
put
(
"bizNo"
,
loanId
);
params
.
put
(
"bizType"
,
bizType
);
params
.
put
(
"bizType"
,
bizType
);
...
...
src/main/java/cn/qg/qaplatform/service/LexinDataService.java
0 → 100644
View file @
5514970f
package
cn
.
qg
.
qaplatform
.
service
;
import
cn.qg.qaplatform.domain.ApplyDataVo
;
/**
* 乐信数据
* @author libo
*/
public
interface
LexinDataService
{
boolean
genLexinData
(
ApplyDataVo
applyDataVo
)
throws
Exception
;
}
src/main/java/cn/qg/qaplatform/service/QueryInProcessStatusService.java
0 → 100644
View file @
5514970f
package
cn
.
qg
.
qaplatform
.
service
;
/**
* 查询造数据流程中的状态
*/
public
interface
QueryInProcessStatusService
{
/**
* 查询资方分配的进度
*/
void
queryFundingAssignProgress
(
String
namespace
,
String
phoneNo
,
Integer
fundId
,
String
symbol
)
throws
InterruptedException
;
/**
* 查询发起提现的进度
*/
void
queryLoanProgress
(
String
namespace
,
String
phoneNo
,
String
symbol
)
throws
InterruptedException
;
}
src/main/java/cn/qg/qaplatform/service/
GenUser
DataService.java
→
src/main/java/cn/qg/qaplatform/service/
Xyqb
DataService.java
View file @
5514970f
package
cn
.
qg
.
qaplatform
.
service
;
package
cn
.
qg
.
qaplatform
.
service
;
import
cn.qg.qaplatform.domain.Apply
LoanInf
o
;
import
cn.qg.qaplatform.domain.Apply
DataV
o
;
import
cn.qg.qaplatform.domain.GenLoanUser
;
import
cn.qg.qaplatform.domain.GenLoanUser
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.sql.SQLException
;
public
interface
GenUser
DataService
{
public
interface
Xyqb
DataService
{
/**
/**
* 分配资金方
* 分配资金方
...
@@ -15,32 +14,32 @@ public interface GenUserDataService {
...
@@ -15,32 +14,32 @@ public interface GenUserDataService {
/**
/**
* 授信
* 授信
* @param apply
LoanInf
o 造数据的相关信息
* @param apply
DataV
o 造数据的相关信息
* @return 成功或失败
* @return 成功或失败
*/
*/
boolean
quotaAuth
(
Apply
LoanInfo
applyLoanInf
o
,
boolean
auditResult
)
throws
Exception
;
boolean
quotaAuth
(
Apply
DataVo
applyDataV
o
,
boolean
auditResult
)
throws
Exception
;
/**
/**
* 提现
* 提现
* @param apply
LoanInf
o 造数据相关信息
* @param apply
DataV
o 造数据相关信息
* @return 成功或失败
* @return 成功或失败
*/
*/
boolean
withDraw
(
Apply
LoanInfo
applyLoanInf
o
,
boolean
auditResult
)
throws
Exception
;
boolean
withDraw
(
Apply
DataVo
applyDataV
o
,
boolean
auditResult
)
throws
Exception
;
/**
/**
* 放款
* 放款
* @param apply
LoanInf
o
* @param apply
DataV
o
* @return
* @return
*/
*/
boolean
makeLoan
(
Apply
LoanInfo
applyLoanInfo
,
boolean
payStatus
)
throws
Exception
;
boolean
makeLoan
(
Apply
DataVo
applyDataVo
,
boolean
payStatus
)
throws
Exception
;
/**
/**
* 造数据
* 造数据
* @param apply
LoanInf
o
* @param apply
DataV
o
* @return
* @return
* @throws Exception
* @throws Exception
*/
*/
boolean
genLoanUser
(
Apply
LoanInfo
applyLoanInf
o
)
throws
Exception
;
boolean
genLoanUser
(
Apply
DataVo
applyDataV
o
)
throws
Exception
;
/**
/**
* 获取用户状态
* 获取用户状态
...
...
src/main/java/cn/qg/qaplatform/service/impl/LexinDataServiceImpl.java
0 → 100644
View file @
5514970f
package
cn
.
qg
.
qaplatform
.
service
.
impl
;
import
cn.qg.qaplatform.common.enums.ChannelEnum
;
import
cn.qg.qaplatform.domain.ApplyDataVo
;
import
cn.qg.qaplatform.process.Common
;
import
cn.qg.qaplatform.process.Lexin
;
import
cn.qg.qaplatform.process.Xyqb
;
import
cn.qg.qaplatform.service.QueryInProcessStatusService
;
import
cn.qg.qaplatform.service.LexinDataService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
java.util.Map
;
@Service
@Slf4j
public
class
LexinDataServiceImpl
implements
LexinDataService
{
@Autowired
QueryInProcessStatusService
queryInProcessStatusService
;
@Autowired
RedisTemplate
redisTemplate
;
@Override
public
boolean
genLexinData
(
ApplyDataVo
applyDataVo
)
throws
Exception
{
String
namespace
=
applyDataVo
.
getNamespace
();
String
phoneNo
=
applyDataVo
.
getPhoneNo
();
String
bankCardNo
=
applyDataVo
.
getBankCardNo
();
String
bankCode
=
applyDataVo
.
getBankCode
();
String
bankName
=
applyDataVo
.
getBankName
();
Integer
fundId
=
applyDataVo
.
getFundId
();
String
symbol
=
applyDataVo
.
getSymbol
();
Integer
amount
=
applyDataVo
.
getAmount
();
Integer
term
=
applyDataVo
.
getTerm
();
Xyqb
.
symbol
=
symbol
;
// 分配资产计划
boolean
fundAssignResult
=
Common
.
assignFundCorp
(
namespace
,
fundId
);
// 进件
boolean
createOrderResult
=
Lexin
.
createOrder
(
applyDataVo
);
setUserStatusRedisValue
(
namespace
,
phoneNo
,
0
);
if
(!
createOrderResult
)
{
return
false
;
}
String
channelOrderNo
=
Common
.
queryChannelOrderNoByPhone
(
namespace
,
phoneNo
,
ChannelEnum
.
LEXIN
.
getChannelId
());
Common
.
channelOrderApprove
(
namespace
,
channelOrderNo
,
amount
,
"0"
,
true
,
term
);
// 查询到资方分配成功才进行下一步
queryInProcessStatusService
.
queryFundingAssignProgress
(
namespace
,
phoneNo
,
fundId
,
symbol
);
// api提现
boolean
withDrawResult
=
Common
.
withDraw
(
namespace
,
"LEXIN"
,
channelOrderNo
,
bankCardNo
,
bankCode
,
bankName
,
phoneNo
);
if
(!
withDrawResult
)
{
return
false
;
}
setUserStatusRedisValue
(
namespace
,
phoneNo
,
2
);
// 二次风控
String
token
=
Xyqb
.
login
(
namespace
,
1
,
phoneNo
);
Map
userInfoResult
=
Xyqb
.
checkUserId
(
namespace
,
phoneNo
);
String
uuid
=
userInfoResult
.
get
(
"uuid"
).
toString
();
String
userId
=
userInfoResult
.
get
(
"id"
).
toString
();
Integer
loanId
=
Common
.
queryLoanId
(
namespace
,
phoneNo
,
ChannelEnum
.
LEXIN
.
getChannelId
());
boolean
secondWindControlResult
=
Xyqb
.
externalQuotaOrderAuditNotify
(
namespace
,
1
,
token
,
uuid
,
loanId
,
11
,
true
);
Xyqb
.
modifyContactStatus
(
namespace
,
userId
);
// 放款
String
opToken
=
Xyqb
.
loginOP
(
namespace
);
// 查询待打款数量
Map
<
String
,
Integer
>
peopleMap
=
Xyqb
.
checkWaitingFundingCorpOperatePeople
(
namespace
,
fundId
);
Integer
money
=
peopleMap
.
get
(
"money"
);
Integer
people
=
peopleMap
.
get
(
"people"
);
// 修改待放款用户创建时间
Xyqb
.
modifyWaitingFundingCreatedAt
(
namespace
,
loanId
);
Thread
.
sleep
(
5000
);
// 直接打款
Xyqb
.
fundsPlanLoanApply
(
namespace
,
opToken
,
fundId
,
money
,
people
);
Thread
.
sleep
(
30000
);
// 放款结果通知
boolean
makeLoanResult
=
Xyqb
.
payNotify
(
namespace
,
loanId
,
true
);
setUserStatusRedisValue
(
namespace
,
phoneNo
,
3
);
return
makeLoanResult
;
}
public
void
setUserStatusRedisValue
(
String
namespace
,
String
phoneNo
,
Integer
status
)
{
String
redisKey
=
namespace
+
"_"
+
phoneNo
;
redisTemplate
.
opsForValue
().
set
(
redisKey
,
status
);
}
}
src/main/java/cn/qg/qaplatform/service/impl/QueryInProcessStatusServiceImpl.java
0 → 100644
View file @
5514970f
package
cn
.
qg
.
qaplatform
.
service
.
impl
;
import
cn.qg.qaplatform.config.WebSocketServer
;
import
cn.qg.qaplatform.service.QueryBasicLoanStatusDataService
;
import
cn.qg.qaplatform.service.QueryInProcessStatusService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
@Service
@Slf4j
public
class
QueryInProcessStatusServiceImpl
implements
QueryInProcessStatusService
{
@Autowired
QueryBasicLoanStatusDataService
queryBasicLoanStatusDataService
;
@Override
public
void
queryFundingAssignProgress
(
String
namespace
,
String
phoneNo
,
Integer
fundId
,
String
symbol
)
throws
InterruptedException
{
String
userId
=
queryBasicLoanStatusDataService
.
getUserInfoByPhoneNo
(
namespace
,
phoneNo
).
getUserId
();
while
(
true
)
{
Integer
searchResult
=
queryBasicLoanStatusDataService
.
getAssignFundIdByUserId
(
namespace
,
userId
);
log
.
info
(
searchResult
.
toString
());
if
(
fundId
.
equals
(
searchResult
))
{
log
.
info
(
"用户:"
+
userId
+
"资方分配成功!"
);
if
(!
StringUtils
.
isEmpty
(
symbol
))
{
WebSocketServer
.
sendInfo
(
"查询到的资方为:"
+
searchResult
+
",资方分配成功."
,
symbol
);
}
break
;
}
else
{
if
(!
StringUtils
.
isEmpty
(
symbol
))
{
WebSocketServer
.
sendInfo
(
"查询到的资方为:"
+
searchResult
+
",资方还未分配成功,10秒后重试"
,
symbol
);
}
Thread
.
sleep
(
10000
);
}
}
}
@Override
public
void
queryLoanProgress
(
String
namespace
,
String
phoneNo
,
String
symbol
)
throws
InterruptedException
{
String
userId
=
queryBasicLoanStatusDataService
.
getUserInfoByPhoneNo
(
namespace
,
phoneNo
).
getUserId
();
while
(
true
)
{
Integer
progress
=
queryBasicLoanStatusDataService
.
getLoanProgressByUserId
(
namespace
,
userId
);
if
(
progress
==
15
)
{
log
.
info
(
"用户:"
+
userId
+
"放款成功!"
);
if
(!
StringUtils
.
isEmpty
(
symbol
))
{
WebSocketServer
.
sendInfo
(
"放款成功."
,
symbol
);
}
break
;
}
else
{
if
(!
StringUtils
.
isEmpty
(
symbol
))
{
WebSocketServer
.
sendInfo
(
"查询到的状态为:"
+
progress
+
",资方放款中,30秒后重新查询状态!"
,
symbol
);
}
Thread
.
sleep
(
30000
);
}
}
}
}
src/main/java/cn/qg/qaplatform/service/impl/
GenUser
DataServiceImpl.java
→
src/main/java/cn/qg/qaplatform/service/impl/
Xyqb
DataServiceImpl.java
View file @
5514970f
This diff is collapsed.
Click to expand it.
src/main/java/cn/qg/qaplatform/utils/Encrypt/LexinEncrypt.java
0 → 100644
View file @
5514970f
package
cn
.
qg
.
qaplatform
.
utils
.
Encrypt
;
import
org.apache.commons.codec.binary.Base64
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.exception.ExceptionUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
sun.misc.BASE64Decoder
;
import
javax.crypto.Cipher
;
import
javax.crypto.KeyGenerator
;
import
javax.crypto.SecretKey
;
import
javax.crypto.spec.SecretKeySpec
;
import
java.security.Key
;
public
class
LexinEncrypt
{
private
static
final
Logger
LOGGER
=
LoggerFactory
.
getLogger
(
LexinEncrypt
.
class
);
/**
* KEY算法
*/
private
static
final
String
KEY_ALGORITHM
=
"AES"
;
/**
* 加密算法
* "/算法/模式/补码方式"
*/
public
static
final
String
CIPHER_ALGORITHM
=
"AES/ECB/PKCS5Padding"
;
/**
* KEY长度
*/
private
static
final
int
KEY_SIZE
=
128
;
/**
* 编码
*/
private
static
final
String
CHARSET
=
"UTF-8"
;
public
static
void
main
(
String
[]
args
)
{
try
{
String
key
=
getKeyStr
();
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"e={}"
,
ExceptionUtils
.
getStackTrace
(
e
));
}
}
/**
* 获取密钥 - Base64
*
* @return
* @throws Exception
*/
public
static
String
getKeyStr
()
throws
Exception
{
return
Base64
.
encodeBase64String
(
getKey
().
getEncoded
());
}
/**
* 获取密钥
*
* @return
* @throws Exception
*/
public
static
Key
getKey
()
throws
Exception
{
// 实例化
KeyGenerator
kg
=
KeyGenerator
.
getInstance
(
KEY_ALGORITHM
);
// AES 要求密钥长度为128位、192位或256位
kg
.
init
(
KEY_SIZE
);
// 生成密钥
SecretKey
secretKey
=
kg
.
generateKey
();
return
secretKey
;
}
/**
* 数据加密
*
* @param data 待加密的数据
* @param key 加密使用的KEY
* @return 加密之后的数据
*/
public
static
String
encryptAndBase64Encode
(
String
data
,
String
key
)
{
try
{
return
encryptAndBase64Encode
(
data
.
getBytes
(
CHARSET
),
key
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"AES加密报错,error={}"
,
e
);
return
null
;
}
}
/**
* 加密后base64编码,指定algorithm
* @param data
* @param key
* @param algorithm
* @return
*/
public
static
String
encryptAndBase64Encode
(
String
data
,
String
key
,
String
algorithm
,
AESKeyType
aesKeyType
)
{
try
{
return
encryptAndBase64Encode
(
data
.
getBytes
(
CHARSET
),
key
,
algorithm
,
aesKeyType
);
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"AES加密报错,error={}"
,
e
);
return
null
;
}
}
/**
* 对字节数组加密
* @param data
* @param key
* @return
*/
public
static
String
encryptAndBase64Encode
(
byte
[]
data
,
String
key
)
{
try
{
if
(
StringUtils
.
isBlank
(
key
))
{
LOGGER
.
error
(
"AES Key为空"
);
return
null
;
}
return
doEncryptAndBase64Encode
(
data
,
key
,
CIPHER_ALGORITHM
,
AESKeyType
.
plain
);
}
catch
(
Exception
ex
)
{
LOGGER
.
error
(
"AES加密报错,error={}"
,
ex
);
return
null
;
}
}
/**
* 对字节数组加密,指定algorithm
* @param data
* @param key
* @return
*/
public
static
String
encryptAndBase64Encode
(
byte
[]
data
,
String
key
,
String
algorithm
,
AESKeyType
aesKeyType
)
{
try
{
if
(
StringUtils
.
isBlank
(
key
))
{
LOGGER
.
error
(
"AES Key为空"
);
return
null
;
}
if
(
StringUtils
.
isBlank
(
algorithm
))
{
LOGGER
.
error
(
"AES 算法为空"
);
return
null
;
}
return
doEncryptAndBase64Encode
(
data
,
key
,
algorithm
,
aesKeyType
);
}
catch
(
Exception
ex
)
{
LOGGER
.
error
(
"AES加密报错,error={}"
,
ex
);
return
null
;
}
}
/**
* 执行加密和base64编码
* @param data
* @param key
* @param algorithm
* @param aesKeyType
* @return
* @throws Exception
*/
private
static
String
doEncryptAndBase64Encode
(
byte
[]
data
,
String
key
,
String
algorithm
,
AESKeyType
aesKeyType
)
throws
Exception
{
algorithm
=
StringUtils
.
isBlank
(
algorithm
)?
CIPHER_ALGORITHM:
algorithm
;
byte
[]
raw
=
toKey
(
key
,
aesKeyType
);
SecretKeySpec
skeySpec
=
new
SecretKeySpec
(
raw
,
KEY_ALGORITHM
);
Cipher
cipher
=
Cipher
.
getInstance
(
algorithm
);
cipher
.
init
(
Cipher
.
ENCRYPT_MODE
,
skeySpec
);
byte
[]
encrypted
=
cipher
.
doFinal
(
data
);
return
new
Base64
().
encodeToString
(
encrypted
);
}
/**
* 数据解密,返回字符串
* @param data 待解密的数据
* @param key 解密使用的KEY
* @return 解密之后的数据
*/
public
static
String
decryptAfterBase64Decode
(
String
data
,
String
key
)
{
try
{
byte
[]
bytes
=
decryptAfterBase64DecodeToByte
(
data
,
key
);
if
(
bytes
!=
null
&&
bytes
.
length
>
0
){
return
new
String
(
bytes
,
CHARSET
);
}
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"AES解密报错,error={}"
,
e
);
}
return
null
;
}
/**
* base64解码后解密,指定algorithm
* @param data
* @param key
* @param algorithm
* @return
*/
public
static
String
decryptAfterBase64Decode
(
String
data
,
String
key
,
String
algorithm
,
AESKeyType
aesKeyType
)
{
try
{
byte
[]
bytes
=
decryptAfterBase64DecodeToByte
(
data
,
key
,
algorithm
,
aesKeyType
);
if
(
bytes
!=
null
&&
bytes
.
length
>
0
){
return
new
String
(
bytes
,
CHARSET
);
}
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
"AES解密报错,error={}"
,
e
);
}
return
null
;
}
/**
* 数据解密,返回字节数据
* @param data
* @param key
* @return
*/
public
static
byte
[]
decryptAfterBase64DecodeToByte
(
String
data
,
String
key
)
{
try
{
if
(
StringUtils
.
isBlank
(
key
))
{
LOGGER
.
error
(
"AES Key为空"
);
return
null
;
}
return
doDecryptAfterBase64DecodeToBtype
(
data
,
key
,
CIPHER_ALGORITHM
,
AESKeyType
.
plain
);
}
catch
(
Exception
ex
)
{
LOGGER
.
error
(
"AES解密报错:"
+
ex
.
toString
());
return
null
;
}
}
/**
* base64解码后解密,返回字节数组,指定算法
* @param data
* @param key
* @param algorithm
* @return
*/
public
static
byte
[]
decryptAfterBase64DecodeToByte
(
String
data
,
String
key
,
String
algorithm
,
AESKeyType
aesKeyType
)
{
try
{
if
(
StringUtils
.
isBlank
(
key
))
{
LOGGER
.
error
(
"AES Key为空"
);
return
null
;
}
if
(
StringUtils
.
isBlank
(
algorithm
))
{
LOGGER
.
error
(
"AES 算法为空"
);
return
null
;
}
return
doDecryptAfterBase64DecodeToBtype
(
data
,
key
,
algorithm
,
aesKeyType
);
}
catch
(
Exception
ex
)
{
LOGGER
.
error
(
"AES解密报错:"
+
ex
.
toString
());
return
null
;
}
}
/**
* 执行base64解码后解密
* @param data
* @param key
* @param algorithm
* @param aesKeyType
* @return
* @throws Exception
*/
private
static
byte
[]
doDecryptAfterBase64DecodeToBtype
(
String
data
,
String
key
,
String
algorithm
,
AESKeyType
aesKeyType
)
throws
Exception
{
algorithm
=
StringUtils
.
isBlank
(
algorithm
)?
CIPHER_ALGORITHM:
algorithm
;
byte
[]
raw
=
toKey
(
key
,
aesKeyType
);
SecretKeySpec
skeySpec
=
new
SecretKeySpec
(
raw
,
KEY_ALGORITHM
);
Cipher
cipher
=
Cipher
.
getInstance
(
algorithm
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
skeySpec
);
byte
[]
encrypted1
=
new
Base64
().
decode
(
data
);
byte
[]
original
=
cipher
.
doFinal
(
encrypted1
);
return
original
;
}
/**
* 转换密钥
* @param key
* @param aesKeyType
* @return
* @throws Exception
*/
private
static
byte
[]
toKey
(
String
key
,
AESKeyType
aesKeyType
)
throws
Exception
{
if
(
aesKeyType
==
AESKeyType
.
plain
){
return
key
.
getBytes
(
CHARSET
);
}
else
if
(
aesKeyType
==
AESKeyType
.
base64
){
return
new
BASE64Decoder
().
decodeBuffer
(
key
);
}
return
null
;
}
public
enum
AESKeyType
{
plain
(
"普通字符串"
),
base64
(
"base64编码字符串"
);
public
String
text
;
AESKeyType
(
String
text
){
this
.
text
=
text
;
}
}
}
src/main/java/cn/qg/qaplatform/utils/HttpClientUtils.java
View file @
5514970f
...
@@ -2,6 +2,7 @@ package cn.qg.qaplatform.utils;
...
@@ -2,6 +2,7 @@ package cn.qg.qaplatform.utils;
import
com.alibaba.fastjson.JSONException
;
import
com.alibaba.fastjson.JSONException
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.sf.jsqlparser.expression.JsonExpression
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.HttpEntity
;
import
org.apache.http.NameValuePair
;
import
org.apache.http.NameValuePair
;
...
@@ -162,8 +163,11 @@ public class HttpClientUtils {
...
@@ -162,8 +163,11 @@ public class HttpClientUtils {
CloseableHttpResponse
response
=
client
.
execute
(
post
);
CloseableHttpResponse
response
=
client
.
execute
(
post
);
HttpEntity
responseEntity
=
response
.
getEntity
();
HttpEntity
responseEntity
=
response
.
getEntity
();
String
responseString
=
EntityUtils
.
toString
(
responseEntity
,
"utf-8"
);
String
responseString
=
EntityUtils
.
toString
(
responseEntity
,
"utf-8"
);
try
{
jsonResult
=
JSONObject
.
parseObject
(
responseString
);
jsonResult
=
JSONObject
.
parseObject
(
responseString
);
}
catch
(
JSONException
e
)
{
jsonResult
.
put
(
"content"
,
responseString
);
}
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
src/test/java/cn/qg/qaplatform/test/Lexin.java
0 → 100644
View file @
5514970f
This diff is collapsed.
Click to expand it.
src/test/java/cn/qg/qaplatform/test/
x
yqb.java
→
src/test/java/cn/qg/qaplatform/test/
X
yqb.java
View file @
5514970f
...
@@ -16,30 +16,31 @@ import java.util.HashMap;
...
@@ -16,30 +16,31 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
public
class
x
yqb
{
public
class
X
yqb
{
public
static
String
namespace
=
"
xyqb
"
;
public
static
String
namespace
=
"
pre
"
;
public
static
Integer
channelId
=
1
;
public
static
Integer
channelId
=
1
;
public
static
Integer
fundId
=
10
4
0
;
public
static
Integer
fundId
=
10
1
0
;
public
static
String
phone
=
"1
8300120382
"
;
public
static
String
phone
=
"1
3039252170
"
;
public
static
String
token
=
""
;
public
static
String
token
=
""
;
public
static
String
uuid
=
""
;
public
static
String
uuid
=
""
;
public
static
Long
userId
;
public
static
Long
userId
;
public
static
String
productId
=
"1"
;
public
static
String
productId
=
"1"
;
public
static
String
name
=
"刘
志国
"
;
public
static
String
name
=
"刘
凯乐
"
;
public
static
String
idNo
=
"
45512919710803110
7"
;
public
static
String
idNo
=
"
37110119950806089
7"
;
public
static
Long
createdFrom
=
1L
;
public
static
Long
createdFrom
=
1L
;
public
static
String
ocrToken
;
public
static
String
ocrToken
;
public
static
String
idCardNo
=
"
6222800007700762652
"
;
public
static
String
idCardNo
=
"
371101199508060897
"
;
public
static
String
orderNo
=
""
;
public
static
String
orderNo
=
""
;
public
static
Integer
bizType
=
0
;
public
static
Integer
bizType
=
0
;
public
static
String
auditResult
=
"true"
;
public
static
String
auditResult
=
"true"
;
public
static
String
creditAmount
=
"
10000"
;
public
static
String
creditAmount
=
"
9600"
;
// 授信时返回的额度
public
static
Integer
maxAmount
=
8000
;
public
static
Integer
maxAmount
=
9600
;
// 提现时的额度,
public
static
Integer
minAmount
=
5000
;
public
static
Integer
minAmount
=
1000
;
//
public
static
Integer
term
=
3
;
public
static
Integer
term
=
12
;
public
static
Long
accountId
;
public
static
Long
accountId
;
public
static
String
payToken
=
""
;
public
static
String
payToken
=
""
;
public
static
String
cardNo
=
"6222800005354563814"
;
public
static
String
cardNo
=
"6228220000020362026"
;
public
static
String
bankCode
=
"ABC"
;
public
static
Integer
cardId
;
public
static
Integer
cardId
;
public
static
Integer
cardBindInfoId
;
public
static
Integer
cardBindInfoId
;
public
static
Integer
loanId
;
public
static
Integer
loanId
;
...
@@ -333,6 +334,10 @@ public class xyqb {
...
@@ -333,6 +334,10 @@ public class xyqb {
if
(
fundId
==
1040
)
{
if
(
fundId
==
1040
)
{
fundInfoObject
.
put
(
"fundProductId"
,
1061
);
fundInfoObject
.
put
(
"fundProductId"
,
1061
);
}
}
// 平银新增fundProductId
if
(
fundId
==
1030
)
{
fundInfoObject
.
put
(
"fundProductId"
,
1060
);
}
fundInfoList
.
add
(
fundInfoObject
);
fundInfoList
.
add
(
fundInfoObject
);
firstTerm
.
put
(
"fundInfo"
,
fundInfoList
);
firstTerm
.
put
(
"fundInfo"
,
fundInfoList
);
terms
.
add
(
firstTerm
);
terms
.
add
(
firstTerm
);
...
@@ -402,7 +407,7 @@ public class xyqb {
...
@@ -402,7 +407,7 @@ public class xyqb {
params
.
put
(
"preservePhoneNo"
,
phone
);
params
.
put
(
"preservePhoneNo"
,
phone
);
params
.
put
(
"province"
,
110000
);
params
.
put
(
"province"
,
110000
);
params
.
put
(
"city"
,
110101
);
params
.
put
(
"city"
,
110101
);
params
.
put
(
"bankCode"
,
"CCB"
);
params
.
put
(
"bankCode"
,
bankCode
);
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
System
.
out
.
println
(
"绑卡发送短信:"
+
result
);
System
.
out
.
println
(
"绑卡发送短信:"
+
result
);
}
}
...
@@ -454,6 +459,7 @@ public class xyqb {
...
@@ -454,6 +459,7 @@ public class xyqb {
params
.
put
(
"productId"
,
productId
);
params
.
put
(
"productId"
,
productId
);
params
.
put
(
"cardId"
,
cardId
);
params
.
put
(
"cardId"
,
cardId
);
params
.
put
(
"cardBindInfoId"
,
cardBindInfoId
);
params
.
put
(
"cardBindInfoId"
,
cardBindInfoId
);
params
.
put
(
"purpose"
,
"手机数码"
);
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
System
.
out
.
println
(
"绑卡后提现:"
+
result
);
System
.
out
.
println
(
"绑卡后提现:"
+
result
);
Map
respData
=
(
Map
)
result
.
get
(
"data"
);
Map
respData
=
(
Map
)
result
.
get
(
"data"
);
...
@@ -658,58 +664,58 @@ public class xyqb {
...
@@ -658,58 +664,58 @@ public class xyqb {
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
// 分配资金方
// 分配资金方
loginFundOP
();
//
loginFundOP();
unblockLoan
();
//
unblockLoan();
boolean
result
=
assignFundOrNot
();
//
boolean result = assignFundOrNot();
if
(!
result
)
{
//
if (!result) {
setFundPlan
();
//
setFundPlan();
unblockLoan
();
//
unblockLoan();
}
//
}
//
// 授信
//
// 授信
login
();
//
login();
checkUserId
();
//
checkUserId();
// 如果是云信,则需要插入银行卡
//
// 如果是云信,则需要插入银行卡
if
(
fundId
==
1040
)
{
//
if (fundId == 1040) {
insertBankCardOfYunxing
();
//
insertBankCardOfYunxing();
}
//
}
syncSessionToXyqb
();
//
syncSessionToXyqb();
creditSessionSync
();
//
creditSessionSync();
realNameVerified
();
//
realNameVerified();
authBasicInfo
();
//
authBasicInfo();
enterAuthOcr
();
//
enterAuthOcr();
uploadFrontOfIdCard
();
//
uploadFrontOfIdCard();
uploadBackOfIdCard
();
//
uploadBackOfIdCard();
submitPhotoAuth
();
//
submitPhotoAuth();
credit
();
//
credit();
submitAudit
();
//
submitAudit();
queryUserAuditRecord
();
//
queryUserAuditRecord();
creditAuthNotify
();
//
creditAuthNotify();
Thread
.
sleep
(
180000
);
//
Thread.sleep(180000);
// 绑卡提现
// 绑卡提现
login
();
//
login();
checkUserId
();
//
checkUserId();
syncSessionToXyqb
();
//
syncSessionToXyqb();
loginWithDrawPage
();
//
loginWithDrawPage();
getUserAccountId
();
//
getUserAccountId();
bindCard
();
//
bindCard();
cardAuthSms
();
//
cardAuthSms();
cardAuthSmsConfirm
();
//
cardAuthSmsConfirm();
getBindCardList
();
//
getBindCardList();
createLoan
();
//
createLoan();
externalQuotaOrderAuditNotify
();
//
externalQuotaOrderAuditNotify();
modifyContactStatus
();
//
modifyContactStatus();
Thread
.
sleep
(
10000
);
//
Thread.sleep(10000);
//
// 放款
//
// 放款
loginOP
();
//
loginOP();
checkWaitingFundingCorpOperatePeople
();
//
checkWaitingFundingCorpOperatePeople();
modifyWaitingFundingCreatedAt
();
//
modifyWaitingFundingCreatedAt();
Thread
.
sleep
(
10000
);
//
Thread.sleep(10000);
fundsPlanLoanApply
();
//
fundsPlanLoanApply();
Thread
.
sleep
(
10000
);
//
Thread.sleep(10000);
payNotify
();
//
payNotify();
}
}
}
}
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