package com.sy.coinage.workshop.model;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;

import com.sy.coinage.core.annotation.Conver;
import com.sy.coinage.core.annotation.FastJsonFieldProfile;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.util.Date;

import com.alibaba.fastjson2.annotation.JSONField;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("rfid_delivery_plan")
@ApiModel(value = "实体类", description = "")
public class DeliveryPlan implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @ApiModelProperty(value = "品名ID")
    @TableField(value = "securities_id")
    private Integer securitiesId;

    @ApiModelProperty(value = "品名")
    @TableField(value = "securities")
    private String securities;

    @ApiModelProperty(value = "入库地点ID(原发货地址ID)")
    @TableField(value = "address_id")
    private String addressId;

    @ApiModelProperty(value = "入库地址（原发货地址名称）")
    @TableField(value = "address_cn")
    private String addressCn;

    @ApiModelProperty(value = "计划解缴时间（yyyy-MM-dd）")
    @TableField(value = "plan_delivery_date")
    @JSONField(format = "yyyy-MM-dd")
    private Date planDeliveryDate;

    @ApiModelProperty(value = "数量（万枚）")
    @TableField(value = "qty")
    private Integer qty;

    @ApiModelProperty(value = "总箱数（整拍箱子+零箱）")
    @TableField(value = "total_box_num")
    private Integer totalBoxNum;

    @ApiModelProperty(value = "首箱冠字号(根据首箱冠字号，与首拍箱数)")
    @TableField(value = "first_crown")
    private String firstCrown;

    @ApiModelProperty(value = "首拍编号")
    @TableField(value = "first_serial_number")
    private String firstSerialNumber;

    @ApiModelProperty(value = "首拍箱数(根据首拍箱数)")
    @TableField(value = "first_box_num")
    private Integer firstBoxNum;

    @ApiModelProperty(value = "冠字号范围")
    @TableField(value = "crown_between")
    private String crownBetween;

    @ApiModelProperty(value = "计划拍数（根据箱数、初始冠字号计算得到）")
    @TableField(value = "plan_par")
    private Integer planPar;

    @ApiModelProperty(value = "零箱数-计划（计算所得，不是完整拍子的都在这里累加）")
    @TableField(value = "plan_box_num")
    private Integer planBoxNum;

    @ApiModelProperty(value = "拍号字符串（将拍号按照规则，组装成字符串）")
    @TableField(value = "par_between")
    private String parBetween;

    @ApiModelProperty(value = "发货单号（品名+序号的形式）")
    @TableField(value = "order_no")
    private String orderNo;

    @ApiModelProperty(value = "计划单状态  1:初始创建  2:完成发货")
    @TableField(value = "status")
    @Conver(keys = {"1", "2"}, values = {"未发货", "已发货"})
    private Integer status;

    @ApiModelProperty(value = "开始跳号ID字符串（多个用逗号分割），冗余字段")
    @TableField(value = "start_jump_ids", updateStrategy = FieldStrategy.DEFAULT)
    private String startJumpIds;

    @ApiModelProperty(value = "开始跳号字符串（多个跳号段用逗号分割）冗余字段")
    @TableField(value = "start_jump_str", updateStrategy = FieldStrategy.DEFAULT)
    private String startJumpStr;

    @ApiModelProperty(value = "结束跳号id字符串（多ID用逗号分割）冗余字段")
    @TableField(value = "end_jump_ids", updateStrategy = FieldStrategy.DEFAULT)
    private String endJumpIds;

    @ApiModelProperty(value = "结束跳号字符串（多个跳号段用逗号分割),冗余字段")
    @TableField(value = "end_jump_str", updateStrategy = FieldStrategy.DEFAULT)
    private String endJumpStr;

    @ApiModelProperty(value = "实际发货时间(yyyy-MM-dd hh:mm:ss)，即app库房发货确认时的时间。")
    @TableField(value = "delivery_time")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date deliveryTime;

    @ApiModelProperty(value = "记录创建时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @ApiModelProperty(value = "按新号排列 1是 2否")
    @TableField(value = "reset_serial_number")
    private Integer resetSerialNumber;

    @ApiModelProperty(value = "最后修改时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
    private Date updateTime;

    @ApiModelProperty(value = "备注")
    @TableField(value = "remark")
    private String remark;

}
