Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xm-sportstest
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xiamai-test
xm-sportstest
Commits
764911f5
Commit
764911f5
authored
Jul 01, 2024
by
yangfangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
订单相关的接口
parent
96eabc74
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
736 additions
and
12 deletions
+736
-12
src/main/java/com/xiaomai/cases/lunar/reserve/TestAddMemberReserve.java
+3
-1
src/main/java/com/xiaomai/cases/lunar/reserve/TestAddToQueue.java
+2
-1
src/main/java/com/xiaomai/cases/lunar/reserve/TestXCXSignIn.java
+2
-1
src/main/java/com/xiaomai/cases/polar/finance/order/OrderTools.java
+0
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestCancel.java
+111
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestDiscard.java
+182
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestModifyMemo.java
+129
-0
src/main/java/com/xiaomai/cases/polar/finance/order/TestSignOrder.java
+83
-6
src/main/java/com/xiaomai/cases/polar/finance/revenueAndExpenditure/RevenueAndExpenditureTools.java
+157
-0
src/main/java/com/xiaomai/cases/polar/finance/revenueAndExpenditure/TestSumNormalIncomeExpense.java
+61
-0
src/main/java/com/xiaomai/cases/polar/reserve/TestAddMemberReserve.java
+2
-1
src/main/java/com/xiaomai/cases/polar/reserve/TestAddToQueue.java
+2
-1
src/main/java/com/xiaomai/cases/polar/reserve/TestSignIn.java
+2
-1
No files found.
src/main/java/com/xiaomai/cases/lunar/reserve/TestAddMemberReserve.java
View file @
764911f5
...
...
@@ -242,7 +242,9 @@ public class TestAddMemberReserve extends BaseTestImpl {
if
(
limitResult
==
true
){
//创建订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
"PURCHASE"
,
memberId
,
price
,
price
,
"1"
,
dataUserInfo
);
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
price
-
price
/
2
,
"1"
);
}
}
...
...
src/main/java/com/xiaomai/cases/lunar/reserve/TestAddToQueue.java
View file @
764911f5
...
...
@@ -323,7 +323,8 @@ public class TestAddToQueue extends BaseTestImpl {
if
(
limitResult
==
true
){
//创建订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
"PURCHASE"
,
memberId
,
price
,
price
,
"1"
,
dataUserInfo
);
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
price
-
price
/
2
,
"1"
);
}
}
...
...
src/main/java/com/xiaomai/cases/lunar/reserve/TestXCXSignIn.java
View file @
764911f5
...
...
@@ -266,7 +266,8 @@ public class TestXCXSignIn extends BaseTestImpl {
if
(
limitResult
==
true
){
//创建订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
"PURCHASE"
,
memberId
,
price
,
price
,
"1"
,
dataUserInfo
);
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
price
-
price
/
2
,
"1"
);
}
}
...
...
src/main/java/com/xiaomai/cases/polar/finance/order/OrderTools.java
View file @
764911f5
This diff is collapsed.
Click to expand it.
src/main/java/com/xiaomai/cases/polar/finance/order/TestCancel.java
0 → 100644
View file @
764911f5
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.member.Tools
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestCancel
extends
XMBaseTest
{
Tools
tools
=
new
Tools
();
OrderTools
orderTools
=
new
OrderTools
();
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_cancel"
)
.
setLoginUser
(
LoginAccount
.
YFF_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"取消订单"
)
public
void
testCancel
(){
//获取会员ID
String
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取会员卡信息
//获取会员卡列表
JSONObject
memberCard
=
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
quantity
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"balance"
));
float
price
=
Float
.
parseFloat
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"price"
));
int
validPeriod
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"validPeriod"
));
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取签单要用的卡快照id
String
latestSnapshotId
=
orderTools
.
fetchDetailById
(
cardId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getJSONObject
(
"result"
).
getString
(
"latestSnapshotId"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//检查会员对该卡是否超出购买上限
boolean
limitResult
=
orderTools
.
checkAllowPurchase
(
"MEMBER_CARD"
,
cardId
,
memberId
,
"1"
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getBoolean
(
"success"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
limitResult
==
true
)
{
//创建待支付订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
0
,
"1"
);
String
success
=
orderResult
.
getString
(
"success"
);
String
getDetailId
=
orderResult
.
getString
(
"result"
);
Assert
.
assertEquals
(
success
,
"true"
,
"创建待支付订单失败"
);
//获取订单详情
JSONObject
getDetailResult
=
orderTools
.
getDetail
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
id
=
getDetailResult
.
getJSONObject
(
"result"
).
getString
(
"id"
);
//订单id
String
state
=
getDetailResult
.
getJSONObject
(
"result"
).
getString
(
"state"
);
Assert
.
assertEquals
(
id
.
equals
(
getDetailId
),
true
,
"获取创建的订单详情失败"
);
Assert
.
assertEquals
(
state
,
"WAITING"
,
"获取创建的订单状态未是待支付"
);
//取消订单
JSONObject
cancel
=
orderTools
.
cancel
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
cancelSuccess
=
cancel
.
getString
(
"success"
);
Assert
.
assertEquals
(
cancelSuccess
,
"true"
,
"取消待支付订单失败"
);
//获取订单详情
JSONObject
getDetailResult1
=
orderTools
.
getDetail
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
id1
=
getDetailResult1
.
getJSONObject
(
"result"
).
getString
(
"id"
);
//订单id
String
state1
=
getDetailResult1
.
getJSONObject
(
"result"
).
getString
(
"state"
);
Assert
.
assertEquals
(
id1
.
equals
(
getDetailId
),
true
,
"获取取消的订单详情失败"
);
Assert
.
assertEquals
(
state1
,
"CANCEL"
,
"获取取消的订单状态未是已取消"
);
}
}
}
src/main/java/com/xiaomai/cases/polar/finance/order/TestDiscard.java
0 → 100644
View file @
764911f5
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.finance.revenueAndExpenditure.RevenueAndExpenditureTools
;
import
com.xiaomai.cases.polar.member.Tools
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.RandomStringUtil
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestDiscard
extends
XMBaseTest
{
Tools
tools
=
new
Tools
();
OrderTools
orderTools
=
new
OrderTools
();
RevenueAndExpenditureTools
revenueAndExpenditureTools
=
new
RevenueAndExpenditureTools
();
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_discard"
)
.
setLoginUser
(
LoginAccount
.
GYM_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"作废签单订单"
)
public
void
testDiscard
(){
//获取会员ID
String
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取会员卡信息
//获取会员卡列表
JSONObject
memberCard
=
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
quantity
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"balance"
));
float
price
=
Float
.
parseFloat
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"price"
));
int
validPeriod
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"validPeriod"
));
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取签单要用的卡快照id
String
latestSnapshotId
=
orderTools
.
fetchDetailById
(
cardId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getJSONObject
(
"result"
).
getString
(
"latestSnapshotId"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//检查会员对该卡是否超出购买上限
boolean
limitResult
=
orderTools
.
checkAllowPurchase
(
"MEMBER_CARD"
,
cardId
,
memberId
,
"1"
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getBoolean
(
"success"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
limitResult
==
true
)
{
//创建订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
price
-
price
/
2
,
"1"
);
String
success
=
orderResult
.
getString
(
"success"
);
String
getDetailId
=
orderResult
.
getString
(
"result"
);
Assert
.
assertEquals
(
success
,
"true"
,
"创建订单失败"
);
try
{
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取订单详情
JSONObject
getDetailResult
=
orderTools
.
getDetail
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
id
=
getDetailResult
.
getJSONObject
(
"result"
).
getString
(
"id"
);
String
businessNo
=
getDetailResult
.
getJSONObject
(
"result"
).
getString
(
"businessNo"
);
Assert
.
assertEquals
(
id
.
equals
(
getDetailId
),
true
,
"获取创建的订单详情失败"
);
//校验是否可以作废订单
boolean
checkDiscardVoucherResult
=
orderTools
.
checkDiscardVoucher
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getBoolean
(
"success"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
checkDiscardVoucherResult
==
true
){
JSONObject
discardResult
=
orderTools
.
discard
(
getDetailId
,
"重复录入"
,
"已作废签单订单"
+
RandomStringUtil
.
randomString
(
10
),
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
discardSuccess
=
discardResult
.
getString
(
"success"
);
Assert
.
assertEquals
(
discardSuccess
,
"true"
,
"签单订单作废失败"
);
//验证订单状态
//获取订单详情--订单状态:已作废
JSONObject
getDetailResult1
=
orderTools
.
getDetail
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
state
=
getDetailResult1
.
getJSONObject
(
"result"
).
getString
(
"state"
);
Assert
.
assertEquals
(
state
,
"DISCARD"
,
"签单订单作废失败"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取订单支付记录--支付记录被作废
JSONObject
listByVoucherIdResult
=
orderTools
.
listByVoucherId
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
listByVoucherId
=
listByVoucherIdResult
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getString
(
"id"
);
//收支的id
String
listByVoucherState
=
listByVoucherIdResult
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getString
(
"state"
);
String
paymentWayId
=
listByVoucherIdResult
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getJSONObject
(
"paymentWay"
).
getString
(
"id"
);
Assert
.
assertEquals
(
listByVoucherState
,
"DISCARD"
,
"签单订单的支付记录未被作废"
);
//获取已作废收支明细
JSONObject
pageDiscardIncomeExpenseResult
=
revenueAndExpenditureTools
.
pageDiscardIncomeExpense
(
paymentWayId
,
"INCOME"
,
"SIGN"
,
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
int
pageDiscardIncomeExpensePages
=
Integer
.
parseInt
(
pageDiscardIncomeExpenseResult
.
getJSONObject
(
"result"
).
getString
(
"pages"
));
int
pageDiscardIncomeExpenseTotal
=
Integer
.
parseInt
(
pageDiscardIncomeExpenseResult
.
getJSONObject
(
"result"
).
getString
(
"total"
));
for
(
int
k
=
0
;
k
==
pageDiscardIncomeExpensePages
+
1
;
k
++){
int
n
=
k
==
pageDiscardIncomeExpensePages
?
(
pageDiscardIncomeExpenseTotal
%
10
==
0
?
10
:
pageDiscardIncomeExpenseTotal
%
10
)
:
10
;
JSONArray
records
=
pageDiscardIncomeExpenseResult
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
);
boolean
flag
=
true
;
for
(
int
i
=
0
;
i
<
n
;
i
++){
String
pageDiscardIncomeExpenseId
=
records
.
getJSONObject
(
i
).
getString
(
"id"
);
if
(
pageDiscardIncomeExpenseId
.
equals
(
listByVoucherId
)){
flag
=
true
;
break
;
}
}
Assert
.
assertEquals
(
true
,
flag
,
"签单订单的收支明细未被作废"
);
}
//获取已作废收支详情
JSONObject
getResult
=
revenueAndExpenditureTools
.
get
(
listByVoucherId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
getBusinessNo
=
getResult
.
getJSONObject
(
"result"
).
getString
(
"businessNo"
);
String
getState
=
getResult
.
getJSONObject
(
"result"
).
getString
(
"state"
);
Assert
.
assertEquals
(
getBusinessNo
.
equals
(
businessNo
),
true
,
"签单订单的收支明细未被作废"
);
Assert
.
assertEquals
(
getState
,
"DISCARD"
,
"签单订单的收支明细未被作废"
);
}
else
{
Assert
.
assertEquals
(
checkDiscardVoucherResult
,
false
,
"签单订单不能作废"
);
}
}
}
}
src/main/java/com/xiaomai/cases/polar/finance/order/TestModifyMemo.java
0 → 100644
View file @
764911f5
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.finance.revenueAndExpenditure.RevenueAndExpenditureTools
;
import
com.xiaomai.cases.polar.member.Tools
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.RandomStringUtil
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
import
java.util.Random
;
public
class
TestModifyMemo
extends
XMBaseTest
{
Tools
tools
=
new
Tools
();
OrderTools
orderTools
=
new
OrderTools
();
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_modifySupplierMemo"
)
.
setLoginUser
(
LoginAccount
.
GYM_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@Test
(
description
=
"修改备注"
)
public
void
testModifyMemo
(){
//获取会员ID
String
memberId
=
tools
.
search
(
"NORMAL"
,
"NORMAL"
).
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取会员卡信息
//获取会员卡列表
JSONObject
memberCard
=
orderTools
.
fetchPageOfMemberCard
(
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
cardId
=
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"id"
);
int
quantity
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"balance"
));
float
price
=
Float
.
parseFloat
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"price"
));
int
validPeriod
=
Integer
.
parseInt
(
memberCard
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
).
getJSONObject
(
0
).
getString
(
"validPeriod"
));
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取签单要用的卡快照id
String
latestSnapshotId
=
orderTools
.
fetchDetailById
(
cardId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getJSONObject
(
"result"
).
getString
(
"latestSnapshotId"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//检查会员对该卡是否超出购买上限
boolean
limitResult
=
orderTools
.
checkAllowPurchase
(
"MEMBER_CARD"
,
cardId
,
memberId
,
"1"
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
()).
getBoolean
(
"success"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
if
(
limitResult
==
true
){
//创建订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
price
-
price
/
2
,
"1"
);
String
success
=
orderResult
.
getString
(
"success"
);
String
getDetailId
=
orderResult
.
getString
(
"result"
);
Assert
.
assertEquals
(
success
,
"true"
,
"创建订单失败"
);
try
{
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取订单详情
JSONObject
getDetailResult
=
orderTools
.
getDetail
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
id
=
getDetailResult
.
getJSONObject
(
"result"
).
getString
(
"id"
);
String
businessNo
=
getDetailResult
.
getJSONObject
(
"result"
).
getString
(
"businessNo"
);
Assert
.
assertEquals
(
id
.
equals
(
getDetailId
),
true
,
"获取创建的订单详情失败"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//修改对内备注
JSONObject
modifySupplierInnerMemoResult
=
orderTools
.
modifySupplierInnerMemo
(
getDetailId
,
"已修改对内备注"
+
RandomStringUtil
.
randomString
(
10
),
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
modifySupplierInnerMemoSuccess
=
modifySupplierInnerMemoResult
.
getString
(
"success"
);
Assert
.
assertEquals
(
modifySupplierInnerMemoSuccess
,
"true"
,
"修改对内备注失败"
);
//修改对外备注
JSONObject
modifySupplierMemoResult
=
orderTools
.
modifySupplierMemo
(
getDetailId
,
"已修改对外备注"
+
RandomStringUtil
.
randomString
(
10
),
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
modifySupplierMemoResultSuccess
=
modifySupplierMemoResult
.
getString
(
"success"
);
Assert
.
assertEquals
(
modifySupplierMemoResultSuccess
,
"true"
,
"修改对外备注失败"
);
}
}
}
src/main/java/com/xiaomai/cases/polar/finance/order/TestSignOrder.java
View file @
764911f5
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
order
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.cases.polar.finance.revenueAndExpenditure.RevenueAndExpenditureTools
;
import
com.xiaomai.cases.polar.member.Tools
;
import
com.xiaomai.client.XMAppApi
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.Test
;
public
class
TestSignOrder
extends
XMBaseTest
{
Tools
tools
=
new
Tools
();
OrderTools
orderTools
=
new
OrderTools
();
RevenueAndExpenditureTools
revenueAndExpenditureTools
=
new
RevenueAndExpenditureTools
();
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_signOrder"
)
.
setLoginUser
(
LoginAccount
.
GYM
_PROD
)
.
setLoginUser
(
LoginAccount
.
YFF
_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
...
...
@@ -70,16 +75,88 @@ public class TestSignOrder extends XMBaseTest {
throw
new
RuntimeException
(
e
);
}
if
(
limitResult
==
true
){
if
(
limitResult
==
true
){
//创建订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
"PURCHASE"
,
memberId
,
price
,
price
,
"1"
);
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
price
-
price
/
2
,
"1"
);
String
success
=
orderResult
.
getString
(
"success"
);
String
getDetailId
=
orderResult
.
getString
(
"result"
);
Assert
.
assertEquals
(
success
,
"true"
,
"创建订单失败"
);
try
{
Thread
.
sleep
(
3000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取订单详情
JSONObject
getDetailResult
=
orderTools
.
getDetail
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
id
=
getDetailResult
.
getJSONObject
(
"result"
).
getString
(
"id"
);
String
businessNo
=
getDetailResult
.
getJSONObject
(
"result"
).
getString
(
"businessNo"
);
String
state
=
getDetailResult
.
getJSONObject
(
"result"
).
getString
(
"state"
);
Assert
.
assertEquals
(
id
.
equals
(
getDetailId
),
true
,
"获取创建的订单详情失败"
);
Assert
.
assertEquals
(
state
,
"PAID"
,
"获取创建的订单未完成"
);
//获取订单支付记录
JSONObject
listByVoucherIdResult
=
orderTools
.
listByVoucherId
(
getDetailId
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
listByVoucherId
=
listByVoucherIdResult
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getString
(
"voucherId"
);
//订单的id
String
paymentWayId
=
listByVoucherIdResult
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getJSONObject
(
"paymentWay"
).
getString
(
"id"
);
String
listByVoucherState
=
listByVoucherIdResult
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getString
(
"state"
);
String
id1
=
listByVoucherIdResult
.
getJSONArray
(
"result"
).
getJSONObject
(
0
).
getString
(
"id"
);
//收支的id
Assert
.
assertEquals
(
listByVoucherId
.
equals
(
getDetailId
),
true
,
"获取创建的订单的支付记录失败"
);
Assert
.
assertEquals
(
listByVoucherState
,
"NORMAL"
,
"获取创建的订单的支付记录状态未是已完成"
);
//获取订单管理列表
JSONObject
pageVoucherResult
=
orderTools
.
pageVoucher1
(
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
(),
businessNo
);
int
total
=
Integer
.
parseInt
(
pageVoucherResult
.
getJSONObject
(
"result"
).
getString
(
"total"
));
Assert
.
assertEquals
(
total
>=
1
,
true
,
"订单管理列表获取创建的订单失败"
);
try
{
Thread
.
sleep
(
1000
);
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
}
//获取收支明细
JSONObject
pageNormalIncomeExpenseResult
=
revenueAndExpenditureTools
.
pageNormalIncomeExpense
(
paymentWayId
,
"INCOME"
,
"SIGN"
,
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
int
pageNormalIncomeExpensePages
=
Integer
.
parseInt
(
pageNormalIncomeExpenseResult
.
getJSONObject
(
"result"
).
getString
(
"pages"
));
int
pageNormalIncomeExpenseTotal
=
Integer
.
parseInt
(
pageNormalIncomeExpenseResult
.
getJSONObject
(
"result"
).
getString
(
"total"
));
for
(
int
k
=
0
;
k
==
pageNormalIncomeExpensePages
+
1
;
k
++){
int
n
=
k
==
pageNormalIncomeExpensePages
?
(
pageNormalIncomeExpenseTotal
%
10
==
0
?
10
:
pageNormalIncomeExpenseTotal
%
10
)
:
10
;
JSONArray
records
=
pageNormalIncomeExpenseResult
.
getJSONObject
(
"result"
).
getJSONArray
(
"records"
);
boolean
flag
=
true
;
for
(
int
i
=
0
;
i
<
n
;
i
++){
String
pageNormalIncomeExpenseId
=
records
.
getJSONObject
(
i
).
getString
(
"id"
);
if
(
pageNormalIncomeExpenseId
.
equals
(
id1
)){
flag
=
true
;
break
;
}
}
Assert
.
assertEquals
(
true
,
flag
,
"创建订单未生成对应的收支明细"
);
}
//获取收支详情
JSONObject
getResult
=
revenueAndExpenditureTools
.
get
(
id1
,
xmAppApi
.
getLoginInfo
().
getBrandId
(),
xmAppApi
.
getLoginInfo
().
getStudioId
(),
xmAppApi
.
getLoginInfo
().
getAdminId
());
String
getBusinessNo
=
getResult
.
getJSONObject
(
"result"
).
getString
(
"businessNo"
);
String
getState
=
getResult
.
getJSONObject
(
"result"
).
getString
(
"state"
);
Assert
.
assertEquals
(
getBusinessNo
.
equals
(
businessNo
),
true
,
"获取创建的订单的收支详情失败"
);
Assert
.
assertEquals
(
getState
,
"NORMAL"
,
"创建的订单的收支明细状态未是已完成"
);
}
else
{
}
else
{
Assert
.
assertEquals
(
limitResult
,
false
,
"无法购买,已达到最多购买N张的上限"
);
}
}
}
...
...
src/main/java/com/xiaomai/cases/polar/finance/revenueAndExpenditure/RevenueAndExpenditureTools.java
0 → 100644
View file @
764911f5
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
revenueAndExpenditure
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.client.DataUserInfo
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
java.util.Date
;
public
class
RevenueAndExpenditureTools
extends
XMBaseTest
{
/**
* @param
* @description:分页收支列表
* @param paymentWays:支付方式 1 2
* @param type: 业务收支类型:INCOME:收入 EXPENSE:支出
* @param item: 业务收支类型:SIGN:签单 REFUND:退单
* @param supplierId:卖家ID 场馆ID
* @param brandId:品牌ID
* @param studioId:场馆ID
* @param operatorId:操作人ID
* @author: yangfangfang
**/
public
JSONObject
pageNormalIncomeExpense
(
String
paymentWays
,
String
type
,
String
item
,
String
supplierId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageNormalIncomeExpense"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
paymentWays
);
jsonObject
.
put
(
"paymentWays"
,
jsonArray
);
jsonObject
.
put
(
"type"
,
type
);
jsonObject
.
put
(
"item"
,
item
);
jsonObject
.
put
(
"supplierId"
,
supplierId
);
jsonObject
.
put
(
"brandId"
,
brandId
);
jsonObject
.
put
(
"studioId"
,
studioId
);
jsonObject
.
put
(
"operatorId"
,
operatorId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @param
* @description:统计收支
* @param supplierId:卖家ID 场馆ID
* @param brandId:品牌ID
* @param studioId:场馆ID
* @param operatorId:操作人ID
* @author: yangfangfang
**/
public
JSONObject
sumNormalIncomeExpense
(
String
paymentWays
,
String
type
,
String
item
,
String
supplierId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_sumNormalIncomeExpense"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
paymentWays
);
jsonObject
.
put
(
"paymentWays"
,
jsonArray
);
jsonObject
.
put
(
"type"
,
type
);
jsonObject
.
put
(
"item"
,
item
);
jsonObject
.
put
(
"supplierId"
,
supplierId
);
jsonObject
.
put
(
"brandId"
,
brandId
);
jsonObject
.
put
(
"studioId"
,
studioId
);
jsonObject
.
put
(
"operatorId"
,
operatorId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @param
* @description:分页作废收支列表
* @param supplierId:卖家ID 场馆ID
* @param brandId:品牌ID
* @param studioId:场馆ID
* @param operatorId:操作人ID
* @author: yangfangfang
**/
public
JSONObject
pageDiscardIncomeExpense
(
String
paymentWays
,
String
type
,
String
item
,
String
supplierId
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_pageDiscardIncomeExpense"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
paymentWays
);
jsonObject
.
put
(
"paymentWays"
,
jsonArray
);
jsonObject
.
put
(
"type"
,
type
);
jsonObject
.
put
(
"item"
,
item
);
jsonObject
.
put
(
"supplierId"
,
supplierId
);
jsonObject
.
put
(
"brandId"
,
brandId
);
jsonObject
.
put
(
"studioId"
,
studioId
);
jsonObject
.
put
(
"operatorId"
,
operatorId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @param
* @description:获取收支的支付/退款记录
* @param id:主键ID
* @param brandId:品牌ID
* @param studioId:场馆ID
* @param operatorId:操作人ID
* @author: yangfangfang
**/
public
JSONObject
get
(
String
id
,
String
brandId
,
String
studioId
,
String
operatorId
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_get"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"id"
,
id
);
jsonObject
.
put
(
"brandId"
,
brandId
);
jsonObject
.
put
(
"studioId"
,
studioId
);
jsonObject
.
put
(
"operatorId"
,
operatorId
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
).
assetsSuccess
(
true
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
}
src/main/java/com/xiaomai/cases/polar/finance/revenueAndExpenditure/TestSumNormalIncomeExpense.java
0 → 100644
View file @
764911f5
package
com
.
xiaomai
.
cases
.
polar
.
finance
.
revenueAndExpenditure
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.xiaomai.enums.ApiModule
;
import
com.xiaomai.enums.LoginAccount
;
import
com.xiaomai.enums.RequestType
;
import
com.xiaomai.enums.Terminal
;
import
com.xiaomai.utils.XMBaseTest
;
import
org.testng.Assert
;
import
org.testng.annotations.BeforeMethod
;
import
org.testng.annotations.DataProvider
;
import
org.testng.annotations.Test
;
public
class
TestSumNormalIncomeExpense
extends
XMBaseTest
{
@BeforeMethod
public
void
beforeTest
(){
xmAppApi
.
setApiModule
(
ApiModule
.
Polar_Finance
)
.
setApiName
(
"API_sumNormalIncomeExpense"
)
.
setLoginUser
(
LoginAccount
.
GYM_PROD
)
.
setTerminal
(
Terminal
.
B
);
dal
.
setCase_owner
(
"yff"
)
.
setCase_name
(
Thread
.
currentThread
().
getStackTrace
()[
1
].
getFileName
().
split
(
"\\."
)[
0
]);
super
.
beforeTest
();
}
@DataProvider
public
Object
[][]
dataProvider
(){
return
new
Object
[][]{
{
"INCOME"
,
"SIGN"
},
//收入,签单
{
"EXPENSE"
,
"REFUND"
}
//支出,退单
};
}
@Test
(
description
=
"获取统计收支"
,
dataProvider
=
"dataProvider"
)
public
void
testSumNormalIncomeExpense
(
String
type
,
String
item
){
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"current"
,
0
);
jsonObject
.
put
(
"size"
,
20
);
JSONArray
jsonArray
=
new
JSONArray
();
jsonArray
.
add
(
"1"
);
jsonObject
.
put
(
"paymentWays"
,
jsonArray
);
jsonObject
.
put
(
"type"
,
type
);
jsonObject
.
put
(
"item"
,
item
);
jsonObject
.
put
(
"supplierId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"brandId"
,
xmAppApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"studioId"
,
xmAppApi
.
getLoginInfo
().
getStudioId
());
jsonObject
.
put
(
"operatorId"
,
xmAppApi
.
getLoginInfo
().
getAdminId
());
xmAppApi
.
doRequest
(
RequestType
.
JSON
,
params
,
jsonObject
.
toJSONString
(),
headers
).
assetsSuccess
(
true
);
JSONObject
response
=
xmAppApi
.
getBodyInJSON
();
String
success
=
response
.
getString
(
"success"
);
Assert
.
assertEquals
(
success
,
"true"
,
"获取统计收支失败"
);
}
}
src/main/java/com/xiaomai/cases/polar/reserve/TestAddMemberReserve.java
View file @
764911f5
...
...
@@ -337,7 +337,8 @@ public class TestAddMemberReserve extends BaseTestImpl {
if
(
limitResult
==
true
){
//创建订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
"PURCHASE"
,
memberId
,
price
,
price
,
"1"
);
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
price
-
price
/
2
,
"1"
);
}
}
...
...
src/main/java/com/xiaomai/cases/polar/reserve/TestAddToQueue.java
View file @
764911f5
...
...
@@ -246,7 +246,8 @@ public class TestAddToQueue extends BaseTestImpl {
if
(
limitResult
==
true
){
//创建订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
"PURCHASE"
,
memberId
,
price
,
price
,
"1"
);
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
price
-
price
/
2
,
"1"
);
}
}
...
...
src/main/java/com/xiaomai/cases/polar/reserve/TestSignIn.java
View file @
764911f5
...
...
@@ -219,7 +219,8 @@ public class TestSignIn extends BaseTestImpl {
if
(
limitResult
==
true
){
//创建订单
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
"PURCHASE"
,
memberId
,
price
,
price
,
"1"
);
JSONObject
orderResult
=
orderTools
.
signOrder
(
cardId
,
latestSnapshotId
,
quantity
,
price
,
validPeriod
,
latestSnapshotId
,
price
/
2
,
"PURCHASE"
,
"MEMBER_CARD"
,
memberId
,
price
-
price
/
2
,
price
-
price
/
2
,
"1"
);
}
}
...
...
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