package com.sy.coinage.workshop.req;

import com.sy.coinage.core.interceptor.Create;
import com.sy.coinage.core.interceptor.Update;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;

import org.hibernate.validator.constraints.Length;
import io.swagger.annotations.ApiModelProperty;

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

import com.alibaba.fastjson2.annotation.JSONField;
import org.hibernate.validator.constraints.Range;
import lombok.Data;

/**
 * -添加/修改请求bean
 */
@Data
public class DeliveryPlanDetailReq implements Serializable {

    private static final long serialVersionUID = 1L;
    @NotNull(message = "id不能为空", groups = {Update.class})
    @Range(min = 1, groups = {Update.class})
    private Integer id;

    @ApiModelProperty(value = "发货计划ID", required = true)
    @NotNull(message = "发货计划ID不能为空")
    private Integer planId;

    @ApiModelProperty(value = " rfid:冗余字段:分配计划时，还没有rfid.", required = true)
    @NotBlank(message = " rfid:冗余字段:分配计划时，还没有rfid.不能为空")
    @Length(max = 20, message = " rfid:冗余字段:分配计划时，还没有rfid.长度不正确,最大长度20字符")
    private String rfid;

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

    @ApiModelProperty(value = "冠字号号段字符串（eg:佰21伍003-0921-佰21伍003-0980）", required = true)
    @NotBlank(message = "冠字号号段字符串（eg:佰21伍003-0921-佰21伍003-0980）不能为空")
    @Length(max = 100, message = "冠字号号段字符串（eg:佰21伍003-0921-佰21伍003-0980）长度不正确,最大长度100字符")
    private String crownBetweenStr;

    @ApiModelProperty(value = "拍子类型1:整拍 2: 前  3:后(由拍子类型、数量决定拍子取的箱子)", required = true)
    @NotNull(message = "拍子类型1:整拍 2: 前  3:后(由拍子类型、数量决定拍子取的箱子)不能为空")
    private Integer type;

    @ApiModelProperty(value = "箱子数量", required = true)
    @NotNull(message = "箱子数量不能为空")
    private Integer qty;

    @ApiModelProperty(value = "皮重", required = true)
    @NotNull(message = "皮重不能为空")
    private Double tareWeight;

    @ApiModelProperty(value = "毛重", required = true)
    @NotNull(message = "毛重不能为空")
    private Double grossWeight;

    @ApiModelProperty(value = "称重人ID", required = true)
    @NotNull(message = "称重人ID不能为空")
    private Integer weightorId;

    @ApiModelProperty(value = "称重人", required = true)
    @NotBlank(message = "称重人不能为空")
    @Length(max = 20, message = "称重人长度不正确,最大长度20字符")
    private String weightor;

    @ApiModelProperty(value = "打印时间", required = true)
    @JSONField(format = "yyyy-MM-dd")
    @NotNull(message = "打印时间不能为空")
    private Date printTime;

    @ApiModelProperty(value = "冠字号起始号（eg:003-2121）", required = true)
    @NotBlank(message = "冠字号起始号（eg:003-2121）不能为空")
    @Length(max = 20, message = "冠字号起始号（eg:003-2121）长度不正确,最大长度20字符")
    private String crownFrom;

    @ApiModelProperty(value = "冠字号结束号(eg:003-2121）", required = true)
    @NotBlank(message = "冠字号结束号(eg:003-2121）不能为空")
    @Length(max = 20, message = "冠字号结束号(eg:003-2121）长度不正确,最大长度20字符")
    private String crownTo;

}
