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
1a6b9fba
Commit
1a6b9fba
authored
Aug 19, 2020
by
黎博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善捞数据的资方id
parent
9deab872
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
151 additions
and
44 deletions
+151
-44
QueryBasicLoanStatusDataMapper.java
.../cn/qg/qaplatform/dao/QueryBasicLoanStatusDataMapper.java
+2
-0
QueryBasicLoanStatusDataService.java
...g/qaplatform/service/QueryBasicLoanStatusDataService.java
+10
-0
QueryBasicLoanStatusDataServiceImpl.java
...orm/service/impl/QueryBasicLoanStatusDataServiceImpl.java
+13
-0
QueryLoanUserDataServiceImpl.java
...qaplatform/service/impl/QueryLoanUserDataServiceImpl.java
+20
-3
HttpClientUtils.java
src/main/java/cn/qg/qaplatform/utils/HttpClientUtils.java
+9
-8
QueryBasicLoanStatusDataMapper.xml
src/main/resources/mapper/QueryBasicLoanStatusDataMapper.xml
+6
-0
xyqb.java
src/test/java/cn/qg/qaplatform/test/xyqb.java
+91
-33
No files found.
src/main/java/cn/qg/qaplatform/dao/QueryBasicLoanStatusDataMapper.java
View file @
1a6b9fba
...
@@ -60,4 +60,6 @@ public interface QueryBasicLoanStatusDataMapper {
...
@@ -60,4 +60,6 @@ public interface QueryBasicLoanStatusDataMapper {
* @return
* @return
*/
*/
List
<
String
>
getMultiOrderuuidList
();
List
<
String
>
getMultiOrderuuidList
();
Integer
getAssignFundIdByUserId
(
String
userId
);
}
}
src/main/java/cn/qg/qaplatform/service/QueryBasicLoanStatusDataService.java
View file @
1a6b9fba
...
@@ -59,4 +59,14 @@ public interface QueryBasicLoanStatusDataService {
...
@@ -59,4 +59,14 @@ public interface QueryBasicLoanStatusDataService {
* 获取多订单用户信息列表
* 获取多订单用户信息列表
*/
*/
List
<
String
>
getMultiOrderUserDataList
(
String
namespace
);
List
<
String
>
getMultiOrderUserDataList
(
String
namespace
);
/**
* 根据userId获取资金方id
*/
Integer
getAssignFundIdByUserId
(
String
namespace
,
String
userId
);
/**
* 根据手机号查询用户信息
*/
LoanUser
getUserInfoByPhoneNo
(
String
namespace
,
String
phoneNo
);
}
}
src/main/java/cn/qg/qaplatform/service/impl/QueryBasicLoanStatusDataServiceImpl.java
View file @
1a6b9fba
...
@@ -19,6 +19,7 @@ public class QueryBasicLoanStatusDataServiceImpl implements QueryBasicLoanStatus
...
@@ -19,6 +19,7 @@ public class QueryBasicLoanStatusDataServiceImpl implements QueryBasicLoanStatus
@Autowired
@Autowired
QueryBasicLoanStatusDataMapper
basicLoanStatusDataMapper
;
QueryBasicLoanStatusDataMapper
basicLoanStatusDataMapper
;
/**
/**
* 获取所有用户状态
* 获取所有用户状态
* @return 用户状态列表
* @return 用户状态列表
...
@@ -162,4 +163,16 @@ public class QueryBasicLoanStatusDataServiceImpl implements QueryBasicLoanStatus
...
@@ -162,4 +163,16 @@ public class QueryBasicLoanStatusDataServiceImpl implements QueryBasicLoanStatus
SwitchDataSource
.
dataSourceSwitch
(
"fe"
,
"workflow"
);
SwitchDataSource
.
dataSourceSwitch
(
"fe"
,
"workflow"
);
return
basicLoanStatusDataMapper
.
getMultiOrderuuidList
();
return
basicLoanStatusDataMapper
.
getMultiOrderuuidList
();
}
}
@Override
public
Integer
getAssignFundIdByUserId
(
String
namespace
,
String
userId
)
{
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"xyqb"
);
return
basicLoanStatusDataMapper
.
getAssignFundIdByUserId
(
userId
);
}
@Override
public
LoanUser
getUserInfoByPhoneNo
(
String
namespace
,
String
phoneNo
)
{
SwitchDataSource
.
dataSourceSwitch
(
namespace
,
"xyqb"
);
return
null
;
}
}
}
src/main/java/cn/qg/qaplatform/service/impl/QueryLoanUserDataServiceImpl.java
View file @
1a6b9fba
...
@@ -81,6 +81,11 @@ public class QueryLoanUserDataServiceImpl implements QueryLoanUserDataService {
...
@@ -81,6 +81,11 @@ public class QueryLoanUserDataServiceImpl implements QueryLoanUserDataService {
}
}
PageHelper
.
startPage
(
pageNum
,
pageSize
);
PageHelper
.
startPage
(
pageNum
,
pageSize
);
result
=
basicLoanStatusDataService
.
getUserDataListByUserIdList
(
namespace
,
userIdList
);
result
=
basicLoanStatusDataService
.
getUserDataListByUserIdList
(
namespace
,
userIdList
);
if
(
fundId
==
null
)
{
result
.
forEach
((
item
)
->
item
.
setFundId
(
basicLoanStatusDataService
.
getAssignFundIdByUserId
(
namespace
,
item
.
getUserId
())));
}
else
{
result
.
forEach
((
item
)
->
item
.
setFundId
(
fundId
));
}
PageInfo
<
LoanUser
>
pageList
=
new
PageInfo
<>(
result
);
PageInfo
<
LoanUser
>
pageList
=
new
PageInfo
<>(
result
);
PageResult
pageResult
=
PageUtil
.
getPageResult
(
pageList
,
pageNum
,
pageSize
);
PageResult
pageResult
=
PageUtil
.
getPageResult
(
pageList
,
pageNum
,
pageSize
);
return
pageResult
;
return
pageResult
;
...
@@ -97,7 +102,11 @@ public class QueryLoanUserDataServiceImpl implements QueryLoanUserDataService {
...
@@ -97,7 +102,11 @@ public class QueryLoanUserDataServiceImpl implements QueryLoanUserDataService {
}
}
PageHelper
.
startPage
(
pageNum
,
pageSize
);
PageHelper
.
startPage
(
pageNum
,
pageSize
);
result
=
basicLoanStatusDataService
.
getUserDataListByUserIdList
(
namespace
,
userIdList
);
result
=
basicLoanStatusDataService
.
getUserDataListByUserIdList
(
namespace
,
userIdList
);
if
(
fundId
==
null
)
{
result
.
forEach
((
item
)
->
item
.
setFundId
(
basicLoanStatusDataService
.
getAssignFundIdByUserId
(
namespace
,
item
.
getUserId
())));
}
else
{
result
.
forEach
((
item
)
->
item
.
setFundId
(
fundId
));
result
.
forEach
((
item
)
->
item
.
setFundId
(
fundId
));
}
PageInfo
<
LoanUser
>
pageList
=
new
PageInfo
<>(
result
);
PageInfo
<
LoanUser
>
pageList
=
new
PageInfo
<>(
result
);
PageResult
pageResult
=
PageUtil
.
getPageResult
(
pageList
,
pageNum
,
pageSize
);
PageResult
pageResult
=
PageUtil
.
getPageResult
(
pageList
,
pageNum
,
pageSize
);
return
pageResult
;
return
pageResult
;
...
@@ -131,7 +140,11 @@ public class QueryLoanUserDataServiceImpl implements QueryLoanUserDataService {
...
@@ -131,7 +140,11 @@ public class QueryLoanUserDataServiceImpl implements QueryLoanUserDataService {
}
}
PageHelper
.
startPage
(
pageNum
,
pageSize
);
PageHelper
.
startPage
(
pageNum
,
pageSize
);
result
=
basicLoanStatusDataService
.
getUserDataListByUserIdList
(
namespace
,
userIdList
);
result
=
basicLoanStatusDataService
.
getUserDataListByUserIdList
(
namespace
,
userIdList
);
if
(
fundId
==
null
)
{
result
.
forEach
((
item
)
->
item
.
setFundId
(
basicLoanStatusDataService
.
getAssignFundIdByUserId
(
namespace
,
item
.
getUserId
())));
}
else
{
result
.
forEach
((
item
)
->
item
.
setFundId
(
fundId
));
result
.
forEach
((
item
)
->
item
.
setFundId
(
fundId
));
}
PageInfo
<
LoanUser
>
pageList
=
new
PageInfo
<>(
result
);
PageInfo
<
LoanUser
>
pageList
=
new
PageInfo
<>(
result
);
PageResult
pageResult
=
PageUtil
.
getPageResult
(
pageList
,
pageNum
,
pageSize
);
PageResult
pageResult
=
PageUtil
.
getPageResult
(
pageList
,
pageNum
,
pageSize
);
return
pageResult
;
return
pageResult
;
...
@@ -149,7 +162,11 @@ public class QueryLoanUserDataServiceImpl implements QueryLoanUserDataService {
...
@@ -149,7 +162,11 @@ public class QueryLoanUserDataServiceImpl implements QueryLoanUserDataService {
}
}
PageHelper
.
startPage
(
pageNum
,
pageSize
);
PageHelper
.
startPage
(
pageNum
,
pageSize
);
result
=
basicLoanStatusDataService
.
getUserDataListByUserIdList
(
namespace
,
userIdList
);
result
=
basicLoanStatusDataService
.
getUserDataListByUserIdList
(
namespace
,
userIdList
);
if
(
fundId
==
null
)
{
result
.
forEach
((
item
)
->
item
.
setFundId
(
basicLoanStatusDataService
.
getAssignFundIdByUserId
(
namespace
,
item
.
getUserId
())));
}
else
{
result
.
forEach
((
item
)
->
item
.
setFundId
(
fundId
));
result
.
forEach
((
item
)
->
item
.
setFundId
(
fundId
));
}
PageInfo
<
LoanUser
>
pageList
=
new
PageInfo
<>(
result
);
PageInfo
<
LoanUser
>
pageList
=
new
PageInfo
<>(
result
);
PageResult
pageResult
=
PageUtil
.
getPageResult
(
pageList
,
pageNum
,
pageSize
);
PageResult
pageResult
=
PageUtil
.
getPageResult
(
pageList
,
pageNum
,
pageSize
);
return
pageResult
;
return
pageResult
;
...
...
src/main/java/cn/qg/qaplatform/utils/HttpClientUtils.java
View file @
1a6b9fba
...
@@ -236,21 +236,22 @@ public class HttpClientUtils {
...
@@ -236,21 +236,22 @@ public class HttpClientUtils {
return
jsonResult
;
return
jsonResult
;
}
}
public
static
JSONObject
doPostJson
(
String
url
,
String
params
,
String
headers
)
{
public
static
JSONObject
doPostJson
(
String
url
,
String
params
)
{
JSONObject
result
=
new
JSONObject
();
JSONObject
result
=
new
JSONObject
();
HttpPost
httpPost
=
new
HttpPost
(
url
);
HttpPost
httpPost
=
new
HttpPost
(
url
);
if
(
StringUtils
.
isNotEmpty
(
params
))
{
if
(
StringUtils
.
isNotEmpty
(
params
))
{
StringEntity
stringEntity
=
new
StringEntity
(
params
,
"utf-8"
);
StringEntity
stringEntity
=
new
StringEntity
(
params
,
"utf-8"
);
httpPost
.
setEntity
(
stringEntity
);
httpPost
.
setEntity
(
stringEntity
);
}
}
if
(
StringUtils
.
isNotEmpty
(
headers
))
{
// if (StringUtils.isNotEmpty(headers)) {
// httpPost.setHeader("Content-Type", "application/json");
// }
httpPost
.
setHeader
(
"Content-Type"
,
"application/json"
);
httpPost
.
setHeader
(
"Content-Type"
,
"application/json"
);
}
try
{
try
{
CloseableHttpResponse
response
=
client
.
execute
(
httpPost
);
CloseableHttpResponse
response
=
client
.
execute
(
httpPost
);
HttpEntity
responseEntity
=
response
.
getEntity
();
HttpEntity
responseEntity
=
response
.
getEntity
();
String
to
String
=
EntityUtils
.
toString
(
responseEntity
,
"utf-8"
);
String
response
String
=
EntityUtils
.
toString
(
responseEntity
,
"utf-8"
);
System
.
out
.
println
(
to
String
);
result
=
JSONObject
.
parseObject
(
response
String
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -273,8 +274,8 @@ public class HttpClientUtils {
...
@@ -273,8 +274,8 @@ public class HttpClientUtils {
try
{
try
{
CloseableHttpResponse
response
=
client
.
execute
(
httpPost
);
CloseableHttpResponse
response
=
client
.
execute
(
httpPost
);
HttpEntity
responseEntity
=
response
.
getEntity
();
HttpEntity
responseEntity
=
response
.
getEntity
();
String
responseStr
=
EntityUtils
.
toString
(
responseEntity
,
"utf-8"
);
String
responseStr
ing
=
EntityUtils
.
toString
(
responseEntity
,
"utf-8"
);
result
=
JSONObject
.
parseObject
(
responseStr
);
result
=
JSONObject
.
parseObject
(
responseStr
ing
);
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
...
src/main/resources/mapper/QueryBasicLoanStatusDataMapper.xml
View file @
1a6b9fba
...
@@ -87,4 +87,10 @@
...
@@ -87,4 +87,10 @@
SELECT uuid FROM `white_list_config_new`
SELECT uuid FROM `white_list_config_new`
</select>
</select>
<!-- 获取资方id -->
<select
id=
"getAssignFundIdByUserId"
resultType=
"java.lang.Integer"
>
SELECT `funding_corp_id` as `fundId` FROM `assign_funding_record`
WHERE `user_id` = #{userId} order by id desc limit 0,1
</select>
</mapper>
</mapper>
\ No newline at end of file
src/test/java/cn/qg/qaplatform/test/xyqb.java
View file @
1a6b9fba
...
@@ -3,12 +3,15 @@ package cn.qg.qaplatform.test;
...
@@ -3,12 +3,15 @@ package cn.qg.qaplatform.test;
import
cn.qg.qaplatform.utils.DBUtils
;
import
cn.qg.qaplatform.utils.DBUtils
;
import
cn.qg.qaplatform.utils.EncryptUtils
;
import
cn.qg.qaplatform.utils.EncryptUtils
;
import
cn.qg.qaplatform.utils.HttpClientUtils
;
import
cn.qg.qaplatform.utils.HttpClientUtils
;
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
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.net.URISyntaxException
;
import
java.net.URISyntaxException
;
import
java.sql.SQLException
;
import
java.sql.SQLException
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -43,6 +46,7 @@ public class xyqb {
...
@@ -43,6 +46,7 @@ public class xyqb {
public
static
String
opToken
;
public
static
String
opToken
;
public
static
Integer
money
;
public
static
Integer
money
;
public
static
Integer
assignPeopleNum
;
public
static
Integer
assignPeopleNum
;
public
static
String
fundOpToken
;
/**
/**
* 标准登录
* 标准登录
...
@@ -556,47 +560,101 @@ public class xyqb {
...
@@ -556,47 +560,101 @@ public class xyqb {
System
.
out
.
println
(
"放款结果通知:"
+
result
)
;
System
.
out
.
println
(
"放款结果通知:"
+
result
)
;
}
}
/**
* 登录资金方OP
*/
public
static
void
loginFundOP
()
{
String
url
=
"http://opapi-"
+
namespace
+
".liangkebang.net"
+
"/user/login"
;
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"auth"
,
"dXNlcj1xYSZwYXNzd29yZD1xYXRlc3Q="
);
String
params
=
JSON
.
toJSONString
(
map
);
JSONObject
result
=
HttpClientUtils
.
doPostJson
(
url
,
params
);
Map
data
=
(
Map
)
result
.
get
(
"data"
);
fundOpToken
=
data
.
get
(
"token"
).
toString
();
System
.
out
.
println
(
"返回结果为:"
+
result
);
}
/**
* 分配资产计划
*/
public
static
void
setFundPlan
()
{
String
url
=
"http://opapi-"
+
namespace
+
".liangkebang.net"
+
"/clotho/funds/plan/funding/plan/save"
;
Date
date
=
new
Date
();
SimpleDateFormat
formatter
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
today
=
formatter
.
format
(
date
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"fundCorpId"
,
fundId
);
params
.
put
(
"planDate"
,
today
);
params
.
put
(
"maxAssignAmount"
,
10000000
);
params
.
put
(
"maxLoanAmount"
,
10000000
);
params
.
put
(
"maxLoanPeople"
,
100
);
params
.
put
(
"maxAssignPeople"
,
100
);
params
.
put
(
"priorityLevel"
,
1
);
Map
<
String
,
Object
>
headers
=
new
HashMap
<>();
headers
.
put
(
"x-auth-token"
,
fundOpToken
);
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
System
.
out
.
println
(
"分配资金方的结果为:"
+
result
);
}
/**
* 打开推送放款
*/
public
static
void
unblockLoan
()
{
String
url
=
"http://opapi-"
+
namespace
+
".liangkebang.net"
+
"/clotho/funds/plan/funding/switch/"
+
fundId
+
"/loan/auto_lock"
;
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"to"
,
true
);
Map
<
String
,
Object
>
headers
=
new
HashMap
<>();
headers
.
put
(
"x-auth-token"
,
fundOpToken
);
JSONObject
result
=
HttpClientUtils
.
doPost
(
url
,
params
,
headers
);
System
.
out
.
println
(
"推送放款Enable:"
+
result
);
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
login
();
// 分配资金方
checkUserId
();
loginFundOP
();
syncSessionToXyqb
();
setFundPlan
();
creditSessionSync
();
unblockLoan
();
realNameVerified
();
// login();
authBasicInfo
();
// checkUserId();
enterAuthOcr
();
// syncSessionToXyqb();
uploadFrontOfIdCard
();
// creditSessionSync();
uploadBackOfIdCard
();
// realNameVerified();
submitPhotoAuth
();
// authBasicInfo();
credit
();
// enterAuthOcr();
submitAudit
();
// uploadFrontOfIdCard();
queryUserAuditRecord
();
// uploadBackOfIdCard();
creditAuthNotify
();
// submitPhotoAuth();
Thread
.
sleep
(
180000
);
// credit();
// submitAudit();
// queryUserAuditRecord();
// creditAuthNotify();
// 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