package com.nbclass.szxgl.model;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Transient;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;

@Data
public class Project {
	
    @Id
    private String id;

    /**
     * 名称
     */
	@NotEmpty(message="项目名称不能为空")
    @Length(min=1, max=100, message="项目名称长度限制在1-100")
    @Column(name = "_name")
    private String name;

    /**
     * 项目类型
     */
//	@NotEmpty(message="项目类型不能为空")
	@Column(name = "_type")
    private String type;

    /**
     * 重要程度
     */
//	@NotEmpty(message="项目重要程度不能为空")
    @Column(name = "_importance")
    private String importance;

    /**
     * 项目地区
     */
	@NotEmpty(message="项目地区不能为空")
    @Column(name = "_area")
    private String area;

    /**
     * 状态,0:未开始,1:运行中,2:暂停,3:结束
     */
    @Column(name = "_status")
    private Byte status;

    /**
     * 开始时间
     */
    @NotNull(message="开始时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "_start_time")
    private Date startTime;

    /**
     * 结束时间
     */
  //  @NotNull(message="结束时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "_end_time")
    private Date endTime;

    /**
     * 项目计划时间
     */
    @NotNull(message="计划时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "_plan_time")
    private Date planTime;

    /**
     * 创建人
     */
    @Column(name = "_create_user_id")
    private String createUserId;

    /**
     * 创建时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Column(name = "_create_time")
    private Date createTime;

    /**
     * 修改时间
     */
    @Column(name = "_update_time")
    private Date updateTime;

    /**
     * 是否发送微信通知,0:未通知
     */
    @Column(name = "_notify")
    private Short notify;

    /**
     * 客户接口人姓名+联系方式
     */
    @Column(name = "_customer")
    private String customer;

    /**
     * 合同编号
     */
//    @NotEmpty(message="合同编号不能为空")
//	@Length(min=1, max=30, message="合同编号长度限制在1-30")
    @Column(name = "_contractno")
    private String contractno;

    /**
     * 项目内容
     */
    @Column(name = "_content")
    private String content;

    /**
     * 客户单位表id
     */
    @Column(name = "_project_client_id")
    private String projectClientId;

    /**
     * 客户单位数组
     */
    @Column(name = "_project_clien_array")
    private String projectClienArray;

    
    // 以下是查询字段
    
    /**
     * 是否是管理员, 值为Y或N
     */
    @Transient
    private String isAdmin;
    
    /**
     * 登录用户ID
     */
    @Transient
    private String loginName;
    /**
     * 客户单位名称
     */
    @Transient
    private String typeName;
    /**
     * 重要程度名称
     */
    @Transient
    private String importanceName;
    /**
     * 创建人姓名
     */
    @Transient
    private String createUserName;
    /**
     * 查询的部门id
     */
    @Transient
    private String deptId;
    /**
     * 部门下所有成员userid
     */
    @Transient
    private List<String> deptUserIds;
    
    // 按时间范围查询，注意这个类不要用lombok插件，不然这个取不到值，应该是与上面的startTime、endTime冲突了
    @Transient
    private String starttime;
    @Transient
    private String endtime;
    @Transient
    private String plantime;

    /**
     * 项目负责人userid(多个逗号分隔)
     */
    @Transient
    private String fzrIds;

    /**
     * 项目负责人名字(多个逗号分隔)
     */
    @Transient
    private String fzrNames;
    
    /**
     * 项目抄送人userid(多个逗号分隔)
     */
    @Transient
    private String csrIds;
    
    /**
     * 项目抄送人名字(多个逗号分隔)
     */
    @Transient
    private String csrNames;

    /**
     * 返回给前端的字段，表示是否可修改删除项目的权限操作
     */
    @Transient
    private Boolean allowModify;

    @Transient
    private String areaShow;


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getImportance() {
        return importance;
    }

    public void setImportance(String importance) {
        this.importance = importance;
    }

    public String getArea() {
        return area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    public Byte getStatus() {
        return status;
    }

    public void setStatus(Byte status) {
        this.status = status;
    }

    public Date getStartTime() {
        return startTime;
    }

    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }

    public Date getEndTime() {
        return endTime;
    }

    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Date getPlanTime() {
        return planTime;
    }

    public void setPlanTime(Date planTime) {
        this.planTime = planTime;
    }


    public String getCreateUserId() {
        return createUserId;
    }

    public void setCreateUserId(String createUserId) {
        this.createUserId = createUserId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Short getNotify() {
        return notify;
    }

    public void setNotify(Short notify) {
        this.notify = notify;
    }

    public String getCustomer() {
        return customer;
    }

    public void setCustomer(String customer) {
        this.customer = customer;
    }

    public String getContractno() {
        return contractno;
    }

    public void setContractno(String contractno) {
        this.contractno = contractno;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getProjectClientId() {
        return projectClientId;
    }

    public void setProjectClientId(String projectClientId) {
        this.projectClientId = projectClientId;
    }

    public String getProjectClienArray() {
        return projectClienArray;
    }

    public void setProjectClienArray(String projectClienArray) {
        this.projectClienArray = projectClienArray;
    }

    public String getIsAdmin() {
        return isAdmin;
    }

    public void setIsAdmin(String isAdmin) {
        this.isAdmin = isAdmin;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public String getImportanceName() {
        return importanceName;
    }

    public void setImportanceName(String importanceName) {
        this.importanceName = importanceName;
    }

    public String getCreateUserName() {
        return createUserName;
    }

    public void setCreateUserName(String createUserName) {
        this.createUserName = createUserName;
    }

    public String getDeptId() {
        return deptId;
    }

    public void setDeptId(String deptId) {
        this.deptId = deptId;
    }

    public List<String> getDeptUserIds() {
        return deptUserIds;
    }

    public void setDeptUserIds(List<String> deptUserIds) {
        this.deptUserIds = deptUserIds;
    }

    public String getStarttime() {
        return starttime;
    }

    public void setStarttime(String starttime) {
        this.starttime = starttime;
    }

    public String getEndtime() {
        return endtime;
    }


    public void setEndtime(String endtime) {
        this.endtime = endtime;
    }

    public void setPlantime(String plantime) {
        this.plantime = plantime;
    }
    public String getPlantime() {
        return plantime;
    }

    public String getFzrIds() {
        return fzrIds;
    }

    public void setFzrIds(String fzrIds) {
        this.fzrIds = fzrIds;
    }

    public String getFzrNames() {
        return fzrNames;
    }

    public void setFzrNames(String fzrNames) {
        this.fzrNames = fzrNames;
    }

    public String getCsrIds() {
        return csrIds;
    }

    public void setCsrIds(String csrIds) {
        this.csrIds = csrIds;
    }

    public String getCsrNames() {
        return csrNames;
    }

    public void setCsrNames(String csrNames) {
        this.csrNames = csrNames;
    }

    public Boolean getAllowModify() {
        return allowModify;
    }

    public void setAllowModify(Boolean allowModify) {
        this.allowModify = allowModify;
    }

    public String getAreaShow() {
        return areaShow;
    }

    public void setAreaShow(String areaShow) {
        this.areaShow = areaShow;
    }
}