package com.xunhong.erp.turbo.biz.infrastructure.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.xunhong.erp.turbo.api.biz.dto.enums.OrderShipStateEnum;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * @author shenyifei
 */
@Data
@TableName(value = "order_ship")
@EqualsAndHashCode(callSuper = true)
public class OrderShipDO extends BaseDO<OrderShipDO> {

	/**
	 * 发货单ID
	 */
	@TableId(value = "order_ship_id", type = IdType.ASSIGN_ID)
	private Long orderShipId;

	/**
	 * 采购单ID
	 */
	@TableField(value = "order_id")
	private Long orderId;

	/**
	 * 经销商ID
	 */
	@TableField(value = "dealer_id")
	private Long dealerId;

	/**
	 * 经销商名称
	 */
	@TableField(value = "dealer_name")
	private String dealerName;


	/**
	 * 发货单编号
	 */
	@TableField(value = "order_sn")
	private String orderSn;

	/**
	 * 仓库ID
	 */
	@TableField(value = "warehouse_id")
	private Long warehouseId;

	/**
	 * 仓库名称
	 */
	@TableField(value = "warehouse_name")
	private String warehouseName;

	/**
	 * 公司ID
	 */
	@TableField(value = "company_id")
	private Long companyId;

	/**
	 * 公司名称
	 */
	@TableField(value = "company_name")
	private String companyName;

	/**
	 * 发货地址
	 */
	@TableField(value = "shipping_address")
	private String shippingAddress;

	/**
	 * 收货地址
	 */
	@TableField(value = "receiving_address")
	private String receivingAddress;

	/**
	 * 发货日期
	 */
	@TableField(value = "shipping_date")
	private LocalDate shippingDate;

	/**
	 * 预计到仓时间
	 */
	@TableField(value = "estimated_arrival_date")
	private LocalDate estimatedArrivalDate;

	/**
	 * 西瓜品级
	 */
	@TableField(value = "watermelon_grade")
	private String watermelonGrade;

	/**
	 * 瓜农姓名逗号隔开
	 */
	@TableField(value = "farmer_info")
	private String farmerInfo;

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

	/**
	 * 发货单据
	 */
	@TableField(value = "document")
	private String document;

	/**
	 * 备注
	 */
	@TableField(value = "remark")
	private String remark;

	/**
	 * 创建人ID
	 */
	@TableField(value = "created_by")
	private Long createdBy;

	/**
	 * 创建人姓名
	 */
	@TableField(value = "created_by_name")
	private String createdByName;
	/**
	 * 发货单明细
	 */
	@TableField(exist = false)
	private List<OrderShipItemDO> orderShipItemDOList;

	/**
	 * 订单成本
	 */
	@TableField(exist = false)
	private List<OrderCostDO> orderCostDOList;

	@TableField(exist = false)
	private OrderVehicleDO orderVehicleDO;

}
