package com.jwipc.shopping.model.vo;

import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 *     在线商城订单 实体类
 * </p>
 *
 * @author qmx
 * @version 1.0
 * @since 2021/8/13
 */
@Data
public class OnlineMallCart {
    private Long id;
    private Integer deliveryStatus;
    private Integer cartDeliveryStatus;
    private Integer whetherCallOff;
    private String deliveryStatusText;
    private String skuName;
    private BigDecimal unitCost;
    private String unit;
    private BigDecimal qty;
    private BigDecimal requireNum;
    private BigDecimal receiptNum;
    private LocalDateTime receivedTime;
    private String prCode;
    private String storeNameInfo;
    private String purchaseOrderNumber;
    private String packageId;
    private String invoiceNumber;
    private String thirdOrder;
    private Integer invoiceState;
    private Integer invoiceType;
    private String content;
    private String centerCode;
    private String centerName;
    private String factoryCode;
    private String factoryName;
    private String purchaseOrg;
    private String pgoName;
    private String purchaseGroup;
    private String pgName;
    private Integer status;
    private String callbackDesc;
    private String provinceName;
    private String cityName;
    private String countyName;
    private String provinceCode;
    private String cityCode;
    private String countyCode;
    private String address;
    private String receivingUser;
    private String receivingTel;
    private String invoiceTitle;
    private String invoiceNo;
    private String openingBank;
    private String bankAccount;
    private String bankTel;
    private String bankAddress;
    private String orderId;
    private String storeCode;
    private String storeName;
    private Integer srmStatus;
    private Long createUserId;
    private String invoiceTel;
    private String invoiceAddress;
    private String oaId;
    private Integer oaStatus;
    private String remark;
    private String srmOrderCode;
    private String createUserName;
    private LocalDateTime createTime;
    private BigDecimal returnQuatity;
    private BigDecimal price;
    private Integer receiptStatus;
    private String receiptStatusText;
    private String provinceCityCounty;
    private String requireName;
    private String teamName;


    public OnlineShoppingXyDto toXySc(){
        OnlineShoppingXyDto xyDto = new OnlineShoppingXyDto();
        xyDto.setThirdOrder(this.thirdOrder);
        xyDto.setName(this.receivingUser);
        xyDto.setProvince(Integer.parseInt(this.provinceCode));
        xyDto.setCity(Integer.parseInt(this.cityCode));
        xyDto.setCounty(Integer.parseInt(this.countyCode));
        xyDto.setTown(0);
        xyDto.setAddress(this.address);
        xyDto.setMobile(this.receivingTel);
        xyDto.setInvoiceProvice(Integer.parseInt(this.provinceCode));
        xyDto.setInvoiceCity(Integer.parseInt(this.cityCode));
        xyDto.setInvoiceCounty(Integer.parseInt(this.countyCode));
        xyDto.setInvoiceState(this.invoiceState);
        xyDto.setInvoiceType(this.invoiceType);
        xyDto.setCompanyName(this.invoiceTitle);
        xyDto.setOrderCompany(this.invoiceTitle);
        xyDto.setReceiptCompanyTel(this.invoiceTel);
        xyDto.setReceiptCompanyAddr(this.invoiceAddress);
        xyDto.setReceiptTaxNo(this.invoiceNo);
        xyDto.setReceiptBankName(this.openingBank);
        xyDto.setReceiptAccount(this.bankAccount);
        xyDto.setStoreCode(this.storeCode);
        xyDto.setStoreName(this.storeName);
        xyDto.setRemark(this.remark);
        return xyDto;
    }


    public OnlineShoppingZkhDto toZkhSc(){
        OnlineShoppingZkhDto zkhDto = new OnlineShoppingZkhDto();
        zkhDto.setThirdOrder(this.thirdOrder);
        zkhDto.setName(this.receivingUser);
        zkhDto.setInvoiceName(this.receivingUser);
        OnlineShoppingZkhDto.ShoppingAddress region = new OnlineShoppingZkhDto.ShoppingAddress();
        region.setProvince(this.provinceName);
        region.setCity(this.cityName);
        region.setCounty(this.countyName);
        region.setTown("");
        zkhDto.setRegion(region);
        zkhDto.setAddress(this.provinceName+this.cityName+this.countyName+this.address);
        zkhDto.setInvoiceAddress(this.provinceName+this.cityName+this.countyName+this.address);
        zkhDto.setMobile(this.receivingTel);
        zkhDto.setInvoicePhone(this.receivingTel);
        OnlineShoppingZkhDto.invoice invoiceInfo = new OnlineShoppingZkhDto.invoice();
        invoiceInfo.setType(this.invoiceType);
        invoiceInfo.setTitle(this.invoiceTitle);
        invoiceInfo.setTel(this.bankTel);
        invoiceInfo.setAddress(this.invoiceAddress);
        invoiceInfo.setEnterpriseTaxpayer(this.invoiceNo);
        invoiceInfo.setBank(this.openingBank);
        invoiceInfo.setAccount(this.bankAccount);
        invoiceInfo.setContent(this.content);
        zkhDto.setInvoiceInfo(invoiceInfo);
        zkhDto.setStoreCode(this.storeCode);
        zkhDto.setStoreName(this.storeName);
        zkhDto.setRemark(this.remark);
        return zkhDto;
    }
    
}
