package cn.iocoder.boot.module.order.api.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OrderRespDTO {
    /**
     * 主键ID
     */
    private Long orderId;
    /**
     * 订单编号
     */
    private String orderNo;
    /**
     * 快递单号
     */
    private String number;
    /**
     * 运输方式id
     */
    private Integer transportId;
    /**
     * 渠道ID
     */
    private Long channelId;
    /**
     * 订单类型(可多选)：1 集运服务 2 海外仓
     */
    private String type;

    /**
     * 下单会员id
     */
    private Long userId;
    /**
     * 客户经理ID
     */
    private Long salesmanId;
    /**
     * 部门ID
     */
    private Long deptId;
    /**
     * 唛头
     */
    private String marks;

    /**
     * 订单状态详情见字典
     */
    private Integer status;

    /**
     * 订单异常状态(字典 order_abnormal_state)
     */
    private Integer abnormalState;

    /**
     * 订单入仓状态(字典 order_warehouse_in_status)
     */
    private Integer inWarehouseState;

    /**
     * 订单出货状态(字典 order_shipment_state)
     */
    private Integer shipmentState;

    /**
     * 上次订单主状态值
     */
    private Integer oldStatus;

    /**
     * 上次订单入仓状态值
     */
    private Integer oldInWarehouseState;

    /**
     * 上次订单出货状态值
     */
    private Integer oldShipmentState;

    /**
     * 是否被删掉 1 删掉；0正常
     */
    private Boolean isDel;

    @ApiModelProperty(value = "代收金额")
    private BigDecimal collectionProxy;

    @ApiModelProperty(value = "代收货币ID")
    private Integer collectionProxyCurrency;
    /**
     * 是否代收货款收款 0为否 1为是
     */
    private Boolean isCollection;
    /**
     * 重货体积
     */
    private BigDecimal wVolume;
    /**
     * 泡货重量
     */
    private BigDecimal vWeight;

    /**
     * 原应收重货体积
     */
    private BigDecimal orgWVolume;
    /**
     * 原应收泡货重量
     */
    private BigDecimal orgVWeight;


    @ApiModelProperty(value = "最小计量重量")
    private BigDecimal minMeteringWeight = BigDecimal.ZERO;

    @ApiModelProperty(value = "最小计量体积")
    private BigDecimal minMeteringVolume = BigDecimal.ZERO;

    @ApiModelProperty(value = "最小计量个数")
    private BigDecimal minMeteringQuantity = BigDecimal.ZERO;
    /**
     * 重货标准基数
     */
    private BigDecimal weightUnit;
    /**
     * 泡货标准基数
     */
    private BigDecimal volumeUnit;

    @ApiModelProperty(value = "原重货标准基数")
    private BigDecimal orgWeightUnit;

    @ApiModelProperty(value = "原泡货标准基数")
    private BigDecimal orgVolumeUnit;

    @ApiModelProperty(value = "计算使用的重货标准基数")
    private BigDecimal useWeightUnit;

    @ApiModelProperty(value = "计算使用的泡货标准基数")
    private BigDecimal useVolumeUnit;
    /**
     * 入仓类型
     */
    private Integer warehouseType;
    /**
     * 备注
     */
    private String remarks;

    /**
     * 调仓始发仓
     */
    private Long adjustToStartWarehouseId;
    /**
     * 调仓目的仓
     */
    private Long adjustToDestWarehouseId;

    /**
     * 目的地调仓始发仓
     */
    private Long destAdjustToStartWarehouseId;
    /**
     * 目的地调仓目的仓
     */
    private Long destAdjustToDestWarehouseId;

    @ApiModelProperty(value = "入仓数量", required = true)
    private Integer sumQuantity;
    /**
     * 入仓件数
     */
    private Integer sumNum;
    /**
     * 自定义入仓体积
     */
    private BigDecimal customSumVolume;
    /**
     * 入仓体积
     */
    private BigDecimal sumVolume;
    /**
     * 自定义入仓重量
     */
    private BigDecimal customSumWeight;
    /**
     * 入仓重量
     */
    private BigDecimal sumWeight;
    /**
     * 重货比
     */
    private BigDecimal weightRatio;
    /**
     * 发货人的客户id
     */
    private Long customerId;


    /**
     * 完成入仓的入仓体积
     */
    private BigDecimal sumVolumeFinishedWarehouseIn;
    /**
     * 完成入仓的入仓重量
     */
    private BigDecimal sumWeightFinishedWarehouseIn;

    /**
     * 完成入仓的箱/件数
     */
    private Integer sumCartonsNumFinishedWarehouseIn;

    /**
     * 完成入仓的所有箱内总货物数量
     */
    private Integer sumQuantityAllFinishedWarehouseIn;

    /**
     * 上次打包的入仓体积
     */
    @ApiModelProperty(value = "上次打包的入仓体积")
    private BigDecimal sumVolumePrevPacked;
    /**
     * 上次打包的入仓重量
     */
    @ApiModelProperty(value = "上次打包的入仓重量")
    private BigDecimal sumWeightPrevPacked;

    /**
     * 上次打包的箱/件数
     */
    @ApiModelProperty(value = "上次打包的箱数")
    private Integer sumCartonsNumPrevPacked;

    /**
     * 上次打包的所有箱内总货物数量
     */
    @ApiModelProperty(value = "上次打包的所有箱内总货物数量")
    private Integer sumQuantityAllPrevPacked;


    @ApiModelProperty(value = "付款人： 1 发货人 2 收货人 3 自定义")
    private Integer drawee;

    @ApiModelProperty(value = "自定义付款人信息")
    private String customDrawee;

    @ApiModelProperty(value = "打包前入仓重量")
    private BigDecimal weightBeforePack;


    @ApiModelProperty(value = "打包后入仓重量")
    private BigDecimal weightAfterPack;


    @ApiModelProperty(value = "是否有收货人，1-是，0-否")
    private Boolean hasConsignee = true;


    @TableField(exist = false)
    @ApiModelProperty(value = "目的地信息")
    @NotNull(message = "目的地信息不能为空")
    private OrderObjectiveApiDO orderObjectiveDO;

    @TableField(exist = false)
    @ApiModelProperty(value = "收货人信息")
    @NotNull(message = "收货人信息不能为空")
    private OrderConsigneeApiDO orderConsigneeDO;

    @TableField(exist = false)
    @ApiModelProperty(value = "目的地ID")
    private Long objectiveId;

    @TableField(exist = false)
    @ApiModelProperty(value = "目的地")
    private String objectiveName;

}
