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.PurchaseOrderAuditStateEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.PurchaseOrderPricingMethodEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.PurchaseOrderStateEnum;
import com.xunhong.erp.turbo.api.biz.dto.enums.PurchaseOrderTypeEnum;
import com.xunhong.erp.turbo.datasource.domain.entity.BaseDO;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

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

	/**
	 * 订单ID
	 */
	@TableId(value = "order_id", type = IdType.ASSIGN_ID)
	private Long orderId;

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

	/**
	 * 步骤标识
	 */
	@TableField(value = "active")
	private Integer active;

	/**
	 * 产地负责人
	 */
	@TableField(value = "origin_principal")
	private String originPrincipal;

	/**
	 * 工头
	 */
	@TableField(value = "foreman")
	private String foreman;

	/**
	 * 报价方式：1_按毛重报价；2_按净重报价；
	 */
	@TableField(value = "pricing_method")
	private PurchaseOrderPricingMethodEnum pricingMethod;

	/**
	 * 采购订单状态: 0_草稿；1_审核中；2_已完成；3_已驳回；4_已关闭；
	 */
	@TableField(value = "state")
	private PurchaseOrderStateEnum state;

	/**
	 * 采购单审核状态: 1_待报价审核；2_待老板审批；3_老板审批通过；4_报价审核驳回；5_老板审批驳回
	 */
	@TableField(value = "audit_state")
	private PurchaseOrderAuditStateEnum auditState;

	/**
	 * 采购类型：1_产地采购；2_市场采购；
	 */
	@TableField(value = "type")
	private PurchaseOrderTypeEnum type;

	/**
	 * 备注
	 */
	@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 OrderVehicleDO orderVehicleDO;

	@TableField(exist = false)
	private OrderDealerDO orderDealerDO;

	@TableField(exist = false)
	private OrderCompanyDO orderCompanyDO;

	@TableField(exist = false)
	private OrderRebateDO orderRebateDO;

	@TableField(exist = false)
	private List<OrderSupplierDO> orderSupplierDOList;

	@TableField(exist = false)
	private List<OrderCostDO> orderCostDOList;

	@TableField(exist = false)
	private List<OrderCostItemDO> orderCostItemDOList;

	@TableField(exist = false)
	private List<OrderPackageDO> orderPackageDOList;

	@TableField(exist = false)
	private List<OrderShipDO> orderShipDOList;
}

