package com.tmerclub.cloud.systemtest.test.order;

import com.tmerclub.cloud.common.product.vo.app.CategoryAppVO;
import com.tmerclub.cloud.order.dto.OrderStationDTO;
import com.moyuer.cloud.systemtest.api.amount.CategoryApi;
import com.moyuer.cloud.systemtest.api.amount.PayApi;
import com.moyuer.cloud.systemtest.api.amount.ProductApi;
import com.moyuer.cloud.systemtest.api.login.UserApi;
import com.moyuer.cloud.systemtest.api.order.*;
import com.moyuer.cloud.systemtest.api.store.ShopWalletApi;
import com.moyuer.cloud.systemtest.data.amount.SpuData;
import com.moyuer.cloud.systemtest.data.order.*;
import com.moyuer.cloud.systemtest.data.platform.CategoryDtoData;
import org.testng.Assert;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import java.util.Collections;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
import java.util.stream.Stream;

/**
 * @author lpj
 */
public class VirtualOrderTest {
    private List<Long> getCategoryId() {
        List<CategoryAppVO> categoryAppVOList = CategoryApi.listShopCategory(true);
        Long shopCategoryId = categoryAppVOList.get(categoryAppVOList.size() - 1).getCategoryId();
        Long categoryId = CategoryApi.listSigningCategory(true).get(0).getCategoryId();
        CategoryApi.update(CategoryDtoData.getCategoryDTO(categoryId));
        return Stream.of(categoryId, shopCategoryId).collect(Collectors.toList());
    }

    @DataProvider(name = "noWriteNumVirtualProduct")
    public Object[][] noWriteNumVirtualProduct(){
        List<Long> categoryIds = getCategoryId();
        Long productId = ProductApi.createProduct(SpuData.getUnRealSpu(categoryIds.get(0), categoryIds.get(1), 100L, 0), true);
        return new Object[][]{{productId}};
    }

    @DataProvider(name = "singleWriteNumVirtualProduct")
    public Object[][] singleWriteNumVirtualProduct(){
        List<Long> categoryIds = getCategoryId();
        Long productId = ProductApi.createProduct(SpuData.getUnRealSpu(categoryIds.get(0), categoryIds.get(1), 100L, 1), true);
        return new Object[][]{{productId}};
    }
    @DataProvider(name = "tripleWriteNumVirtualProduct")
    public Object[][] tripleWriteNumVirtualProduct(){
        List<Long> categoryIds = getCategoryId();
        Long productId = ProductApi.createProduct(SpuData.getUnRealSpu(categoryIds.get(0), categoryIds.get(1), 100L, -1), true);
        return new Object[][]{{productId}};
    }

    @Test(description = "JK_43,虚拟订单取消删除", dataProvider = "noWriteNumVirtualProduct")
    public void noWriteNumVirtualProductTestCase(Long productId) {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        MyOrderApi.cancel(orderNum);
        ProductApi.delete(productId, true);
        MyOrderApi.delete(orderNum);
    }

