package com.yh.saas.plugin.yiliangyiyun.entity;

import java.util.Date;
import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableName;

import com.baomidou.mybatisplus.enums.IdType;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yh.saas.common.support.entity.BaseModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * <p>
 * 记录出入库信息
 * </p>
 *
 * @author Gongdc
 * @since 2021-05-21
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("warehouse_in_out_info")
public class WarehouseInOutInfo extends BaseModel<WarehouseInOutInfo> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.UUID)
    private String id;

    /**
     * 仓库id
     */
    private String baseId;
    /**
     * 仓库名称
     */
    private String warehouseName;
    /**
     * 仓位编号id
     */
    private String positionId;
    /**
     * 付款管理id
     */
    private String paymentId;
    /**
     * 仓位编号
     */
    private String binNumber;
    /**
     * 出入库任务编号
     */
    private String inOutTaskNo;
    /**
     * 出库类型(汽运，火运，集装箱船，散船)
     */
    private String outType;
    /**
     * 任务类型key（1出库2入库3移库4退库并出库）
     */
    private String taskTypeKey;
    /**
     * 任务类型
     */
    private String taskType;
    /**
     * 任务状态key
     */
    private String taskStatusKey;
    /**
     * 任务状态
     */
    private String taskStatus;
    /**
     * 出入库标识（出库1入库2）
     */
    private String inOutFlag;
    /**
     * 货名key
     */
    private String goodsNameKey;
    /**
     * 货名
     */
    private String goodsName;
    /**
     * 毛重（吨）
     */
    private Float grossWeight;
    /**
     * 皮重（吨）
     */
    private Float tare;
    /**
     * 净重（吨）
     */
    private Double netWeight;
    /**
     * 单价（元/吨）
     */
    private Float unitPrice;
    /**
     * 调整
     */
    private Float adjustment;
    /**
     * 结算单
     */
    private String settlementSheet;
    /**
     * 业务描述
     */
    private String businessDescribe;
    /**
     * 品级key
     */
    private String gradeKey;
    /**
     * 品级
     */
    private String grade;
    /**
     * 经办人key
     */
    private String agentKey;
    /**
     * 经办人
     */
    private String agent;
    /**
     * 扣重（吨）
     */
    private Float deductionWeight;
    /**
     * 收货方
     */
    private String consignee;
    /**
     * 入库日期(出库)
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone="GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date inOutDate;
    /**
     * 出入库类型key
     */
    private String inOutTypeKey;
    /**
     * 出入库类型
     */
    private String inOutType;
    /**
     * 临时仓库出库类型key
     */
    private String temporaryOutTypeKey;
    /**
     * 临时仓库出库类型
     */
    private String temporaryOutType;
    /**
     * 车牌号
     */
    private String carNo;
    /**
     * 车id
     */
    private String carId;
    /**
     * 成本
     */
    private Float weightedCost;
    /**
     * 箱号
     */
    private String boxNo;
    /**
     * 箱号2
     */
    private String boxNoOther;
    /**
     * 仓位号
     */
    private String binNo;
    /**
     * 封号
     */
    private String titleNo;
    /**
     * 封号2
     */
    private String titleNoOther;
    /**
     * 车厢号
     */
    private String wingNumber;
    /**
     * 车厢号2
     */
    private String wingNumberOther;
    /**
     * 航次
     */
    private String shipNumber;
    /**
     * 船名
     */
    private String shipName;
    /**
     * 是否发车(1已发车)
     */
    private String tranFlag;
    /**
     * 派车编号
     */
    private String tranCarNo;
    /**
     * 用户id
     */
    private String commonId;
    /**
     * 发车净重（吨）
     */
    private Float startWeight;
    /**
     * 出库合同编号
     */
    private String outContractNo;
    /**
     * 合同编号
     */
    private String contractNo;
    /**
     * 退库勾选标识（0未勾选1已勾选2已退库）
     */
    private String returnTickFlag;
    /**
     * 附件地址
     */
    private String addressUrl;
    /**
     * 状态标识（1已暂存3已提交）
     */
    private String statusFlag;
    /**
     * 状态
     */
    private String status;
    /**
     * 内勤ID
     */
    private String backOfficeId;
    /**
     * 内勤
     */
    private String backOffice;
    /**
     * 移库任务编号
     */
    private String moveTaskNo;
    /**
     * 发车净重
     */
    private Float startNetWeight;
    /**
     * 扣款金额
     */
    private Double deductionAmount;
    /**
     * 扣款项
     */
    private String deductionItems;
    /**
     * 类型 潮粮/干粮
     */
    private String type;
    /**
     * 扣重比
     */
    private Float buckleWeightRatio;
    /**
     * 潮粮水分
     */
    private String tidalGrainWater;
    /**
     * 干粮水分
     */
    private String solidGrainWater;
    /**
     * 纯重(吨)
     */
    private Float pureWeight;
    /**
     * 成本
     */
    private Float cost;
    /**
     * 运费
     */
    private Float freight;
    /**
     * 毛检员
     */
    private String secretaryWeigher;
    /**
     * 皮检员
     */
    private String skinInspector;

    @TableField(exist = false)
    private WarehouseInOutDetail warehouseInOutDetail;
    @TableField(exist = false)
    private String companyName;

    /**
     * 查询类型
     */
    @TableField(exist = false)
    private String searchType;

    /**
     * 模糊查询
     */
    @TableField(exist = false)
    private String searchKeyWord;

    /**
     * 开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date startDate;
    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @TableField(exist = false)
    private Date endDate;

    /**
     * 质检员
     */
    @TableField(exist = false)
    private String qualityInspector;
    /**
     * 复检员
     */
    @TableField(exist = false)
    private String reInspector;
    /**
     * 水分
     */
    @TableField(exist = false)
    private String waterContent;
    /**
     * 杂质
     */
    @TableField(exist = false)
    private String impurity;
    /**
     * 霉变粒
     */
    @TableField(exist = false)
    private String mildewGrain;
    /**
     * 不完善粒
     */
    @TableField(exist = false)
    private String imperfectGrain;
    /**
     * 容重
     */
    @TableField(exist = false)
    private String bulkDensity;
    /**
     * 热损伤
     */
    @TableField(exist = false)
    private String jiaorenli;
    /**
     * 蛋白
     */
    @TableField(exist = false)
    private String protein;

    /**
     * PC端(传1,APP传0)
     */
    @TableField(exist = false)
    private String pcFlag;
    /**
     * 关键字
     */

    @TableField(exist = false)
    private String keyWord;
    /**
     * 常用仓库编号
     */
    @TableField(exist = false)
    private String commonWarehouseNo;

    @TableField(exist = false)
    private String phone;
    @TableField(exist = false)
    private String allowEdit;
    /**
     * 扣重
     */
    @TableField(exist = false)
    private Float weightDeduction;
    /**
     * 收货库
     */
    @TableField(exist = false)
    private String receiveWarehouse;
    /**
     * 自运加车标识
     */
    private String selfLoading;

    @TableField(exist = false)
    private ContractManagementInfo contractManagementInfo;
    @TableField(exist = false)
    private List<WarehouseInOutInfo> warehouseInOutInfoList;
    @TableField(exist = false)
    private String automaticWeightAcquisition;
    /**
     * 检斤对象
     */
    @TableField(exist = false)
    private WeighingManagement weighingManagement;


    @Override
    protected Serializable pkVal() {
        return this.id;
    }


    public static class QueryFiles {

        public static final String BASE_ID = "base_id";

        public static final String MOVE_TASK_NO = "move_task_no";

        public static final String DELETE_FLAG = "delete_flag";

        public static final String CONTRACT_NO = "contract_no";

    }
}
