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

import cn.afterturn.easypoi.excel.annotation.Excel;
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.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

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

/**
 * 列表返回的实体类
 * @author 24642
 */
@Data
public class ConsumablesTemplateVo implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 其实是耗材的id
     */
    private String id;

    /**
     * 耗材名称
     */
    @Excel(name = "耗材名称",orderNum = "0")
    private String name;

    /**
     * 规格
     */
    @Excel(name = "耗材规格",orderNum = "4")
    private String specification;

    /**
     * 数量
     */
    @Excel(name = "耗材数量",orderNum = "3")
    private Integer quantity;

    /**
     * 单位
     */
    @Dict(dicCode = "units")
    private String units;

    /**
     * 入库时间
     */
    @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 = "5")
    private Date storageTime;

    /**
     * 经办人
     */
    @NotBlank(message = "经办人不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    @Excel(name = "经办人",orderNum = "4")
    private String responsiblePerson;

    /**
     * 项目id
     */
    @Dict(dictTable = "tb_projects", dicText = "project_name", dicCode = "id")
    @Excel(name = "所属项目",dict = "tb_projects,project_name,id",needMerge = true,orderNum = "1")
    private String projectId;

    /**
     * 车辆种类
     */
    @Dict(dicCode = "vehicle_type")
    @Excel(name = "车辆种类",dict = "vehicle_type",needMerge = true,orderNum = "2")
    private String vehicleType;

    /**
     * 更新时间
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /**
     * 更新人
     */
    @Dict(dictTable = "sys_user", dicCode = "username", dicText = "realname")
    private String updateBy;

}
