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

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

import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
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.gci.boot.annotation.Query.SelectQuery;
import com.gci.boot.common.dict.annotation.Dict;
import com.gci.boot.common.dict.excel.DictConverter;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 项目基础信息表
 * </p>
 *
 * @author xushuhan
 * @since 2023-08-25
 */
@Getter
@Setter
@TableName("tb_projects")
@ApiModel(value = "Projects对象", description = "项目基础信息表")
@ColumnWidth(20)
public class Projects implements Serializable {

    private static final long serialVersionUID = 1L;

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

    @ApiModelProperty("所属客户")
    @ExcelIgnore
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    @Dict(dictTable = "tb_customer_archives", dicText = "name", dicCode = "id")
    private String customerId;

    @ExcelProperty(value = "项目名称", index = 0)
    @ApiModelProperty("项目名称，必填且唯一")
    @SelectQuery(Type = SelectQuery.SelectType.LIKE)
    private String projectName;

    @ExcelProperty(value = "项目负责人", index = 1)
    @ApiModelProperty("负责人的姓名")
    @SelectQuery(Type = SelectQuery.SelectType.LIKE)
    private String projectManager;

    @ExcelIgnore
    @ApiModelProperty("对方单位的名称")
    private String counterparty;

    @ExcelIgnore
    @ApiModelProperty("联系人的姓名")
    private String contactPerson;

    @ExcelProperty(value = "电话号码", index = 2)
    @ApiModelProperty("联系人的电话号码")
    @SelectQuery(Type = SelectQuery.SelectType.LIKE)
    private String contactPhone;

    @ExcelProperty(value = "开始日期", index = 3)
    @ApiModelProperty("项目开始日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat("yyyy-MM-dd")
    private Date startDate;

    @ExcelProperty(value = "结束日期", index = 4)
    @ApiModelProperty("项目结束日期")
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat("yyyy-MM-dd")
    private Date endDate;

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

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

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

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

    @ApiModelProperty("更新人")
    @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "username")
    @ExcelProperty(value = "更新人",converter = DictConverter.class,index = 7)
    private String updateBy;

    @ExcelIgnore
    @ApiModelProperty("废弃状态 0-正常 1-废弃")
    private Integer cancelFlag;

    @ApiModelProperty("历史车辆")
    @ExcelIgnore
    private String hisVehicleId;

    @ExcelProperty(value = "状态", converter = DictConverter.class, index = 5)
    @ApiModelProperty("状态(1 进行中，0 结束)")
    @Dict(dicCode = "project_status")
    @SelectQuery(Type = SelectQuery.SelectType.EQ)
    private String status;

    @ExcelIgnore
    @ApiModelProperty("删除标志")
    private Integer delFlag;

    @ExcelProperty(value = "车牌号", converter = DictConverter.class, index = 11)
    @TableField(exist = false)
    @Dict(dictTable = "tb_vehicle", dicText = "plate_number", dicCode = "id")
    public String busIds;

    @ExcelProperty(value = "项目成员", converter = DictConverter.class, index = 12)
    @TableField(exist = false)
    @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
    public String userIds;

    @ExcelIgnore
    @TableField(exist = false)
    @ApiModelProperty("车辆数")
    public String vehicleNum;

    @ExcelIgnore
    @TableField(exist = false)
    @ApiModelProperty("创建人id")
    @Dict(dictTable = "sys_user", dicText = "realname", dicCode = "id")
    public String createUserId;
}
