
package com.tmerclub.cloud.common.order.vo;

import com.tmerclub.cloud.common.order.dto.DvyTypeDTO;
import io.swagger.v3.oas.annotations.media.Schema;

import java.io.Serial;
import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @author tmerclub
 * @date 2020/12/15
 */
public class UserDeliveryInfoVO implements Serializable {
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(description = "地址ID，0为默认地址")
    private Long addrId;

    @Schema(description = "多店铺的商品配送方式")
    private List<DvyTypeDTO> dvyTypes;
    @Schema(description = "用户选择的自提点id")
    private Long stationId;

    @Schema(description = "提货人信息")
    private UserConsigneeVO userConsignee;

    @Schema(description = "用户地址信息")
    private UserAddrVO userAddr;

    @Schema(description = "免运费金额")
    private Long totalFreeTransfee;

    @Schema(description = "总运费", requiredMode = Schema.RequiredMode.REQUIRED)
    private Long totalTransfee;

    @Schema(description = "同城配送可用状态 : 1 可用 -1 不在范围内 -2 商家没有配置同城配送信息 -3 起送费不够", requiredMode = Schema.RequiredMode.REQUIRED)
    private Integer shopCityStatus;

    private Map<Long, ShopTransFeeVO> shopIdWithShopTransFee;

    /**
     * 每个店铺的供应商运费都是独立的，跟其他店铺间不能共用
     * 格式：Map<店铺id，Map<供应商id，运费>>
     */
    private Map<Long, Map<Long, ShopTransFeeVO>> supplierIdWithShopTransFeeMap;
    private Map<Long, ShopTransFeeVO> preSaleTransFeeMap;

    @Schema(description = "常用自提点信息")
    private OrderSelfStationVO orderSelfStation;


    @Schema(description = "同城配送可用状态 : 1 可用 -1 不在范围内 -2 商家没有配置同城配送信息 -3 起送费不够", requiredMode = Schema.RequiredMode.REQUIRED)
    private List<ShopCityStatusVO> shopCityStatusVOS;


    @Schema(description = "多店铺的同城配送起送费")
    private Map<Long, Long> shopStartDeliveryFees;

    /**
     * 商品运费模板
     * 校验配送范围时存储的商品模板，用于计算商品运费（减少查询次数）
     */
    private Map<Long, TransportVO> transportMap;

    /**
     * 订单中的所有物流模板id列表
     */
    private List<Long> deliveryTemplateIds;

    public Map<Long, Long> getShopStartDeliveryFees() {
        return shopStartDeliveryFees;
    }

    public void setShopStartDeliveryFees(Map<Long, Long> shopStartDeliveryFees) {
        this.shopStartDeliveryFees = shopStartDeliveryFees;
    }

    public List<ShopCityStatusVO> getShopCityStatusVOS() {
        return shopCityStatusVOS;
    }

    public void setShopCityStatusVOS(List<ShopCityStatusVO> shopCityStatusVOS) {
        this.shopCityStatusVOS = shopCityStatusVOS;
    }

    public OrderSelfStationVO getOrderSelfStation() {
        return orderSelfStation;
    }

    public void setOrderSelfStation(OrderSelfStationVO orderSelfStation) {
        this.orderSelfStation = orderSelfStation;
    }

    public Map<Long, ShopTransFeeVO> getPreSaleTransFeeMap() {
        return preSaleTransFeeMap;
    }

    public void setPreSaleTransFeeMap(Map<Long, ShopTransFeeVO> preSaleTransFeeMap) {
        this.preSaleTransFeeMap = preSaleTransFeeMap;
    }

    public UserConsigneeVO getUserConsignee() {
        return userConsignee;
    }

    public void setUserConsignee(UserConsigneeVO userConsignee) {
        this.userConsignee = userConsignee;
    }

    public UserAddrVO getUserAddr() {
        return userAddr;
    }

    public void setUserAddr(UserAddrVO userAddr) {
        this.userAddr = userAddr;
    }

    public Long getTotalTransfee() {
        return totalTransfee;
    }

    public void setTotalTransfee(Long totalTransfee) {
        this.totalTransfee = totalTransfee;
    }

    public Integer getShopCityStatus() {
        return shopCityStatus;
    }

    public void setShopCityStatus(Integer shopCityStatus) {
        this.shopCityStatus = shopCityStatus;
    }

    public Long getTotalFreeTransfee() {
        return totalFreeTransfee;
    }

    public void setTotalFreeTransfee(Long totalFreeTransfee) {
        this.totalFreeTransfee = totalFreeTransfee;
    }

    public Map<Long, ShopTransFeeVO> getShopIdWithShopTransFee() {
        return shopIdWithShopTransFee;
    }

    public void setShopIdWithShopTransFee(Map<Long, ShopTransFeeVO> shopIdWithShopTransFee) {
        this.shopIdWithShopTransFee = shopIdWithShopTransFee;
    }

    public Map<Long, Map<Long, ShopTransFeeVO>> getSupplierIdWithShopTransFeeMap() {
        return supplierIdWithShopTransFeeMap;
    }

    public void setSupplierIdWithShopTransFeeMap(Map<Long, Map<Long, ShopTransFeeVO>> supplierIdWithShopTransFeeMap) {
        this.supplierIdWithShopTransFeeMap = supplierIdWithShopTransFeeMap;
    }

    public Long getAddrId() {
        return addrId;
    }

    public void setAddrId(Long addrId) {
        this.addrId = addrId;
    }

    public List<DvyTypeDTO> getDvyTypes() {
        return dvyTypes;
    }

    public void setDvyTypes(List<DvyTypeDTO> dvyTypes) {
        this.dvyTypes = dvyTypes;
    }

    public Long getStationId() {
        return stationId;
    }

    public void setStationId(Long stationId) {
        this.stationId = stationId;
    }

    public Map<Long, TransportVO> getTransportMap() {
        return transportMap;
    }

    public void setTransportMap(Map<Long, TransportVO> transportMap) {
        this.transportMap = transportMap;
    }

    public List<Long> getDeliveryTemplateIds() {
        return deliveryTemplateIds;
    }

    public void setDeliveryTemplateIds(List<Long> deliveryTemplateIds) {
        this.deliveryTemplateIds = deliveryTemplateIds;
    }


    @Override
    public String toString() {
        return "UserDeliveryInfoVO{" +
                "addrId=" + addrId +
                ", dvyTypes=" + dvyTypes +
                ", stationId=" + stationId +
                ", userConsignee=" + userConsignee +
                ", userAddr=" + userAddr +
                ", totalFreeTransfee=" + totalFreeTransfee +
                ", totalTransfee=" + totalTransfee +
                ", shopCityStatus=" + shopCityStatus +
                ", shopIdWithShopTransFee=" + shopIdWithShopTransFee +
                ", supplierIdWithShopTransFeeMap=" + supplierIdWithShopTransFeeMap +
                ", preSaleTransFeeMap=" + preSaleTransFeeMap +
                ", orderSelfStation=" + orderSelfStation +
                ", shopCityStatusVOS=" + shopCityStatusVOS +
                ", shopStartDeliveryFees=" + shopStartDeliveryFees +
                ", transportMap=" + transportMap +
                ", deliveryTemplateIds=" + deliveryTemplateIds +
                '}';
    }
}
