Commit 860f95ff by yangfangfang

物品

parent bdfa0c6a
......@@ -2,7 +2,6 @@ package com.xiaomai.cases.polar.goods;
import com.alibaba.fastjson.JSONObject;
import com.xiaomai.cases.lunar.goods.GoodCTools;
import com.xiaomai.cases.lunar.order.OrderCTools;
import com.xiaomai.cases.lunar.user.UserTools;
import com.xiaomai.cases.polar.data.financeData.FinanceDataTools;
import com.xiaomai.cases.polar.finance.order.OrderTools;
......@@ -60,12 +59,6 @@ public class TestGoodsOrder extends XMBaseTest {
// "name": "自动化禁用-购买订单单规格1元",
// "id": "1874413587237335042",
// "name": "自动化禁用-购买订单多规格1元",
// "id": "1874413193018896386",
// "name": "自动化禁用-购买订单多规格0元",
// "id": "1874411064376061954",
// "name": "自动化禁用-购买订单单规格0元",
//case1:购买多规格非0元物品生成待支付订单
//case1:购买非0订单->待支付->取消订单
......
......@@ -7,8 +7,11 @@ import com.xiaomai.enums.ApiModule;
import com.xiaomai.enums.RequestType;
import com.xiaomai.enums.Terminal;
import com.xiaomai.utils.RandomStringUtil;
import com.xiaomai.utils.TimeUtils;
import com.xiaomai.utils.XMBaseTest;
import java.math.BigDecimal;
public class GoodTools extends XMBaseTest {
//
// /**
......@@ -896,7 +899,7 @@ public class GoodTools extends XMBaseTest {
/**
* @param
* @description:
* @description:查看物品的编辑记录
* @param goodsId:物品ID
* @author: yff
**/
......@@ -920,5 +923,113 @@ public class GoodTools extends XMBaseTest {
return dataApi.getBodyInJSON();
}
/**
* @param
* @description:B端退单时拉取可退物品
* @param receiverId:会员ID
* @author: yff
**/
public JSONObject listLeftGoodsItem(String receiverId,DataUserInfo...userInfos){
dataApi.setApiModule(ApiModule.Polar_Goods)
.setApiName("API_listLeftGoodsItem")
.setTerminal(Terminal.B);
super.beforeDataRequest(userInfos);
JSONObject jsonObject = new JSONObject();
jsonObject.put("receiverId",receiverId);
jsonObject.put("content","");
jsonObject.put("brandId", dataApi.getLoginInfo().getBrandId());
jsonObject.put("studioId", dataApi.getLoginInfo().getStudioId());
jsonObject.put("operatorId",dataApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON,dataparams,jsonObject.toString(),dataheadrs).assetsSuccess(true);
return dataApi.getBodyInJSON();
}
/**
* @param
* @description:B端退单时获取订单可退物品(退单界面)
* @param id: 是listLeftGoodsItem拉取可退的物品列表接口中:"result":{ [{"id": "1874695209647783938",}]}
* @author: yff
**/
public JSONObject getLeftGoodsItem(String id,DataUserInfo...userInfos){
dataApi.setApiModule(ApiModule.Polar_Goods)
.setApiName("API_getLeftGoodsItem")
.setTerminal(Terminal.B);
super.beforeDataRequest(userInfos);
JSONObject jsonObject = new JSONObject();
jsonObject.put("id",id);
jsonObject.put("brandId", dataApi.getLoginInfo().getBrandId());
jsonObject.put("studioId", dataApi.getLoginInfo().getStudioId());
jsonObject.put("operatorId",dataApi.getLoginInfo().getAdminId());
dataApi.doRequest(RequestType.JSON,dataparams,jsonObject.toString(),dataheadrs).assetsSuccess(true);
return dataApi.getBodyInJSON();
}
/**
* @param
* @description:B端退单物品
* @param quantity:退出数量
* @param refundAmount:退出金额
* @param refundInventory:退货退款:true 仅退款:false
* @param voucherItemId:是listLeftGoodsItem拉取可退的物品列表接口中:"result":{ [{"id": "1874695209647783938",}]}
* @param memberId:会员ID
* @param receivableAmount:应退金额
* @param amount:支付金额
* @param paymentWay:支付方式 1 2 ...
* @param
* @author: yff
**/
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){
dataApi.setApiModule(ApiModule.Polar_Goods)
.setApiName("API_refundGoods")
.setTerminal(Terminal.B);
super.beforeDataRequest(userInfos);
JSONObject refundGoods=new JSONObject();
refundGoods.put("operationTime", TimeUtils.getTodayTime());
JSONObject goods=new JSONObject();
goods.put("quantity",quantity);
goods.put("refundAmount",refundAmount);
goods.put("refundInventory",refundInventory);
goods.put("voucherItemId",voucherItemId);
refundGoods.put("goods",goods);
refundGoods.put("objectId", RandomStringUtil.randomString(32));
refundGoods.put("studioId",xmAppApi.getLoginInfo().getStudioId());
refundGoods.put("memberId",memberId);
refundGoods.put("receivableAmount",receivableAmount);
refundGoods.put("operatorId",xmAppApi.getLoginInfo().getAdminId());
JSONArray paymentWays=new JSONArray();
JSONObject object=new JSONObject();
object.put("amount",amount);
object.put("paymentWay",paymentWay);
JSONArray voucherResourceIds=new JSONArray();
object.put("voucherResourceIds",voucherResourceIds);
paymentWays.add(object);
refundGoods.put("paymentWays",paymentWays);
refundGoods.put("brandId",xmAppApi.getLoginInfo().getBrandId());
refundGoods.put("depositRechargeAmount",depositRechargeAmount);
refundGoods.put("depositGiveAmount",depositGiveAmount);
refundGoods.put("depositCardId",depositCardId);
dataApi.doRequest(RequestType.JSON,dataparams,refundGoods.toString(),dataheadrs).assetsSuccess(true);
return dataApi.getBodyInJSON();
}
}
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