Commit f526a59b by yangfangfang

数据中心-财务数据-营收数据

parent 765f7e34
...@@ -100,4 +100,68 @@ public class FinanceDataTools extends XMBaseTest { ...@@ -100,4 +100,68 @@ public class FinanceDataTools extends XMBaseTest {
return response; return response;
} }
/**
* @param
* @description:获取数据中心-财务数据-营收数据-全部
* @param dateType:时间类型:[ DAY, WEEK, MONTH, QUARTER, YEAR ]
* @param startTime:开始时间
* @param endTime:结束时间 注意:使用这个方法只能搜按天和按月,因为参数类型这里写的long 其他几个不是long型,会用不了
* @author: yangfangfang
**/
public JSONObject getCostData_all(String dateType,long startTime, long endTime, DataUserInfo...dataUserInfos){
dataApi.setApiModule(ApiModule.Polar_Data)
.setApiName("API_getCostData")
.setTerminal(Terminal.B);
super.beforeDataRequest(dataUserInfos);
JSONObject getCostData=new JSONObject();
getCostData.put("dateType",dateType);
getCostData.put("endTime",endTime );
getCostData.put("startTime",startTime);
getCostData.put("brandId",xmAppApi.getLoginInfo().getBrandId());
getCostData.put("studioId",xmAppApi.getLoginInfo().getStudioId());
getCostData.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON, dataparams, getCostData.toJSONString(), dataheadrs).assetsSuccess(true);
JSONObject response=dataApi.getBodyInJSON();
return response;
}
/**
* @param
* @description:获取数据中心-财务数据-营收数据-根据类型筛选
* @param dateType:时间类型:[ DAY, WEEK, MONTH, QUARTER, YEAR ]
* @param startTime:开始时间
* @param endTime:结束时间 注意:使用这个方法只能搜按天和按月,因为参数类型这里写的long 其他几个不是long型,会用不了
* @param type:* ex-enum-descriptions: List [ "会员卡", "训练营", "储值卡", "体验卡", "单次约课" ][ MEMBER_CARD, TRAINING_CAMP, DEPOSIT_CARD, EXPERIENCE_CARD, SINGLE_RESERVE ]
* @author: yangfangfang
**/
public JSONObject getCostData_type(String dateType,String type,long startTime, long endTime, DataUserInfo...dataUserInfos){
dataApi.setApiModule(ApiModule.Polar_Data)
.setApiName("API_getCostData")
.setTerminal(Terminal.B);
super.beforeDataRequest(dataUserInfos);
JSONObject getCostData=new JSONObject();
getCostData.put("dateType",dateType);
getCostData.put("endTime",endTime );
getCostData.put("startTime",startTime);
getCostData.put("type",type);
getCostData.put("brandId",xmAppApi.getLoginInfo().getBrandId());
getCostData.put("studioId",xmAppApi.getLoginInfo().getStudioId());
getCostData.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON, dataparams, getCostData.toJSONString(), dataheadrs).assetsSuccess(true);
JSONObject response=dataApi.getBodyInJSON();
return response;
}
} }
package com.xiaomai.cases.polar.data.financeData;
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.TimeUtils;
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 TestGetCostDetail extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Data)
.setApiName("API_getCostDetail")
.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[][]{
{"DAY","LEFT_AMOUNT_ASC","MEMBER_CARD",TimeUtils.getTodayEndTime(),TimeUtils.getTodayTime()},//今天,排序:待消耗金额正序
{"MONTH","LEFT_AMOUNT_DESC","EXPERIENCE_CARD",TimeUtils.getMonthLastDay(),TimeUtils.getMonthFristDay()},//本月,排序:待消耗金额倒序
{"DAY","CONFIRMED_AMOUNT_ASC", "TRAINING_CAMP",TimeUtils.getTodayEndTime(),TimeUtils.getTodayTime()},//今天,排序:确认金额正序
{"MONTH","CONFIRMED_AMOUNT_DESC","DEPOSIT_CARD",TimeUtils.getMonthLastDay(),TimeUtils.getMonthFristDay()},//本月,排序:确认金额倒序
{"DAY","LEFT_AMOUNT_ASC", "SINGLE_RESERVE",TimeUtils.getTodayEndTime(),TimeUtils.getTodayTime()}//今天,排序:待消耗金额正序
};
}
@Test(description = "获取数据中心-财务数据-营收明细:按天、按月以及各种排序各种类型筛选的营收明细",dataProvider = "dataProvider")
public void testGetCostDetail(String dateType, String sort,String type, long endTime,long startTime){
JSONObject getCostDetail=new JSONObject();
getCostDetail.put("dateType",dateType);
getCostDetail.put("memberId","");
getCostDetail.put("campId","");
getCostDetail.put("depositId","");
getCostDetail.put("sort",sort);
getCostDetail.put("type",type);
getCostDetail.put("itemId","");
getCostDetail.put("endTime",endTime);
getCostDetail.put("startTime",startTime);
getCostDetail.put("brandId",xmAppApi.getLoginInfo().getBrandId());
getCostDetail.put("studioId",xmAppApi.getLoginInfo().getStudioId());
getCostDetail.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
xmAppApi.doRequest(RequestType.JSON,params,getCostDetail.toJSONString(),headers).assetsSuccess(true);
String getOrderDetailResult=xmAppApi.getBodyInJSON().getString("success");
Assert.assertEquals(getOrderDetailResult,"true","获取数据中心-财务数据-营收明细失败");
}
@DataProvider
public Object[][] dataProvider1(){
return new Object[][]{
{"WEEK","LEFT_AMOUNT_ASC","MEMBER_CARD",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,排序:待消耗金额正序
{"WEEK","LEFT_AMOUNT_DESC","EXPERIENCE_CARD",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,排序:待消耗金额倒序
{"WEEK","CONFIRMED_AMOUNT_ASC","TRAINING_CAMP",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,排序:确认金额正序
{"WEEK","CONFIRMED_AMOUNT_DESC","DEPOSIT_CARD",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,排序:确认金额倒序
{"WEEK","LEFT_AMOUNT_ASC","SINGLE_RESERVE",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,排序:待消耗金额正序
};
}
@Test(description = "获取数据中心-财务数据-营收明细:按周以及各种排序各种类型筛选的营收明细",dataProvider = "dataProvider1")
public void testGetCostDetail1(String dateType,String sort,String type,String endTime,String startTime){
JSONObject getCostDetail=new JSONObject();
getCostDetail.put("dateType",dateType);
getCostDetail.put("memberId","");
getCostDetail.put("campId","");
getCostDetail.put("depositId","");
getCostDetail.put("sort",sort);
getCostDetail.put("type",type);
getCostDetail.put("itemId","");
getCostDetail.put("endTime",endTime);
getCostDetail.put("startTime",startTime);
getCostDetail.put("brandId",xmAppApi.getLoginInfo().getBrandId());
getCostDetail.put("studioId",xmAppApi.getLoginInfo().getStudioId());
getCostDetail.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
xmAppApi.doRequest(RequestType.JSON,params,getCostDetail.toJSONString(),headers).assetsSuccess(true);
String getOrderDetailResult=xmAppApi.getBodyInJSON().getString("success");
Assert.assertEquals(getOrderDetailResult,"true","获取数据中心-财务数据-营收明细失败");
}
}
package com.xiaomai.cases.polar.data.financeData;
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.TimeUtils;
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 TestGetCostTrend extends XMBaseTest {
@BeforeMethod
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Data)
.setApiName("API_getCostTrend")
.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[][]{
{"DAY","LEFT_AMOUNT", TimeUtils.getTodayEndTime(),TimeUtils.getTodayTime()},//今天,待消耗金额
{"MONTH","CONFIRMED_AMOUNT",TimeUtils.getMonthLastDay(),TimeUtils.getMonthFristDay()},//本月,确认收入
{"DAY","LEFT_AMOUNT", TimeUtils.getTodayEndTime(),TimeUtils.getTodayTime()},//今天,待消耗金额
{"MONTH","CONFIRMED_AMOUNT",TimeUtils.getMonthLastDay(),TimeUtils.getMonthFristDay()},//本月,确认收入
};
}
@Test(description = "数据中心-财务数据-筛选全部营收数据趋势图",dataProvider = "dataProvider")
public void testGetCostTrend(String dateType,String metric,long endTime,long startTime){
JSONObject trend=new JSONObject();
trend.put("dateType",dateType);
trend.put("endTime", endTime);
trend.put("startTime", startTime);
trend.put("metric",metric);
trend.put("brandId",xmAppApi.getLoginInfo().getBrandId());
trend.put("studioId",xmAppApi.getLoginInfo().getStudioId());
trend.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
xmAppApi.doRequest(RequestType.JSON,params,trend.toJSONString(),headers).assetsSuccess(true);
String trendResult=xmAppApi.getBodyInJSON().getString("success");
Assert.assertEquals(trendResult,"true","获取财务数据-筛选全部营收数据趋势图失败");
}
@DataProvider
public Object[][] dataProvider1(){
return new Object[][]{
{"WEEK","LEFT_AMOUNT","MEMBER_CARD",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,待消耗金额,会员卡
{"WEEK","CONFIRMED_AMOUNT","EXPERIENCE_CARD",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,确认收入,体验卡
{"WEEK","LEFT_AMOUNT","TRAINING_CAMP",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,待消耗金额,训练营
{"WEEK","CONFIRMED_AMOUNT","DEPOSIT_CARD",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,确认收入,储值卡
{"WEEK","LEFT_AMOUNT","SINGLE_RESERVE",TimeUtils.getWeekLastTime(),TimeUtils.getWeekFirstTime()},//本周,待消耗金额,单次约课
};
}
@Test(description = "数据中心-财务数据-筛选本周的各种类型营收数据趋势图",dataProvider = "dataProvider1")
public void testGetCostTrend(String dateType,String metric,String type,String endTime,String startTime){
JSONObject trend=new JSONObject();
trend.put("dateType",dateType);
trend.put("endTime", endTime);
trend.put("startTime", startTime);
trend.put("metric",metric);
trend.put("type",type);
trend.put("brandId",xmAppApi.getLoginInfo().getBrandId());
trend.put("studioId",xmAppApi.getLoginInfo().getStudioId());
trend.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
xmAppApi.doRequest(RequestType.JSON,params,trend.toJSONString(),headers).assetsSuccess(true);
String trendResult=xmAppApi.getBodyInJSON().getString("success");
Assert.assertEquals(trendResult,"true","获取财务数据-筛选本周的各种类型营收数据趋势图失败");
}
}
...@@ -183,7 +183,7 @@ public class TestSignOrder extends XMBaseTest { ...@@ -183,7 +183,7 @@ public class TestSignOrder extends XMBaseTest {
//获取会员下的购买的会员卡 //获取会员下的购买的会员卡
JSONObject fetchUserCardListResult=orderTools.fetchUserCardList("MEMBER",memberId,"NORMAL"); JSONObject fetchUserCardListResult=orderTools.fetchUserCardList("MEMBER",memberId,"NORMAL");
String fetchUserCardListId=fetchUserCardListResult.getJSONArray("result").getJSONObject(0).getString("id");//权益ID String fetchUserCardListId=fetchUserCardListResult.getJSONArray("result").getJSONObject(0).getString("id");//memberCardId
//获取售卖详情 //获取售卖详情
JSONObject findDetailByIdResult=cardTools.memberCardFindDetailById(fetchUserCardListId); JSONObject findDetailByIdResult=cardTools.memberCardFindDetailById(fetchUserCardListId);
......
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