package com.ruoyi.system.domain.task;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("task")
public class TaskEntity extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id")
    @Excel(name = "任务序号", type = Excel.Type.EXPORT, cellType = Excel.ColumnType.NUMERIC, prompt = "任务编号")
    private Long id;
    @Excel(name = "任务名称",type = Excel.Type.ALL)
    private String taskName; // 任务名称
    @Excel(name = "任务描述",type = Excel.Type.ALL)
    private String taskDescription; // 任务描述
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "任务创建时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss" ,type = Excel.Type.EXPORT)
    private LocalDateTime createTime; // 任务创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "任务完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss" ,type = Excel.Type.EXPORT)
    private LocalDateTime endTime; // 任务完成时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "任务修改时间，分派时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss" ,type = Excel.Type.EXPORT)
    private LocalDateTime updateTime; // 任务修改时间，分派时间
    @Excel(name = "项目周期" ,width = 40,type = Excel.Type.ALL)
    private String projectCycle; // 项目周期
    private Long createId; // 创建人id
    @Excel(name = "创建人姓名" ,type = Excel.Type.EXPORT)
    private String createName; // 创建人姓名
    @Excel(name = "所需人数" ,type = Excel.Type.ALL)
    private Long number; // 所需人数
    @Excel(name = "已招募人数",type = Excel.Type.EXPORT)
    private Long recruitedNumber; // 已招券人数
    private Long status; // 任务状态:0，库存中;1，已出库;2，已完成
    @Excel(name = "任务状态:0，库存中;1，已出库;2，已完成",type = Excel.Type.EXPORT)
    private String statusName;
    @Excel(name = "推送任务显示图",type = Excel.Type.EXPORT)
    private String image; // 推送任务显示图
    @Excel(name = "任务要求(pdf,文件格式)",type = Excel.Type.EXPORT)
    private String pdfFile; // 任务要求(pdf,文件格式)
    @Excel(name = "任务单价（元/条）",type = Excel.Type.ALL)
    private Double taskRate; // 任务单价（元/条）
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "报名反馈", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss",type = Excel.Type.EXPORT)
    private LocalDateTime feedBack; // 报名反馈
    @Excel(name = "工会二维码",type = Excel.Type.EXPORT)
    private String code; // 工会二维码
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "报名截止时间(注意数据格式：例，2024-01-01 00:00:00)", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss",type = Excel.Type.ALL)
    private LocalDateTime applicationDeadline; // 报名截止时间
    @Excel(name = "任务总量",type = Excel.Type.ALL)
    private Long totalWorkload; // 任务总量
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "任务开始时间(注意数据格式：例，2024-01-01 00:00:00)", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss",type = Excel.Type.ALL)
    private LocalDateTime beginTime;//任务开始时间

    // 重写 setCreateTime 方法，使其返回类型为 void
    @Override
    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }
    @Override
    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

}
