package com.xunhong.erp.turbo.api.biz.dto.vo;

import com.alibaba.cola.dto.DTO;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xunhong.erp.turbo.api.biz.dto.common.OrderCost;
import com.xunhong.erp.turbo.api.biz.dto.common.OrderShipItem;
import com.xunhong.erp.turbo.api.biz.dto.common.OrderVehicle;
import com.xunhong.erp.turbo.api.biz.dto.enums.OrderShipStateEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author shenyifei
 */
@Data
@Schema(title = "发货单")
@EqualsAndHashCode(callSuper = true)
public class OrderShipVO extends DTO {

	/**
	 * 发货单ID
	 */
	@Schema(title = "发货单ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
	private Long orderShipId;

	/**
	 * 采购单ID
	 */
	@Schema(title = "采购单ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
	private Long orderId;
	
	/**
	 * 经销商ID
	 */
	@Schema(title = "经销商ID", type = "string")
	private Long dealerId;

	/**
	 * 经销商名称
	 */
	@Schema(title = "经销商名称")
	private String dealerName;

	/**
	 * 发货单编号
	 */
	@Schema(title = "发货单编号")
	private String orderSn;

	/**
	 * 仓库ID
	 */
	@Schema(title = "仓库ID", type = "string")
	private Long warehouseId;

	/**
	 * 仓库名称
	 */
	@Schema(title = "仓库名称")
	private String warehouseName;

	/**
	 * 公司ID
	 */
	@Schema(title = "公司ID", type = "string")
	private Long companyId;

	/**
	 * 公司名称
	 */
	@Schema(title = "公司名称")
	private String companyName;

	/**
	 * 发货地址
	 */
	@Schema(title = "发货地址")
	private String shippingAddress;

	/**
	 * 收货地址
	 */
	@Schema(title = "收货地址")
	private String receivingAddress;

	/**
	 * 发货日期
	 */
	@Schema(title = "发货日期")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private LocalDate shippingDate;

	/**
	 * 预计到仓时间
	 */
	@Schema(title = "预计到仓时间")
	@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd")
	private LocalDate estimatedArrivalDate;

	/**
	 * 西瓜品级
	 */
	@Schema(title = "西瓜品级")
	private String watermelonGrade;

	/**
	 * 瓜农姓名逗号隔开
	 */
	@Schema(title = "瓜农姓名逗号隔开")
	private String farmerInfo;

	/**
	 * 发货单据
	 */
	@Schema(title = "发货单据")
	private String document;

	/**
	 * 发货单状态：0_草稿；1_待发货；2_待回款；3_待改签；4_部分回款；5_已回款；6_拒收完结；7_已完结；
	 */
	@Schema(title = "发货单状态：0_草稿；1_待发货；2_待回款；3_待改签；4_部分回款；5_已回款；6_拒收完结；7_已完结；")
	private OrderShipStateEnum state;

	/**
	 * 备注
	 */
	@Schema(title = "备注")
	private String remark;

	/**
	 * 创建人ID
	 */
	@Schema(title = "创建人ID", type = "string", requiredMode = Schema.RequiredMode.REQUIRED)
	private Long createdBy;

	/**
	 * 创建人姓名
	 */
	@Schema(title = "创建人姓名")
	private String createdByName;

	/**
	 * 创建时间
	 */
	@Schema(title = "创建时间")
	private LocalDateTime createdAt;


	/**
	 * 发货单明细
	 */
	@Schema(title = "发货单明细")
	private List<OrderShipItem> orderShipItemList;

	/**
	 * 发货单成本项目信息
	 */
	@Schema(title = "发货单成本项目信息")
	private List<OrderCost> orderCostList;

	/**
	 * 采购订单车辆运输信息
	 */
	@Schema(title = "采购订单车辆运输信息")
	private OrderVehicle orderVehicle;

}
