Commit a0ecb24b by yangfangfang

解决报错

parent b23c4f20
......@@ -29,9 +29,9 @@ public class FinanceDataTools extends XMBaseTest {
getOrderData.put("dateType",dateType);
getOrderData.put("endTime",endTime );
getOrderData.put("startTime",startTime);
getOrderData.put("brandId",xmAppApi.getLoginInfo().getBrandId());
getOrderData.put("studioId",xmAppApi.getLoginInfo().getStudioId());
getOrderData.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
getOrderData.put("brandId",dataApi.getLoginInfo().getBrandId());
getOrderData.put("studioId",dataApi.getLoginInfo().getStudioId());
getOrderData.put("operatorId",dataApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON, dataparams, getOrderData.toJSONString(), dataheadrs).assetsSuccess(true);
JSONObject response=dataApi.getBodyInJSON();
......@@ -60,9 +60,9 @@ public class FinanceDataTools extends XMBaseTest {
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());
trend.put("brandId",dataApi.getLoginInfo().getBrandId());
trend.put("studioId",dataApi.getLoginInfo().getStudioId());
trend.put("operatorId",dataApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON, dataparams, trend.toJSONString(), dataheadrs).assetsSuccess(true);
JSONObject response=dataApi.getBodyInJSON();
......@@ -91,9 +91,9 @@ public class FinanceDataTools extends XMBaseTest {
getOrderDetail.put("endTime",endTime );
getOrderDetail.put("startTime",startTime);
getOrderDetail.put("sort",sort);
getOrderDetail.put("brandId",xmAppApi.getLoginInfo().getBrandId());
getOrderDetail.put("studioId",xmAppApi.getLoginInfo().getStudioId());
getOrderDetail.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
getOrderDetail.put("brandId",dataApi.getLoginInfo().getBrandId());
getOrderDetail.put("studioId",dataApi.getLoginInfo().getStudioId());
getOrderDetail.put("operatorId",dataApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON, dataparams, getOrderDetail.toJSONString(), dataheadrs).assetsSuccess(true);
JSONObject response=dataApi.getBodyInJSON();
......@@ -124,9 +124,9 @@ public class FinanceDataTools extends XMBaseTest {
getCostData.put("endTime",endTime );
getCostData.put("startTime",startTime);
getCostData.put("type",null);
getCostData.put("brandId",xmAppApi.getLoginInfo().getBrandId());
getCostData.put("studioId",xmAppApi.getLoginInfo().getStudioId());
getCostData.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
getCostData.put("brandId",dataApi.getLoginInfo().getBrandId());
getCostData.put("studioId",dataApi.getLoginInfo().getStudioId());
getCostData.put("operatorId",dataApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON, dataparams, getCostData.toJSONString(), dataheadrs).assetsSuccess(true);
JSONObject response=dataApi.getBodyInJSON();
......@@ -156,9 +156,9 @@ public class FinanceDataTools extends XMBaseTest {
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());
getCostData.put("brandId",dataApi.getLoginInfo().getBrandId());
getCostData.put("studioId",dataApi.getLoginInfo().getStudioId());
getCostData.put("operatorId",dataApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON, dataparams, getCostData.toJSONString(), dataheadrs).assetsSuccess(true);
JSONObject response=dataApi.getBodyInJSON();
......@@ -189,9 +189,9 @@ public class FinanceDataTools extends XMBaseTest {
getCostData.put("endTime",endTime);
getCostData.put("startTime",startTime);
getCostData.put("sort",sort);
getCostData.put("brandId",xmAppApi.getLoginInfo().getBrandId());
getCostData.put("studioId",xmAppApi.getLoginInfo().getStudioId());
getCostData.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
getCostData.put("brandId",dataApi.getLoginInfo().getBrandId());
getCostData.put("studioId",dataApi.getLoginInfo().getStudioId());
getCostData.put("operatorId",dataApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON, dataparams, getCostData.toJSONString(), dataheadrs).assetsSuccess(true);
JSONObject response=dataApi.getBodyInJSON();
......
......@@ -49,7 +49,7 @@ public class TestScan extends XMBaseTest {
Assert.assertEquals(res.getString("memberId"),"1805435813468483586");
Assert.assertEquals(res.getString("entryType"),"MEMBER");
Assert.assertEquals(res.getString("entryMethod"),"CODE");
Assert.assertEquals(res.getString("entryVoucherType"),"VENUE_BOOKING");
Assert.assertEquals(res.getString("entryVoucherType"),"RESERVE");
}
}
......@@ -102,12 +102,6 @@ public class TestRefundGoods extends XMBaseTest {
JSONObject purchaseGoods = goodCTools.purchaseGoods("0.00", null, memberId, "", String.valueOf(price), id, price, 1, info);
String signOrderId1 = purchaseGoods.getJSONObject("result").getString("id");
try {
Thread.sleep(200000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//生成待支付订单后,去B端继续收款
......@@ -122,6 +116,13 @@ public class TestRefundGoods extends XMBaseTest {
//继续收款为已完成
JSONObject pay = orderTools.pay(unpaidAmount, "1", signOrderId1);
try {
Thread.sleep(200000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//校验1:获取B端订单详情:已完成状态
JSONObject getDetailResult_delinquent = orderTools.getDetail(signOrderId1);
String state_delinquent = getDetailResult_delinquent.getJSONObject("result").getString("state");
......@@ -169,11 +170,6 @@ public class TestRefundGoods extends XMBaseTest {
String refundOrderId1=refundGoods.getString("result");
try {
Thread.sleep(200000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//校验:
//校验1:获取B端订单详情:退单已完成状态
......@@ -188,9 +184,18 @@ public class TestRefundGoods extends XMBaseTest {
Assert.assertEquals(refundAfterInventory,refundBeforeInventory+1,"退货退款成功后,库存数应+1");
try {
Thread.sleep(300000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//校验3:数据中心-财务中心-营收明细-物品的确认收入应减少
JSONObject refundAfterGetCostData_type = financeDataTools.getCostData_type("DAY", "GOODS", TimeUtils.getTodayTime(), TimeUtils.getTodayEndTime());
BigDecimal refundAfterConfirmedAmount = new BigDecimal(refundAfterGetCostData_type.getJSONObject("result").getString("confirmedAmount"));//确认收入
System.out.println(refundAfterConfirmedAmount+"11111\n");
System.out.println(refundBeforeConfirmedAmount+"11111\n");
System.out.println(refundAmount+"11111\n");
Assert.assertEquals(refundAfterConfirmedAmount,refundBeforeConfirmedAmount.subtract(refundAmount.setScale(2, RoundingMode.HALF_UP)),"退货退款成功后,数据中心-财务中心-营收明细-物品的确认收入应减少对应的金额");
......@@ -201,11 +206,6 @@ public class TestRefundGoods extends XMBaseTest {
JSONObject discardRefundOrder=orderTools.discard(refundOrderId1, "重复录入", "已作废物品退货退款订单" + RandomStringUtil.randomString(10));
try {
Thread.sleep(200000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//校验:
//校验1:获取B端订单详情:退单已作废状态
......@@ -219,6 +219,11 @@ public class TestRefundGoods extends XMBaseTest {
int discardRefundAfterInventory = Integer.parseInt(discardRefundAfterGetDetail_goods.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("inventory"));
Assert.assertEquals(discardRefundAfterInventory,refundAfterInventory-1,"作废退货退款订单成功后,库存数应-1");
try {
Thread.sleep(200000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//校验3:数据中心-财务中心-营收明细-物品的确认收入应增加
JSONObject discardRefundAfterGetCostData_type = financeDataTools.getCostData_type("DAY", "GOODS", TimeUtils.getTodayTime(), TimeUtils.getTodayEndTime());
......@@ -249,12 +254,6 @@ public class TestRefundGoods extends XMBaseTest {
JSONObject refundGoods_onlyAmount = goodTools.refundGoods(xmAppApi.getLoginInfo().getAdminId(), ownerName, quantity_onlyAmount, refundAmount_onlyAmount, false, voucherItemId_onlyAmount, memberId, receivableAmount_onlyAmount, amount_onlyAmount, "1", new BigDecimal("0.00"), new BigDecimal("0.00"), "", 0, amount_onlyAmount, amount_onlyAmount);
String refundOrderId2_onlyAmount = refundGoods_onlyAmount.getString("result");
try {
Thread.sleep(200000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//校验:
//校验1:获取B端订单详情:退单已完成状态
......@@ -268,6 +267,12 @@ public class TestRefundGoods extends XMBaseTest {
int refundAfterInventory_onlyAmount = Integer.parseInt(refundAfterGetDetail_goods_onlyAmount.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("inventory"));
Assert.assertEquals(refundAfterInventory_onlyAmount, discardRefundAfterInventory, "仅退款成功后,库存数应不变");
try {
Thread.sleep(200000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//校验3:数据中心-财务中心-营收明细-物品的确认收入应减少
JSONObject refundAfterGetCostData_type_onlyAmount = financeDataTools.getCostData_type("DAY", "GOODS", TimeUtils.getTodayTime(), TimeUtils.getTodayEndTime());
......@@ -310,12 +315,6 @@ public class TestRefundGoods extends XMBaseTest {
JSONObject discardSignOrder = orderTools.discard(signOrderId1, "重复录入", "已作废物品购买订单" + RandomStringUtil.randomString(10));
try {
Thread.sleep(200000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//校验:
//校验1:获取B端订单详情:购买订单已作废状态
JSONObject getDetailResult_discardSign = orderTools.getDetail(signOrderId1);
......@@ -329,6 +328,12 @@ public class TestRefundGoods extends XMBaseTest {
Assert.assertEquals(discardSignAfterInventory, discardRefundAfterInventory_onlyAmount + 1, "作废购买订单成功后,库存数应+1");
try {
Thread.sleep(200000);
} catch (InterruptedException e) {
e.printStackTrace();
}
//校验3:数据中心-财务中心-营收明细-物品的确认收入应减少
JSONObject discardSignAfterGetCostData_type = financeDataTools.getCostData_type("DAY", "GOODS", TimeUtils.getTodayTime(), TimeUtils.getTodayEndTime());
BigDecimal discardSignAfterConfirmedAmount = new BigDecimal(discardSignAfterGetCostData_type.getJSONObject("result").getString("confirmedAmount"));//确认收入
......
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