package com.willalp.yiqing.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.willalp.common.annotation.Excel;
import com.willalp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * 疫情防控-任务排班对象 hs_yiqing_task
 *
 * @author willalp
 * @date 2022-04-02
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("hs_yiqing_task")
public class HsYiqingTask extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId
    private String yqTaskId;

    /**
     * 任务编号
     */
    @Excel(name = "任务编号")
    private String taskNo;

    /**
     * 机构编号
     */
    @Excel(name = "机构编号")
    private String orgNo;

    /**
     * 任务发布人
     */
    @Excel(name = "任务发布人")
    private String swpw;

    /**
     * 任务标题
     */
    @Excel(name = "任务标题")
    private String taskTitle;

    /**
     * 排班规则ID
     */
    @Excel(name = "排班规则ID")
    private String ruleId;

    /**
     * 任务地点
     */
    @Excel(name = "任务地点")
    private String taskAddress;

    /**
     * 计划应开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "计划应开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date planStartTime;

    /**
     * 计划应结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "计划应结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date planEndTime;

    /**
     * 实际开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "实际开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date actualStartTime;

    /**
     * 实际结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Excel(name = "实际结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date actualEndTime;

    /**
     * 主要负责人
     */
    @TableField(updateStrategy = FieldStrategy.NEVER)
    @Excel(name = "主要负责人")
    private String belongMain;

    /**
     * 执行人
     */
    @Excel(name = "执行人")
    private String executor;

    /**
     * 二级负责人集合
     */
    @TableField(exist = false)
    private List<String> belongMinors = new ArrayList<>();

    /**
     * 执行人集合
     */
    @TableField(exist = false)
    private List<String> executors = new ArrayList<>();

    /**
     * 任务状态（0：未启动 1：进行中 3：暂停 4：已结束 5：异常）
     */
    @Excel(name = "任务状态", readConverterExp = "0=：未启动,1=：进行中,3=：暂停,4=：已结束,5=：异常")
    private Integer taskStatus;


    /**
     * 备注
     */
    private String remark;

    /**
     * 是否删除（0.未删除；1.已删除）
     */
    @Excel(name = "是否删除", readConverterExp = "0=.未删除；1.已删除")
    @TableLogic
    private Integer isDelete;



    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("yqTaskId", getYqTaskId())
                .append("taskNo", getTaskNo())
                .append("swpw", getSwpw())
                .append("taskTitle", getTaskTitle())
                .append("ruleId", getRuleId())
                .append("taskAddress", getTaskAddress())
                .append("planStartTime", getPlanStartTime())
                .append("planEndTime", getPlanEndTime())
                .append("belongMain", getBelongMain())
                .append("executor", getExecutor())
                .append("taskStatus", getTaskStatus())
                .append("isDelete", getIsDelete())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}
