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.ShipOrderStateEnum;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

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

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

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

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

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

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

	/**
	 * 仓库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 = "vehicle_no")
	private String vehicleNo;

	/**
	 * 发货地址
	 */
	@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 = "driver_name")
	private String driverName;


	/**
	 * 司机手机号码
	 */
	@TableField(value = "driver_phone")
	private String driverPhone;

	/**
	 * 车牌号码
	 */
	@TableField(value = "license_plate")
	private String licensePlate;

	/**
	 * 运费欠款(元)
	 */
	@TableField(value = "freight_debt")
	private BigDecimal freightDebt;

	/**
	 * 草帘欠款(元)
	 */
	@TableField(value = "straw_mat_debt")
	private BigDecimal strawMatDebt;

	/**
	 * 商标费(元)
	 */
	@TableField(value = "trademark_fee")
	private BigDecimal trademarkFee;

	/**
	 * 人工费(元)
	 */
	@TableField(value = "labor_fee")
	private BigDecimal laborFee;

	/**
	 * 纸箱费(元)
	 */
	@TableField(value = "carton_fee")
	private BigDecimal cartonFee;

	/**
	 * 打码费(元)
	 */
	@TableField(value = "coding_fee")
	private BigDecimal codingFee;

	/**
	 * 计提费(元)
	 */
	@TableField(value = "provision_fee")
	private BigDecimal provisionFee;

	/**
	 * 合计金额(元)
	 */
	@TableField(value = "total_amount")
	private BigDecimal totalAmount;

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

	/**
	 * 发货单状态：1_待回款；2_部分回款；3_已回款；4_拒收完结；5_已完结；
	 */
	@TableField(value = "state")
	private ShipOrderStateEnum state;

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

	/**
	 * 采购底单
	 */
	@TableField(value = "purchase_document")
	private String purchaseDocument;

	/**
	 * 成本单据
	 */
	@TableField(value = "cost_document")
	private String costDocument;

	/**
	 * 备注
	 */
	@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<ShipOrderPackageDO> shipOrderPackageDOList;

	/**
	 * 发货单明细
	 */
	@TableField(exist = false)
	private List<ShipOrderItemDO> shipOrderItemDOList;

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

}
