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

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
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.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author 24642
 */
@Getter
@Setter
@TableName("tb_consumables_template_out_part")
@ApiModel(value = "TbConsumablesTemplatePart对象", description = "耗材出库")
public class TbConsumablesTemplateOutPart implements Serializable {

    private static final long serialVersionUID = 1L;

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

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

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

    @ApiModelProperty("更新时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @Excel(name = "更新时间",format = "yyyy-MM-dd HH:mm:ss",orderNum = "10")
    private Date updateTime;

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

    @ApiModelProperty("更新人")
    @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname")
    @Excel(name = "更新人",dict = "sys_user,username,realname",orderNum = "9")
    private String updateBy;

    @TableField(exist = false)
    @Excel(name = "所属项目",dict = "tb_projects,project_name,id",orderNum = "0")
    private String projectId;

    @ApiModelProperty("名称")
    @TableField(exist = false)
    @Excel(name = "名称",orderNum = "1")
    private String name;

    @TableField(exist = false)
    @Excel(name = "入库数量",orderNum = "2")
    private Integer quantity;

    @ApiModelProperty("单位")
    @TableField(exist = false)
    @Excel(name = "单位",orderNum = "3")
    private String units;

    @ApiModelProperty("规格")
    @TableField(exist = false)
    @Excel(name = "规格",orderNum = "4")
    private String specification;

    @Excel(name = "供应商",orderNum = "5")
    @TableField(exist = false)
    private String supplier;

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

    @ApiModelProperty("出库数量")
    @NotNull(message = "出库数量不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    @Min(value = 1,message = "出库数量最小值为1",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "出库数量",orderNum = "7")
    private Integer outQuantity;

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

    @ApiModelProperty("入库记录id")
    @NotBlank(message = "入库对应id不能为空！",groups = {SaveValidated.class})
    private String partId;





}
