Commit 5e953052 by yangfangfang

物品

parent 85c30bb6
......@@ -89,7 +89,7 @@ public class GoodCTools extends XMBaseTest {
* @author: yff
**/
public JSONObject checkAllowPurchase(String goodsSpecId, String memberId, String price,int quantity, DataUserInfo...userInfos){
public JSONObject checkAllowPurchase(String goodsSpecId, String memberId, BigDecimal price,int quantity, DataUserInfo...userInfos){
dataApi.setApiModule(ApiModule.Lunar_Goods)
.setApiName("API_checkAllowPurchase")
.setTerminal(Terminal.minApp);
......@@ -116,7 +116,7 @@ public class GoodCTools extends XMBaseTest {
* @author: yff
**/
public JSONObject purchaseGoods(String depositAmount, String depositCardId, String memberId,String memo, String receivableAmount,String id, String price, int quantity, DataUserInfo...userInfos){
public JSONObject purchaseGoods(String depositAmount, String depositCardId, String memberId,String memo, String receivableAmount,String id, BigDecimal price, int quantity, DataUserInfo...userInfos){
dataApi.setApiModule(ApiModule.Lunar_Goods)
.setApiName("API_purchaseGoods")
.setTerminal(Terminal.minApp);
......
......@@ -87,7 +87,7 @@ public class TestListXcxGoodsGroup extends BaseTestImpl {
JSONArray result1=listXcxGoodsGroup1.getJSONArray("result");
boolean success1=false;
for(int i=0; i < result1.size(); i++){
for(int i=0;i < result1.size();i++){
if(result1.getJSONObject(1).getString("id").equals(id)){
success1=true;
}
......
......@@ -83,7 +83,7 @@ public class TestPurchaseGoods extends BaseTestImpl {
//获取C端商品详情
JSONObject getDetail_goods_C=goodCTools.getDetail_goods_C(goodsId1);
String id=getDetail_goods_C.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("id");
String price=getDetail_goods_C.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("price");
BigDecimal price=new BigDecimal(getDetail_goods_C.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("price"));
int beforeInventory=Integer.parseInt(getDetail_goods_C.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("inventory"));
try {
......@@ -210,7 +210,7 @@ public class TestPurchaseGoods extends BaseTestImpl {
JSONObject beforeGetCostData_type=financeDataTools.getCostData_type("DAY","GOODS", TimeUtils.getTodayTime(),TimeUtils.getTodayEndTime(),info);
BigDecimal beforeConfirmedAmount=new BigDecimal(beforeGetCostData_type.getJSONObject("result").getString("confirmedAmount"));//确认收入
boolean checkAllowPurchase=Boolean.parseBoolean(goodCTools.checkAllowPurchase(id,memberId,"0.00",beforeInventory).getJSONObject("result").getString("success"));
boolean checkAllowPurchase=Boolean.parseBoolean(goodCTools.checkAllowPurchase(id,memberId,price,beforeInventory).getJSONObject("result").getString("success"));
//校验一下物品购买是否可以通过,为true才可以
if(checkAllowPurchase==true){
......@@ -308,7 +308,7 @@ public class TestPurchaseGoods extends BaseTestImpl {
JSONObject beforeGetCostData_type=financeDataTools.getCostData_type("DAY","GOODS", TimeUtils.getTodayTime(),TimeUtils.getTodayEndTime(),info);
BigDecimal beforeConfirmedAmount=new BigDecimal(beforeGetCostData_type.getJSONObject("result").getString("confirmedAmount"));//确认收入
boolean checkAllowPurchase=Boolean.parseBoolean(goodCTools.checkAllowPurchase(id,memberId,"0.00",beforeInventory).getJSONObject("result").getString("success"));
boolean checkAllowPurchase=Boolean.parseBoolean(goodCTools.checkAllowPurchase(id,memberId,price,beforeInventory).getJSONObject("result").getString("success"));
//校验一下物品购买是否可以通过,为true才可以
if(checkAllowPurchase==true){
......
......@@ -82,7 +82,7 @@ public class TestGoodsOrder extends XMBaseTest {
//获取B端商品详情
JSONObject getDetail_goods=goodTools.getDetail_goods(goodsId1);
String id=getDetail_goods.getJSONObject("result").getString("id");
String price=getDetail_goods.getJSONObject("result").getJSONObject("singleSpecInfo").getString("price");
BigDecimal price=new BigDecimal(getDetail_goods.getJSONObject("result").getJSONObject("singleSpecInfo").getString("price"));
int beforeInventory=Integer.parseInt(getDetail_goods.getJSONObject("result").getJSONObject("singleSpecInfo").getString("inventory"));
try {
......@@ -100,7 +100,7 @@ public class TestGoodsOrder extends XMBaseTest {
//校验一下物品购买是否可以通过,为true才可以
if(checkAllowPurchase==true) {
JSONObject purchaseGoods = goodCTools.purchaseGoods("0.00", null,memberId,"",price,id,price,1,info);
JSONObject purchaseGoods = goodCTools.purchaseGoods("0.00", null,memberId,"",price.toString(),id,price,1,info);
String orderId1=purchaseGoods.getJSONObject("result").getString("id");
//生成待支付订单后,去B端继续收款
......@@ -189,7 +189,7 @@ public class TestGoodsOrder extends XMBaseTest {
//获取B端商品详情
JSONObject getDetail_goods=goodTools.getDetail_goods(goodsId1);
String id=getDetail_goods.getJSONObject("result").getString("id");
String price=getDetail_goods.getJSONObject("result").getJSONObject("singleSpecInfo").getString("price");
BigDecimal price=new BigDecimal(getDetail_goods.getJSONObject("result").getJSONObject("singleSpecInfo").getString("price"));
int beforeInventory=Integer.parseInt(getDetail_goods.getJSONObject("result").getJSONObject("singleSpecInfo").getString("inventory"));
try {
......@@ -207,7 +207,7 @@ public class TestGoodsOrder extends XMBaseTest {
//校验一下物品购买是否可以通过,为true才可以
if(checkAllowPurchase==true) {
JSONObject purchaseGoods = goodCTools.purchaseGoods("0.00", null,memberId,"",price,id,price,1,info);
JSONObject purchaseGoods = goodCTools.purchaseGoods("0.00", null,memberId,"",price.toString(),id,price,1,info);
String orderId2=purchaseGoods.getJSONObject("result").getString("id");
//生成待支付订单后,去B端继续收款
......
......@@ -103,7 +103,7 @@ public class TestGoodsOrderByDeposit extends XMBaseTest {
//获取B端商品详情
JSONObject getDetail_goods=goodTools.getDetail_goods(goodsId1);
String id=getDetail_goods.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("id");
String price=getDetail_goods.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("price");
BigDecimal price=new BigDecimal(getDetail_goods.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("price"));
int beforeInventory=Integer.parseInt(getDetail_goods.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("inventory"));
try {
......
......@@ -84,7 +84,7 @@ public class TestRefundGoods extends XMBaseTest {
//获取B端商品详情
JSONObject getDetail_goods=goodTools.getDetail_goods(goodsId1);
String id=getDetail_goods.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("id");
String price=getDetail_goods.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("price");
BigDecimal price=new BigDecimal(getDetail_goods.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("price"));
int beforeInventory=Integer.parseInt(getDetail_goods.getJSONObject("result").getJSONObject("multiSpecInfo").getJSONArray("specCombinationList").getJSONObject(0).getString("inventory"));
try {
......@@ -102,7 +102,7 @@ public class TestRefundGoods extends XMBaseTest {
//校验一下物品购买是否可以通过,为true才可以
if(checkAllowPurchase==true) {
JSONObject purchaseGoods = goodCTools.purchaseGoods("0.00", null, memberId, "", price, id, price, 1, info);
JSONObject purchaseGoods = goodCTools.purchaseGoods("0.00", null, memberId, "", price.toString(), id, price, 1, info);
String signOrderId1 = purchaseGoods.getJSONObject("result").getString("id");
//生成待支付订单后,去B端继续收款
......
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