package com.sy.coinage.workshop.req;

import com.alibaba.fastjson2.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.sy.coinage.core.interceptor.Update;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
public class BaseInfoNewReq {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "数量:一个拍子上有多少箱（拆包：表示拆的包有多少箱)，主要用于拆包")
    @NotNull(message = "箱数不能为空")
    private Integer qty;

    /**
     * -品名ID -10
     */
    @ApiModelProperty(value = "品名ID", required = true)
    @NotNull(message = "品名ID不能为空")
    private Integer securitiesId;

    /**
     * -编号 -20
     */
    @ApiModelProperty(value = "编号", required = true)
    @NotBlank(message = "编号不能为空")
    @Length(max = 20, message = "编号长度20不正确")
    private String serialNumber;


    @ApiModelProperty(value = "称重时间")
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "称重时间不能为空")
    private Date weightDateTime;

    /**
     * -皮重 -10
     */
    @ApiModelProperty(value = "皮重", required = true)
    @NotNull(message = "皮重不能为空")
    private Double tareWeight;
    /**
     * -毛重 -10
     */
    @ApiModelProperty(value = "毛重", required = true)
    @NotNull(message = "毛重不能为空")
    private Double grossWeight;

    @ApiModelProperty(value = "称重人")
    private String weightor;
    /**
     * -冠字号起始 -10
     */
    @ApiModelProperty(value = "冠字号起始", required = true)
    @NotBlank(message = "冠字号起始不能为空")
    @Length(max = 10, message = "冠字号起始长度10不正确")
    private String crownFrom;
    /**
     * -冠字号结束点 -10
     */
    @ApiModelProperty(value = "冠字号结束点", required = true)
    @NotBlank(message = "冠字号结束点不能为空")
    @Length(max = 10, message = "冠字号结束点长度10不正确")
    private String crownTo;

//    @ApiModelProperty(value = "冠字号前缀", required = true)
//    @NotBlank(message = "冠字号前缀不能为空")
//    @Length(max = 10, message = "冠字号前缀长度10不正确")
//    private String crownPrefix;
}
