package com.sy.coinage.workshop.model;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;

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_jump")
@ApiModel(value = "实体类", description = "")
public class DeliveryJump 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 = "delivery_plan_id")
    private Integer deliveryPlanId;

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

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

    @ApiModelProperty(value = "拍号区间")
    @TableField(value = "serial_number_between")
    private String serialNumberBetween;

    @ApiModelProperty(value = "起始拍号")
    @TableField(value = "serial_number_start")
    private String serialNumberStart;

    @ApiModelProperty(value = "结束拍号")
    @TableField(value = "serial_number_end")
    private String serialNumberEnd;

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

    @ApiModelProperty(value = "创建人")
    @TableField(value = "creator")
    private String creator;

    @ApiModelProperty(value = "是否启用  1:启用 2:停用")
    @TableField(value = "enable")
    private Integer enable;

    @ApiModelProperty(value = "生命周期状态: 0:初始创建 1:（开始跳号）跳号中 2:结束跳号")
    @TableField(value = "status")
    private Integer status;

    @ApiModelProperty(value = "跳拍数量")
    @TableField(value = "jump_qty")
    private Integer jumpQty;

    @ApiModelProperty(value = "冠字号起始")
    @TableField(value = "crown_from")
    private String crownFrom;

    @ApiModelProperty(value = "冠字号结束")
    @TableField(value = "crown_to")
    private String crownTo;

    @JSONField(serialize = false)
    public String[] getCrownFromArr() {
        return this.crownFrom.split("-");
    }

    @JSONField(serialize = false)
    public String[] getCrownToArr() {
        return this.crownTo.split("-");
    }

}
