package com.gci.boot.modules.vehicles.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.gci.boot.common.dict.annotation.Dict;
import com.gci.boot.common.validated.SaveValidated;
import com.gci.boot.common.validated.UpdateValidated;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

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

/**
 * <p>
 * 定制件详情表
 * </p>
 *
 * @author 2464
 * @since 2023-09-12
 */
@Getter
@Setter
@TableName("tb_customized_template_part")
@ApiModel(value = "TbCustomizedTemplatePart对象", description = "定制件详情表")
public class TbCustomizedTemplatePart implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("主键id")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @ApiModelProperty("名称")
    @NotBlank(message = "定制件名称不能为空！",groups = {SaveValidated.class, UpdateValidated.class})
    @Length(max = 64,message = "定制件名称不能超过64位字符！",groups = {SaveValidated.class,UpdateValidated.class})
    private String name;

    @ApiModelProperty("规格")
    @NotBlank(message = "规格不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    @Length(max = 64,message = "规格不能超过64位字符！",groups = {SaveValidated.class,UpdateValidated.class})
    private String specification;

    @ApiModelProperty("排序")
    @NotNull(message = "排序不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    private Integer sort;

    @ApiModelProperty("模板id")
    private String templateId;

    @ApiModelProperty("所属机构")
    private String sysOrgCode;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新时间")
    private Date updateTime;

    @ApiModelProperty("创建人")
    private String createBy;

    @ApiModelProperty("更新人")
    private String updateBy;

    @ApiModelProperty("数量")
    @NotNull(message = "数量不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    @Max(value = 2147483647,message = "数量最大值不能超过2147483647！",groups = {SaveValidated.class,UpdateValidated.class})
    @Min(value = 0,message = "数量最小值为0！",groups = {SaveValidated.class,UpdateValidated.class})
    private Integer quantity;

    @ApiModelProperty("单位")
    @Dict(dicCode = "units")
    @NotBlank(message = "单位不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    private String units;

    @ApiModelProperty("入库时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @NotNull(message = "入库时间不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    private Date storageTime;

    @ApiModelProperty("经办人")
    @NotBlank(message = "经办人不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    @Length(max = 32,message = "经办人不能超过32位字符！",groups = {SaveValidated.class,UpdateValidated.class})
    private String responsiblePerson;


}
