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


import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.IdType;
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.annotation.Query.SelectQuery;
import com.gci.boot.annotation.repeat.FieldRepeat;
import com.gci.boot.annotation.repeat.TableRepeat;
import com.gci.boot.common.dict.annotation.Dict;
import com.gci.boot.common.dict.excel.DictConverter;
import com.gci.boot.common.validated.SaveValidated;
import com.gci.boot.common.validated.UpdateValidated;

import cn.afterturn.easypoi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

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

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

import org.hibernate.validator.constraints.Length;

@TableName("tb_contract_vehicle")
@ApiModel(value = "TbContractVehicle对象", description = "合同车辆细项表")
@TableRepeat(aClass = TbContractVehicle.class,groups = {SaveValidated.class, UpdateValidated.class})
@Data
public class TbContractVehicle implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty("车辆品牌")
    @Dict(dicCode = "vehicle_brand")
    @NotBlank(message = "车辆品牌不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    private String vehicleBrand;
    
    @ApiModelProperty("车辆型号")
    @NotBlank(message = "车辆型号不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    private String vehicleModel;
    
    @ApiModelProperty("车辆种类")
    @Dict(dicCode = "vehicle_type")
    @NotBlank(message = "车辆种类不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    private String vehicleType;
    
    @ApiModelProperty("数量")
    @NotNull(message = "数量不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    private Integer quantity;
    
    @ApiModelProperty("单价(万元含税)")
    @NotNull(message = "单价不能为空！",groups = {SaveValidated.class,UpdateValidated.class})
    private Double totalPrice;

    @ApiModelProperty("整备质量")
    @Digits(integer = 6 , fraction = 2,message = "整备质量整数不能超过6位，小数不能超过2位",groups = {SaveValidated.class,UpdateValidated.class})
    private BigDecimal curbWeight;

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

    @ApiModelProperty("创建时间")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private Date createTime;

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

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

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

}
