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

import com.tmerclub.cloud.common.order.vo.OrderAddrVO;
import com.tmerclub.cloud.common.order.vo.OrderVO;
import com.tmerclub.cloud.order.dto.OrderAddrDTO;
import com.tmerclub.cloud.systemtest.api.order.OrderApi;

/**
 * @author Tu
 */
public class OrderAddrDtoData {
    public static OrderAddrDTO getChangeOrderAddrDTO(Long orderNum){


        OrderAddrDTO orderAddrDTO = new OrderAddrDTO();
        OrderVO orderVO = OrderApi.infoOrder(orderNum);
        OrderAddrVO orderAddrVO = orderVO.getOrderAddr();
        orderAddrDTO.setOrderId(orderNum);
        orderAddrDTO.setUserId(orderVO.getUserId());
        orderAddrDTO.setOrderAddrId(orderVO.getOrderAddrId());
        orderAddrDTO.setProvinceId(orderAddrVO.getProvinceId());
        orderAddrDTO.setProvince(orderAddrVO.getProvince());
        orderAddrDTO.setCityId(orderAddrVO.getCityId());
        orderAddrDTO.setConsignee("修改后的收货人信息");
        orderAddrDTO.setCity(orderAddrVO.getCity());
        orderAddrDTO.setAreaId(orderAddrVO.getAreaId());
        orderAddrDTO.setArea(orderAddrVO.getArea());
        orderAddrDTO.setAddr("自动化修改地址信息");
        orderAddrDTO.setMobile(orderAddrVO.getMobile());

        return orderAddrDTO;
    }
    public static OrderAddrDTO getOrderAddrDTO(Long orderNum){
        OrderVO orderVO = OrderApi.infoOrder(orderNum);
        OrderAddrVO orderAddrVO = orderVO.getOrderAddr();

        OrderAddrDTO orderAddrDTO = new OrderAddrDTO();
        orderAddrDTO.setOrderAddrId(orderVO.getOrderAddrId());
        orderAddrDTO.setOrderId(orderNum);
        orderAddrDTO.setUserId(orderVO.getUserId());
        orderAddrDTO.setConsignee(orderAddrVO.getConsignee());
        orderAddrDTO.setProvinceId(orderAddrVO.getProvinceId());
        orderAddrDTO.setProvince(orderAddrVO.getProvince());
        orderAddrDTO.setCityId(orderAddrVO.getCityId());
        orderAddrDTO.setCity(orderAddrVO.getCity());
        orderAddrDTO.setAreaId(orderAddrVO.getAreaId());
        orderAddrDTO.setArea(orderAddrVO.getArea());
        orderAddrDTO.setAddr(orderAddrVO.getAddr());
        orderAddrDTO.setMobile(orderAddrVO.getMobile());

        return orderAddrDTO;
    }
}
