package cn.ezhizao.project.business.domain;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import cn.ezhizao.framework.web.domain.BaseEntity;
import cn.ezhizao.framework.aspectj.lang.annotation.Excel;
import lombok.Data;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;

/**
 * 外协单主
带箱方式，是整单的。如果换新箱子，明细中，都需要更换箱子对象 biz_outsourced_order
 *
 * @author 庄德政
 * date    2024-04-26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "biz_outsourced_order")
public class BizOutsourcedOrder extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 租户（厂别）id */
    @ApiModelProperty(value = "${comment}")
    private Long tenantId;

    /** 单据号 */
    @Excel(name = "单据号")
    @ApiModelProperty(value = "单据号")
    private String formCode;

    /** 表单日期 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "表单日期", width = 30, dateFormat = "yyyy-MM-dd")
    @ApiModelProperty(value = "表单日期")
    private Date formDate;

    /** 外协商id */
    @ApiModelProperty(value = "表单日期")
    private Long supplierId;

    /** 外协商名称 */
    @Excel(name = "外协商名称")
    @ApiModelProperty(value = "外协商名称")
    private String supplierName;

    /** 0：自提；1：物流 */
    @Excel(name = "0：自提；1：物流")
    @ApiModelProperty(value = "0：自提；1：物流")
    private String deliveryMethod;

    @Excel(name = "结算方式")
    @ApiModelProperty(value = "0：无结算方式，1：按支结算，2：按炉结算")
    private String settlementType;

    /** 运费单价 */
    @Excel(name = "运费单价")
    @ApiModelProperty(value = "运费单价")
    private BigDecimal freightPrice;

    /** 运费总价 */
    @Excel(name = "运费总价")
    @ApiModelProperty(value = "运费总价")
    private BigDecimal freightAmount;

    /** 带箱方式：0：原箱；1：新箱 */
    @Excel(name = "带箱方式：0：原箱；1：新箱")
    @ApiModelProperty(value = "带箱方式：0：原箱；1：新箱")
    private String packagingMethod;

    /** 对应的产品明细 **/
    @TableField(exist = false)
    private List<BizOutsourcedOrderDetail> details;

    private BigDecimal lossLimit;

    /** 前端查询用 开始日期 **/
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date formStartDate;

    /** 前端查询用 结束日期 **/
    @JsonFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date formEndDate;
    private Integer isSubmit;
}
