package com.ruoyi.web.work.domain;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.web.work.domain.base.BaseData;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

/**
 * @author lsw
 * @date 2024-04-15
 */
@Data
@TableName(value = "tb_project")
@Accessors(chain = true)
public class Project extends BaseData {
    private static final long serialVersionUID = 1L;

    private Long id;

    @ApiModelProperty(value = "关联企业")
    private Long companyId;

    @NotBlank(message = "项目名称不能为空")
    @ApiModelProperty(value = "项目名称")
    private String projectName;

    @ApiModelProperty(value = "项目类型")
    private Long projectType;

    @ApiModelProperty(value = "项目编号")
    private String num;

    @ApiModelProperty(value = "项目内容")
    private String contents;

    @ApiModelProperty(value = "服务公司")
    private String serviceCompany;

    @NotNull(message = "项目周期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "开始时间")
    private Date startDate;

    @NotNull(message = "项目周期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "结束时间")
    private Date finishDate;

    @NotNull(message = "项目周期不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "结算日")
    private Date balanceDate;

    @ApiModelProperty(value = "接包人数")
    private Long peoples;

    @ApiModelProperty(value = "状态:0=正常,1=停用")
    private Integer state;

    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @TableField(fill = FieldFill.UPDATE)
    private String updateBy;

    @TableField(fill = FieldFill.UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    @JsonIgnore
    private List<Long> companyIds;

    @TableField(exist = false)
    @JsonIgnore
    private List<Long> projectIds;

}