    @Test(description = "JK_44,无需核销虚拟订单完整流程", dataProvider = "noWriteNumVirtualProduct")
    public void noWriteNumVirtualOrderTestCase(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);
        TimeUnit.SECONDS.sleep(1L);
        MyOrderApi.receipt(orderNum);
        CommentApi.addComment(SpuCommDtoData.getSpuCommDtoData(OrderApi.getOrderItemAndAddress(orderNum).getOrderItems().get(0).getOrderItemId()));
        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 1);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getActualTotal(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "JK_45，虚拟商品订单，单次核销订单完整流程" ,dataProvider = "singleWriteNumVirtualProduct")
    public void singleWriteNumVirtualProductTestCase(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);
        TimeUnit.SECONDS.sleep(1L);
        String writeOffCode = MyOrderApi.orderDetail(orderNum).getVirtualInfoList().get(0).getWriteOffCode();
        StationApi.orderWriteOffByOrderNumber(OrderVirtualInfoDtoData.getOrderVirtualInfoDTO(orderNum, writeOffCode));
        CommentApi.addComment(SpuCommDtoData.getSpuCommDtoData(OrderApi.getOrderItemAndAddress(orderNum).getOrderItems().get(0).getOrderItemId()));
        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 1);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getActualTotal(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "JK_46，三次核销虚拟订单完整流程" ,dataProvider = "tripleWriteNumVirtualProduct")
    public void tripleWriteNumVirtualTestCase(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);
        TimeUnit.SECONDS.sleep(1L);
        String writeOffCode = MyOrderApi.orderDetail(orderNum).getVirtualInfoList().get(0).getWriteOffCode();
        for (int i=0; i<MyOrderApi.orderDetail(orderNum).getWriteOffMultipleCount(); i++){
            StationApi.orderWriteOffByOrderNumber(OrderVirtualInfoDtoData.getOrderVirtualInfoDTO(orderNum, writeOffCode));
        }
        CommentApi.addComment(SpuCommDtoData.getSpuCommDtoData(OrderApi.getOrderItemAndAddress(orderNum).getOrderItems().get(0).getOrderItemId()));
        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 1);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getActualTotal(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "JK_47,无需核销虚拟订单退款完整流程", dataProvider = "noWriteNumVirtualProduct")
    public void noWriteNumVirtualOrderRefundTestCase(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);

        //申请第一次退款，部分退款，拒绝退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdFirst= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdFirst);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getRufuseOrderRefundDTO(refundIdFirst));

        //申请第二次退款，部分退款，同意退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdSec= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdSec);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getReceiveDeliveryRefundDTO(refundIdSec));

        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        TimeUnit.SECONDS.sleep(2L);
        Assert.assertEquals(ShopOrderRefundApi.getEsOrderRefundVO(orderNum).size(), 2);
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 2);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, refundIdSec, true).getOrderItemDetailList().get(0).getRefundAmount(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "JK_48,虚拟商品订单，单次核销订单退款完整流程", dataProvider = "singleWriteNumVirtualProduct")
    public void singleWriteNumVirtualOrderRefundTestCase(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);

        //申请第一次退款，部分退款，拒绝退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdFirst= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdFirst);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getRufuseOrderRefundDTO(refundIdFirst));

        //申请第二次退款，部分退款，同意退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdSec= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdSec);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getReceiveDeliveryRefundDTO(refundIdSec));

        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        TimeUnit.SECONDS.sleep(2L);
        Assert.assertEquals(ShopOrderRefundApi.getEsOrderRefundVO(orderNum).size(), 2);
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 2);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, refundIdSec, true).getOrderItemDetailList().get(0).getRefundAmount(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "JK_49,虚拟商品订单，三次核销订单退款完整流程", dataProvider = "tripleWriteNumVirtualProduct")
    public void tripleWriteNumVirtualOrderRefundTestCase(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);

        //申请第一次退款，部分退款，拒绝退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdFirst= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdFirst);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getRufuseOrderRefundDTO(refundIdFirst));

        //申请第二次退款，部分退款，同意退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdSec= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdSec);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getReceiveDeliveryRefundDTO(refundIdSec));

        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        TimeUnit.SECONDS.sleep(2L);
        Assert.assertEquals(ShopOrderRefundApi.getEsOrderRefundVO(orderNum).size(), 2);
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 2);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, refundIdSec, true).getOrderItemDetailList().get(0).getRefundAmount(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "JK_49,虚拟商品订单，三次核销订单，核销一次后退款完整流程", dataProvider = "tripleWriteNumVirtualProduct")
    public void tripleWriteNumVirtualOrderWriteOffOnceRefundTestCase(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);

        //可核销三次的虚拟订单，核销一次
        TimeUnit.SECONDS.sleep(1L);
        String writeOffCode = MyOrderApi.orderDetail(orderNum).getVirtualInfoList().get(0).getWriteOffCode();
        StationApi.orderWriteOffByOrderNumber(OrderVirtualInfoDtoData.getOrderVirtualInfoDTO(orderNum, writeOffCode));

        //申请第一次退款，部分退款，拒绝退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdFirst= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdFirst);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getRufuseOrderRefundDTO(refundIdFirst));

        //申请第二次退款，部分退款，同意退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdSec= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdSec);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getReceiveDeliveryRefundDTO(refundIdSec));

        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        TimeUnit.SECONDS.sleep(2L);
        Assert.assertEquals(ShopOrderRefundApi.getEsOrderRefundVO(orderNum).size(), 2);
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 2);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, refundIdSec, true).getOrderItemDetailList().get(0).getRefundAmount(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "51,虚拟商品订单，两件三次核销订单，核销其中一个后退款完整流程", dataProvider = "tripleWriteNumVirtualProduct")
    public void tripleWriteNumVirtualOrderWriteOffTwiceRefundTestCase(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 2));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);

        //可核销三次的虚拟订单，核销其中一个核销码
        TimeUnit.SECONDS.sleep(1L);
        String writeOffCode = MyOrderApi.orderDetail(orderNum).getVirtualInfoList().get(0).getWriteOffCode();
        for (int i=0; i<MyOrderApi.orderDetail(orderNum).getWriteOffMultipleCount(); i++) {
            StationApi.orderWriteOffByOrderNumber(OrderVirtualInfoDtoData.getOrderVirtualInfoDTO(orderNum, writeOffCode));
        }

        //申请第一次退款，部分退款，拒绝退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdFirst= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdFirst);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getRufuseOrderRefundDTO(refundIdFirst));

        //申请第二次退款，部分退款，同意退款
        TimeUnit.SECONDS.sleep(2L);
        Long refundIdSec= OrderRefundApi.apply(OrderRefundDtoData.getOrderRefundDTO(orderNum,0L));
        ShopOrderRefundApi.infoByRefundSn(refundIdSec);
        ShopOrderRefundApi.processRefundOrder(ShopOrderRefundDtoData.getReceiveDeliveryRefundDTO(refundIdSec));

        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        TimeUnit.SECONDS.sleep(2L);
        Assert.assertEquals(ShopOrderRefundApi.getEsOrderRefundVO(orderNum).size(), 2);
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 3);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, refundIdSec, true).getOrderItemDetailList().get(0).getActualTotal(), 200);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, refundIdSec, true).getOrderItemDetailList().get(0).getRefundAmount(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 4);
    }

    @Test(description = "JK_52,商家端核销虚拟订单", dataProvider = "singleWriteNumVirtualProduct")
    public static void writeOffVirtualOrder(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);
        TimeUnit.SECONDS.sleep(1L);
        OrderApi.orderWriteOffByOrderId(OrderVirtualInfoDtoData.getOrderVirtualInfoDTO(orderNum, null));
        CommentApi.addComment(SpuCommDtoData.getSpuCommDtoData(OrderApi.getOrderItemAndAddress(orderNum).getOrderItems().get(0).getOrderItemId()));
        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 1);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getActualTotal(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "JK_53,商家端通过核销码核销虚拟订单", dataProvider = "singleWriteNumVirtualProduct")
    public static void writeOffVirtualOrderByWriteOffCode(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);
        TimeUnit.SECONDS.sleep(1L);
        String writeOffCode = MyOrderApi.orderDetail(orderNum).getVirtualInfoList().get(0).getWriteOffCode();
        OrderApi.orderWriteOffByOrderId(OrderVirtualInfoDtoData.getOrderVirtualInfoDTO(orderNum, writeOffCode));
        CommentApi.addComment(SpuCommDtoData.getSpuCommDtoData(OrderApi.getOrderItemAndAddress(orderNum).getOrderItems().get(0).getOrderItemId()));
        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 1);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getActualTotal(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "JK_54,门店扫核销码核销虚拟订单", dataProvider = "singleWriteNumVirtualProduct")
    public static void writeOffVirtualOrderByWriteOffQrCode(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);
        TimeUnit.SECONDS.sleep(1L);
        StationApi.orderWriteOffByOrderNumber(OrderVirtualInfoDtoData.getOrderVirtualInfoDTO(orderNum, null));
        CommentApi.addComment(SpuCommDtoData.getSpuCommDtoData(OrderApi.getOrderItemAndAddress(orderNum).getOrderItems().get(0).getOrderItemId()));
        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 1);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getActualTotal(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }

    @Test(description = "JK_55,用户扫门店商家码销虚拟订单", dataProvider = "singleWriteNumVirtualProduct")
    public static void writeOffVirtualOrderByStationCode(Long productId) throws InterruptedException {
        MyOrderApi.confirm(OrderDtoData.getOrderDtoData(productId, 1));
        Long orderNum = MyOrderApi.submit(SubmitOrderDtoData.getSubmitOrderDtoData(productId)).get(0);
        PayApi.orderPay(orderNum);
        TimeUnit.SECONDS.sleep(1L);
        OrderStationDTO orderStationDTO = new OrderStationDTO();
        orderStationDTO.setOrderIds(Collections.singletonList(orderNum));
        orderStationDTO.setStationId(StationApi.getStationIndexInfo().getStationId());
        orderStationDTO.setUserId(UserApi.getUserInfo().getUserId());
        MyOrderApi.orderStationByOrderId(orderStationDTO);
        CommentApi.addComment(SpuCommDtoData.getSpuCommDtoData(OrderApi.getOrderItemAndAddress(orderNum).getOrderItems().get(0).getOrderItemId()));
        ProductApi.delete(productId, true);

        //验证运行后数据是否正确
        Assert.assertEquals(ShopWalletApi.getMongoShopWalletLogBO(orderNum, true).size(), 1);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getActualTotal(), 100);
        Assert.assertEquals(ShopWalletApi.getOrderDetailVO(orderNum, true).getOrderItemDetailList().get(0).getPlatformCommission(), 2);
    }
}
