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
7e5d5f8c
Commit
7e5d5f8c
authored
Oct 25, 2024
by
yangfangfang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
批量约团课相关接口case
parent
1cf00989
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
157 additions
and
0 deletions
+157
-0
src/main/java/com/xiaomai/cases/polar/reserve/ReserveTools.java
+157
-0
src/main/java/com/xiaomai/cases/polar/reserve/group/TestBatchReserveGroup.java
+0
-0
No files found.
src/main/java/com/xiaomai/cases/polar/reserve/ReserveTools.java
View file @
7e5d5f8c
...
@@ -11,6 +11,8 @@ import com.xiaomai.utils.XMBaseTest;
...
@@ -11,6 +11,8 @@ import com.xiaomai.utils.XMBaseTest;
import
com.xiaomai.utils.XMJSONPath
;
import
com.xiaomai.utils.XMJSONPath
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.Date
;
/**
/**
* @BelongsProject: xm-sportstest
* @BelongsProject: xm-sportstest
* @BelongsPackage: com.xiaomai.cases.polar.reserve
* @BelongsPackage: com.xiaomai.cases.polar.reserve
...
@@ -186,6 +188,63 @@ public class ReserveTools extends XMBaseTest {
...
@@ -186,6 +188,63 @@ public class ReserveTools extends XMBaseTest {
return
dataApi
.
getBodyInJSON
().
getJSONObject
(
"result"
).
getJSONArray
(
"records"
);
return
dataApi
.
getBodyInJSON
().
getJSONObject
(
"result"
).
getJSONArray
(
"records"
);
}
}
/**
* @description:获取会员预约记录列表
* @author: xuyamei
* @date: 2024/6/12 15:26
* @param courseId 课程id
* @param reserveStateSet 预约状态
* @param signState 签到状态
* @param coachId 教练id
* @param scheduleStartTime 上课开始时间
* @param scheduleEndDate 上课结束时间
* @param memberId 会员id
* @param courseType 课程类型 GROUP_CLASS:团课
* @param dataUserInfos
* @return: com.alibaba.fastjson.JSONObject
**/
public
JSONObject
getPageByMember1
(
String
courseId
,
String
reserveStateSet
,
String
signState
,
String
coachId
,
String
scheduleStartTime
,
String
scheduleEndDate
,
String
memberId
,
String
courseType
,
DataUserInfo
...
dataUserInfos
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Reserve
)
.
setApiName
(
"API_memberReserve_getPageByMember"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
(
dataUserInfos
);
JSONObject
body
=
new
JSONObject
();
body
.
put
(
"current"
,
0
);
body
.
put
(
"size"
,
20
);
if
(!
courseId
.
equals
(
""
)){
body
.
put
(
"courseId"
,
courseId
);
}
if
(!
reserveStateSet
.
equals
(
""
)){
JSONArray
reserveState
=
new
JSONArray
();
reserveState
.
add
(
reserveStateSet
);
body
.
put
(
"reserveStateSet"
,
reserveState
);
}
if
(!
signState
.
equals
(
""
)){
body
.
put
(
"signInState"
,
signState
);
}
if
(!
coachId
.
equals
(
""
)){
body
.
put
(
"coachId"
,
coachId
);
}
if
(
scheduleStartTime
!=
null
){
body
.
put
(
"scheduleStartTime"
,
scheduleStartTime
);
body
.
put
(
"scheduleEndDate"
,
scheduleEndDate
);
}
if
(!
memberId
.
equals
(
""
)){
body
.
put
(
"memberId"
,
memberId
);
}
body
.
put
(
"courseType"
,
courseType
);
body
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
body
.
put
(
"operatorId"
,
dataApi
.
getLoginInfo
().
getAdminId
());
// 操作人id
body
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
return
dataApi
.
getBodyInJSON
().
getJSONObject
(
"result"
);
}
/**
/**
* @description:预约记录列表
* @description:预约记录列表
* @author: xuyamei
* @author: xuyamei
...
@@ -667,4 +726,102 @@ public class ReserveTools extends XMBaseTest {
...
@@ -667,4 +726,102 @@ public class ReserveTools extends XMBaseTest {
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
body
.
toString
(),
dataheadrs
).
assetsSuccess
(
true
);
}
}
/**
* @description:获取批量预约团课课次信息
* @author: yff
* @date: 2024/10/21
* @param courseId 课程id
* @param coachIds 上课教练ids
* @param startDate 上课时间范围-开始日期
* @param endDate 上课时间范围-结束日期
* @param leftCapacity 剩余可约人数
* @param minuteOffset 上课时间范围开始分钟
* @param spanMinutes 上课时间范围结束分钟
**/
public
JSONObject
getCanReserveGroupScheduleList
(
String
courseId
,
String
coachIds
,
String
startDate
,
String
endDate
,
int
leftCapacity
,
int
minuteOffset
,
int
spanMinutes
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Reserve
)
.
setApiName
(
"API_getCanReserveGroupScheduleList"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
();
JSONObject
jsonObject
=
new
JSONObject
();
JSONArray
day
=
new
JSONArray
();
//上课星期
day
.
add
(
1
);
day
.
add
(
2
);
day
.
add
(
3
);
day
.
add
(
4
);
day
.
add
(
5
);
day
.
add
(
6
);
day
.
add
(
7
);
jsonObject
.
put
(
"weekdays"
,
day
);
jsonObject
.
put
(
"courseId"
,
courseId
);
JSONArray
coach
=
new
JSONArray
();
coach
.
add
(
coachIds
);
jsonObject
.
put
(
"coachIds"
,
coach
);
jsonObject
.
put
(
"startDate"
,
startDate
);
jsonObject
.
put
(
"endDate"
,
endDate
);
jsonObject
.
put
(
"leftCapacity"
,
leftCapacity
);
jsonObject
.
put
(
"minuteOffset"
,
minuteOffset
);
jsonObject
.
put
(
"spanMinutes"
,
spanMinutes
);
jsonObject
.
put
(
"size"
,
10
);
jsonObject
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"operatorId"
,
dataApi
.
getLoginInfo
().
getAdminId
());
// 操作人id
jsonObject
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
/**
* @description:批量预约团课校验(该方法被我写成了两个会员的情况,所以必须传两个了)
* @author: yff
* @date: 2024/10/21
* @param reserveScheduleEndDate 批量预约最晚日期
* @param planCheckTotalBalance1 会员1预约预计消耗总次数=所选课次*会员预约人数(带几人)*这个卡消耗一次扣除的次数
* @param memberId1 会员1ID
* @param benefitId1 卡1权益ID(会员1准备使用的卡)
* @param planCheckTotalBalance2 会员2预约预计消耗总次数=所选课次*会员预约人数(带几人)*这个卡消耗一次扣除的次数
* @param memberId2 会员2ID
* @param benefitId2 卡2权益ID(会员2准备使用的卡)
**/
public
JSONObject
checkBatchReserve
(
String
reserveScheduleEndDate
,
int
planCheckTotalBalance1
,
String
memberId1
,
String
benefitId1
,
int
planCheckTotalBalance2
,
String
memberId2
,
String
benefitId2
){
dataApi
.
setApiModule
(
ApiModule
.
Polar_Reserve
)
.
setApiName
(
"API_checkBatchReserve"
)
.
setTerminal
(
Terminal
.
B
);
super
.
beforeDataRequest
();
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"reserveScheduleEndDate"
,
reserveScheduleEndDate
);
JSONArray
memberInfoList
=
new
JSONArray
();
JSONObject
jsonObject1
=
new
JSONObject
();
jsonObject1
.
put
(
"planCheckTotalBalance"
,
planCheckTotalBalance1
);
jsonObject1
.
put
(
"memberId"
,
memberId1
);
jsonObject1
.
put
(
"benefitId"
,
benefitId1
);
memberInfoList
.
add
(
jsonObject1
);
JSONObject
jsonObject2
=
new
JSONObject
();
jsonObject2
.
put
(
"planCheckTotalBalance"
,
planCheckTotalBalance2
);
jsonObject2
.
put
(
"memberId"
,
memberId2
);
jsonObject2
.
put
(
"benefitId"
,
benefitId2
);
memberInfoList
.
add
(
jsonObject2
);
jsonObject
.
put
(
"memberInfoList"
,
memberInfoList
);
jsonObject
.
put
(
"brandId"
,
dataApi
.
getLoginInfo
().
getBrandId
());
jsonObject
.
put
(
"operatorId"
,
dataApi
.
getLoginInfo
().
getAdminId
());
// 操作人id
jsonObject
.
put
(
"studioId"
,
dataApi
.
getLoginInfo
().
getStudioId
());
dataApi
.
doRequest
(
RequestType
.
JSON
,
dataparams
,
jsonObject
.
toJSONString
(),
dataheadrs
);
JSONObject
response
=
dataApi
.
getBodyInJSON
();
return
response
;
}
}
}
src/main/java/com/xiaomai/cases/polar/reserve/group/TestBatchReserveGroup.java
0 → 100644
View file @
7e5d5f8c
This diff is collapsed.
Click to expand it.
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