Commit b14364ba by yangfangfang

解决报错

parent c169a880
......@@ -157,7 +157,7 @@ public class TestManual extends XMBaseTest {
Float entryPrice1 = Float.valueOf(XMJSONPath.readPath(res1, "$.result.venueBenefit.leftBenefitAmount"));
//操作退卡
orderTools.refundOrder1(2, 1,entryVoucherId, quantity, entryQuantity1,price, entryPrice1,"EXPERIENCE_CARD", memberId, "1");
orderTools.refundOrder1(2, 1,entryVoucherId, quantity, entryQuantity1,price, entryPrice1,"EXPERIENCE_CARD", memberId, "1",0,new BigDecimal(price+entryPrice1),new BigDecimal(price+entryPrice1));
}
}
......@@ -109,7 +109,7 @@ public class TestActiveExperienceCard extends XMBaseTest {
Assert.assertTrue(XMJSONPath.readPath(dataApi.getApi_response(), "$.result.records[0].consumeType").equals("PURCHASE"), "会员购卡后生成消耗记录不是购买");
//操作退卡
orderTools.refundOrder1(2, 1,memberAccountCardId, quantity, entryQuantity,price, entryPrice,"EXPERIENCE_CARD", "1805435813468483586", "1");
orderTools.refundOrder1(2, 1,memberAccountCardId, quantity, entryQuantity,price, entryPrice,"EXPERIENCE_CARD", "1805435813468483586", "1",0,new BigDecimal(price+entryPrice),new BigDecimal(price+entryPrice));
String refundOrderId = XMJSONPath.readPath(dataApi.getApi_response(), "$.result");
......
......@@ -36,7 +36,7 @@ public class TestOfflinePay extends XMBaseTest {
public void beforeTest(){
xmAppApi.setApiModule(ApiModule.Polar_Finance)
.setApiName("API_offlinePay")
.setLoginUser(LoginAccount.YFF_PROD)
.setLoginUser(LoginAccount.GYM_PROD)
.setTerminal(Terminal.B);
dal.setCase_owner("yff")
.setCase_name(Thread.currentThread().getStackTrace()[1].getFileName().split("\\.")[0]);
......
......@@ -769,13 +769,14 @@ public class OrderTools extends XMBaseTest {
JSONObject jsonObject=new JSONObject();
jsonObject.put("operationTime",TimeUtils.getCurrentTime());
JSONArray businessOwners=new JSONArray();
JSONObject businessOwners1=new JSONObject();
businessOwners1.put("ownerId",dataApi.getLoginInfo().getAdminId());
businessOwners1.put("ownerName","");
businessOwners1.put("percent",100);
businessOwners.add(businessOwners1);
jsonObject.put("businessOwners",businessOwners);
// JSONArray businessOwners=new JSONArray();
// JSONObject businessOwners1=new JSONObject();
// businessOwners1.put("ownerId",dataApi.getLoginInfo().getAdminId());
// businessOwners1.put("ownerName","");
// businessOwners1.put("percent",100);
// businessOwners.add(businessOwners1);
// jsonObject.put("businessOwners",businessOwners);
JSONObject card=new JSONObject();
card.put("giftQuantity",giftQuantity);
......@@ -820,7 +821,7 @@ public class OrderTools extends XMBaseTest {
//双权益退卡
public JSONObject refundOrder1(int giftQuantity,int entryGiftQuantity, String memberCardId,BigDecimal quantity,BigDecimal entryQuantity,float refundAmount,float entryRefundAmount,String commodityCardType,String memberId,
String paymentWay,DataUserInfo...dataUserInfos){
String paymentWay,int fee,BigDecimal refundableAmount,BigDecimal refundAmount_actual,DataUserInfo...dataUserInfos){
dataApi.setApiModule(ApiModule.Polar_Finance)
.setApiName("API_refundOrder")
......@@ -862,6 +863,9 @@ public class OrderTools extends XMBaseTest {
jsonObject.put("paymentWays",paymentWays);
jsonObject.put("brandId",dataApi.getLoginInfo().getBrandId());
jsonObject.put("fee",fee);
jsonObject.put("refundableAmount",refundableAmount);
jsonObject.put("refundAmount",refundAmount_actual);
dataApi.doRequest(RequestType.JSON, dataparams, jsonObject.toJSONString(), dataheadrs).assetsSuccess(true);
......
......@@ -17,6 +17,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.UUID;
public class TestRefundOrderByDeposit extends XMBaseTest {
......@@ -99,6 +100,9 @@ public class TestRefundOrderByDeposit extends XMBaseTest {
jsonObject.put("depositGiveAmount",price);
jsonObject.put("depositCardId",depositCardId);
jsonObject.put("brandId",xmAppApi.getLoginInfo().getBrandId());
jsonObject.put("fee",0);
jsonObject.put("refundableAmount",price);
jsonObject.put("refundAmount",price);
//调用请求
xmAppApi.doRequest(RequestType.JSON,params,jsonObject.toJSONString(),headers).assetsSuccess(true);
......
......@@ -185,7 +185,7 @@ public class TestGoodsOrderByDeposit extends XMBaseTest {
//退货退款物品
JSONObject refundGoods=goodTools.refundGoods(quantity,refundAmount,true,voucherItemId,memberId,receivableAmount,amount,"1",cardPrice,cardBalance,cardId1);
JSONObject refundGoods=goodTools.refundGoods(quantity,refundAmount,true,voucherItemId,memberId,receivableAmount,amount,"1",cardPrice,cardBalance,cardId1,0,amount,amount);
String refundOrderId1=refundGoods.getString("result");
......
......@@ -156,7 +156,7 @@ public class TestRefundGoods extends XMBaseTest {
//退货退款物品
JSONObject refundGoods=goodTools.refundGoods(quantity,refundAmount,true,voucherItemId,memberId,receivableAmount,amount,"1",new BigDecimal("0.00"),new BigDecimal("0.00"),"");
JSONObject refundGoods=goodTools.refundGoods(quantity,refundAmount,true,voucherItemId,memberId,receivableAmount,amount,"1",new BigDecimal("0.00"),new BigDecimal("0.00"),"",0,amount,amount);
String refundOrderId1=refundGoods.getString("result");
......@@ -232,7 +232,7 @@ public class TestRefundGoods extends XMBaseTest {
//仅退款物品
JSONObject refundGoods_onlyAmount=goodTools.refundGoods(quantity_onlyAmount,refundAmount_onlyAmount,false,voucherItemId_onlyAmount,memberId,receivableAmount_onlyAmount,amount_onlyAmount,"1",new BigDecimal("0.00"),new BigDecimal("0.00"),"");
JSONObject refundGoods_onlyAmount=goodTools.refundGoods(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");
......
......@@ -992,7 +992,8 @@ public class GoodTools extends XMBaseTest {
**/
public JSONObject refundGoods(int quantity, BigDecimal refundAmount,boolean refundInventory,String voucherItemId,String memberId,BigDecimal receivableAmount,
BigDecimal amount,String paymentWay,BigDecimal depositRechargeAmount,BigDecimal depositGiveAmount,String depositCardId,DataUserInfo...userInfos){
BigDecimal amount,String paymentWay,BigDecimal depositRechargeAmount,BigDecimal depositGiveAmount,String depositCardId,
int fee,BigDecimal refundableAmount,BigDecimal refundAmount_actual,DataUserInfo...userInfos){
dataApi.setApiModule(ApiModule.Polar_Goods)
.setApiName("API_refundGoods")
.setTerminal(Terminal.B);
......@@ -1026,6 +1027,9 @@ public class GoodTools extends XMBaseTest {
refundGoods.put("depositRechargeAmount",depositRechargeAmount);
refundGoods.put("depositGiveAmount",depositGiveAmount);
refundGoods.put("depositCardId",depositCardId);
refundGoods.put("fee",fee);
refundGoods.put("refundableAmount",refundableAmount);
refundGoods.put("refundAmount",refundAmount_actual);
dataApi.doRequest(RequestType.JSON,dataparams,refundGoods.toString(),dataheadrs).assetsSuccess(true);
......
......@@ -12,6 +12,7 @@ import com.xiaomai.utils.XMBaseTest;
import com.xiaomai.utils.XMJSONPath;
import org.springframework.stereotype.Component;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
......@@ -891,7 +892,7 @@ public class CardTools extends XMBaseTest {
}
//储值卡操作退卡
public JSONObject refundOrderDeposit(String memberCardId,String giftAmount,String rechargeAmount,String refundAmount,String memberId,String receivableAmount,List paymentWays,DataUserInfo...userInfos){
public JSONObject refundOrderDeposit(String memberCardId, String giftAmount, String rechargeAmount, String refundAmount, String memberId, String receivableAmount, List paymentWays, int fee, BigDecimal refundableAmount, BigDecimal refundAmount_actual, DataUserInfo...userInfos){
dataApi.setApiModule(ApiModule.Polar_Finance)
.setApiName("API_refundOrderDeposit")
.setTerminal(Terminal.B);
......@@ -914,6 +915,9 @@ public class CardTools extends XMBaseTest {
jsonObject.put("operatorId",dataApi.getLoginInfo().getAdminId());
jsonObject.put("paymentWays",paymentWays);
jsonObject.put("brandId",dataApi.getLoginInfo().getBrandId());
jsonObject.put("fee",fee);
jsonObject.put("refundableAmount",refundableAmount);
jsonObject.put("refundAmount",refundAmount_actual);
dataApi.doRequest(RequestType.JSON, dataparams, jsonObject.toJSONString(), dataheadrs).assetsSuccess(true);
return dataApi.getBodyInJSON();
......
......@@ -18,6 +18,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.Set;
/**
......@@ -120,7 +121,7 @@ public class TestGetCampScheduleItemDetail extends SelectTargetTrainingCampAndGe
Assert.assertTrue(XMJSONPath.getJSONArrayByReadPath(xmAppApi.getApi_response(), "$.result.venueAreaIds").isEmpty(), "创建排课时场地设置为空,但是课次详情中显示不为空哦");
//会员退款订单check
trainingTools.refundCampOrder(memberId, this.price, memberCardId, this.totalClassHour);
trainingTools.refundCampOrder(memberId, this.price, memberCardId, this.totalClassHour,0,new BigDecimal(this.price),new BigDecimal(this.price));
Thread.sleep(2000);
//退单后再次check课次详情
campScheduleTools.getCampScheduleItemDetail(scheduleId);
......
......@@ -23,6 +23,7 @@ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -200,7 +201,7 @@ public class TestSignAreaTimesOrder extends XMBaseTest {
//作废优惠券
couponTools.abandonMembercouponReceiveRecord(userCouponId);
//退优惠券
cardTools.refundOrderDeposit(depositCardId,"1000","0","0",memberId,"0",new JSONArray());
cardTools.refundOrderDeposit(depositCardId,"1000","0","0",memberId,"0",new JSONArray(),0,new BigDecimal(0),new BigDecimal(0));
}
}
......@@ -18,6 +18,7 @@ import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
......@@ -72,7 +73,7 @@ public class TestDoSignCampOrder extends SelectTargetTrainingCampAndGetInfo {
//报名详情-训练营报名退款
trainingTools.refundCampOrder(memberId, this.price, memberCardId, this.totalClassHour);
trainingTools.refundCampOrder(memberId, this.price, memberCardId, this.totalClassHour,0,new BigDecimal(this.price),new BigDecimal(this.price));
Thread.sleep(1000);
......@@ -116,6 +117,9 @@ public class TestDoSignCampOrder extends SelectTargetTrainingCampAndGetInfo {
payObject.put("paymentWay", "1");
payObject.put("voucherResourceIds", new JSONArray());
body.put("paymentWays", paymentWays);
body.put("fee",0);
body.put("refundableAmount",this.price);
body.put("refundAmount",this.price);
xmAppApi.doRequest(RequestType.JSON, params, body.toString(), headers).assetsSuccess(false);
Assert.assertEquals(XMJSONPath.readPath(xmAppApi.getApi_response(), "$.message"), "签单失败,已报名该训练营无需重复操作");
}
......
......@@ -11,6 +11,7 @@ import org.springframework.stereotype.Component;
import org.testng.Assert;
import org.testng.Reporter;
import java.math.BigDecimal;
import java.util.List;
import java.util.UUID;
......@@ -396,7 +397,7 @@ public class TrainingTools extends XMBaseTest {
* @param memberCampId 会员的训练营账户ID
* @param quantity 退出购买数量
*/
public void refundCampOrder(String memberId, Double refundAmount, String memberCampId, int quantity) {
public void refundCampOrder(String memberId, Double refundAmount, String memberCampId, int quantity, int fee, BigDecimal refundableAmount,BigDecimal refundAmount_actual) {
setUP("API_refundCampOrder");
JSONObject body = new JSONObject();
body.put("operatorId", dataApi.getLoginInfo().getAdminId());
......@@ -422,6 +423,10 @@ public class TrainingTools extends XMBaseTest {
payObject.put("voucherResourceIds", new JSONArray());
paymentWays.add(payObject);
body.put("paymentWays", paymentWays);
body.put("fee",fee);
body.put("refundableAmount",refundableAmount);
body.put("refundAmount",refundAmount_actual);
dataApi.doRequest(RequestType.JSON, dataparams, body.toString(), dataheadrs);
Assert.assertTrue(Boolean.valueOf(XMJSONPath.readPath(dataApi.getApi_response(), "$.success")) == true, "调用接口返回结果:" + XMJSONPath.readPath(dataApi.getApi_response(), "$.message"));
......
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