Commit 20dc25b2 by xuyamei

修改报错

parent bdeb4cf9
......@@ -3,6 +3,7 @@ package com.xiaomai.cases.polar.reserve.personal;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.basetest.BaseTestImpl;
import com.xiaomai.cases.polar.admin.AdminTools;
import com.xiaomai.cases.polar.clue.MemberTools;
import com.xiaomai.cases.polar.course.CourseTools;
import com.xiaomai.cases.polar.finance.order.OrderTools;
......@@ -46,7 +47,8 @@ public class TestSignReservePerson extends BaseTestImpl {
@Resource(name = "groupScheduleTools")
GroupScheduleTools groupScheduleTools;
@Resource(name="adminTools")
AdminTools adminTools;
MemberTools memberTools = new MemberTools();
......@@ -92,11 +94,17 @@ public class TestSignReservePerson extends BaseTestImpl {
// 第三步:查询存量的私教教练,并将教练添加到课程中
// 获取到员工
// 获取教练列表
JSONObject pageStudioPersonalCoach = reserveTools.pageStudioPersonalCoach("");
int total = pageStudioPersonalCoach.getInteger("total");
Random rand = new Random();
// 随机取1个教练
coachedId = pageStudioPersonalCoach.getJSONArray("records").getJSONObject(rand.nextInt(total > 10 ? 10 : total)).getString("id");
JSONObject pageStudioPersonalCoach = reserveTools.pageStudioPersonalCoach("1V1约课签到教练");
if (pageStudioPersonalCoach.getJSONArray("records").size()==0){
adminTools.addStudioAdmin("教练","1V1约课签到教练");
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
pageStudioPersonalCoach = reserveTools.pageStudioPersonalCoach("1V1约课签到教练");
}
coachedId = pageStudioPersonalCoach.getJSONArray("records").getJSONObject(0).getString("id");
// 编辑私教课程教练添加到课程中
courseTools.editPersonalCourse(categoryId, courseId, courseName, 10, coachedId, "1");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment