package com.bs.jxc.domain;

import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.bs.common.annotation.Excel;
import com.bs.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
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 io.swagger.annotations.ApiModelProperty;

/**
 * 出入库单据对象 ck_bill
 *
 * @author bs
 * @date 2023-07-10
 */
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("ck_bill")
@Data
public class CkBill extends BaseEntity{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(value = "id",type = IdType.AUTO)
    @ApiModelProperty(value = "主键")
    private Long id;
    /**
     *  1 直接出入库，0 其他出入库 2 转移单 3 混配矿
     */
    @Excel(name = "数据来源")
    @ApiModelProperty(value = "数据来源")
    private String sourceType;
    /** 单据类型 */

    @Excel(name = "单据类型")
    @ApiModelProperty(value = "单据类型1、入库2、出库3、转场4、混配")
    private String billType;

    @Excel(name = "出入库类型")
    @ApiModelProperty(value = "单据类型1、船舶2、火车3、车辆")
    private String outType;

    /** 单据状态 0未提交，1提交 默认1， */

    @Excel(name = "单据状态")
    @ApiModelProperty(value = "单据状态")
    private String billStatus;
    /**
     * 混配比例
     */
    @Excel(name = "混配比例")
    @ApiModelProperty(value = "单据类型4、混配 时候写的")
    private Integer proportion;

    /** 单据日期 */

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "单据日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "单据日期")
    private Date billDate;


    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date endDate;


    /** 提运单号 必须唯一*/

    @Excel(name = "提运单号")
    @ApiModelProperty(value = "提运单号")
    private String billNo;
    /** 单据编号 */

    @Excel(name = "单据编号")
    @ApiModelProperty(value = "单据编号")
    private String billNumber;

    /** 船舶航次ID */

//    @Excel(name = "船舶航次ID")
    @ApiModelProperty(value = "船舶航次ID")

    private Long voyageId;

//    @Excel(name = "船舶航次货物ID")
    @ApiModelProperty(value = "船舶航次货物ID")
    private Long voyageCargoId;

    /** 航次号 */

    @Excel(name = "航次号")
    @ApiModelProperty(value = "航次号")
    private String voyageNo;

    /** 船舶ID */

//    @Excel(name = "船舶ID")
    @ApiModelProperty(value = "船舶ID")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Long vesselId;

    /** 船舶名称 */

    @Excel(name = "船舶名称")
    @ApiModelProperty(value = "船舶名称")
    private String vesselName;

    @Excel(name = "委托单号")
    @ApiModelProperty(value = "委托单号")
    private String wtNumber;

    @Excel(name = "批次号")
    @ApiModelProperty(value = "批次号")
    private String batchNumber;
    /** 状态 */

    @Excel(name = "状态")
    @ApiModelProperty(value = "状态")
    private String status;

    private String remark;

    /**
     * 原货物，
     *  库存id，扣除数量（用在混配矿）
     */
    @TableField(exist = false)
    private List<CkBillStock> oldCargos;

    /**
     * 新货物，
     *  库存id，扣除数量（用在混配矿）
     */
    @TableField(exist = false)
    private List<CkBillStock> newCargos;
    /**
     * 前
     *  （用在转场）
     */
    @TableField(exist = false)
    private CkBillStock oldCargo;

    @TableField(exist = false)
    private CkBillCargo ckBillCargo;


    @TableField(exist = false)
    private List<CkBillStock> ckBillStocks;
    @TableField(exist = false)
    private List<CkBillCargo> ckBillCargos;
    /**
     * 货主id
     */
    @TableField(exist = false)
    private Long custId;
    /**
     *  true 提交
     */
    @TableField(exist = false)
    private Boolean submitStatus;

    //前端列表入参查询条件
    @TableField(exist = false)
    private String cargoName;
    @TableField(exist = false)
    private String stockName;
    @TableField(exist = false)
    private String stockCode;
    @TableField(exist = false)
    private String custName;
    @TableField(exist = false)
    private String customsNo;
    @TableField(exist = false)
    private String listNumber;
    @TableField(exist = false)
    private String  outBillNumber;
}
