package com.inspect.job.domain.task;

import com.inspect.base.core.annotation.Excel;
import com.inspect.base.core.web.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;
import java.util.List;
import java.util.Objects;

import lombok.*;


@Setter
@Getter
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class PatrolTask extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private Long taskId;
    @Excel(
            name = "变电站名称"
    )
    private String stationName;
    @Excel(
            name = "变电站编码"
    )
    private String stationCode;
    @Excel(
            name = "巡视类型"
    )
    private String type;
    @Excel(
            name = "任务编码"
    )
    private String taskCode;
    @Excel(
            name = "任务名称"
    )
    private String taskName;
    @Excel(
            name = "优先级"
    )
    private String priority;
    private String deviceLevel;
    private String deviceList;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date fixedStartTime;
    private String cycleMonth;
    private String cycleWeek;
    private String cycleExecuteTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date cycleStartTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date cycleEndTime;
    private int intervalNumber;
    private String intervalType;
    private String intervalExecuteTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date intervalStartTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date intervalEndTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date invalidStartTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    private Date invalidEndTime;
    private String isEnable;

    private String isenable;
    private String linkageState;
    private String devType;
    private String creator;
    private String executionStatus;
    private String fileStatus;
    private String taskCycle;
    private String devNo;
    private String storage;
    private String taskProgress;
    private String taskState;
    private String executionMode;
    private String beginTime;
    private String endTime;
    private String areaId;
    private String areaName;
    private List<PatrolTaskInfo> eqPointList;
    private List<PatrolTaskStatus> patrolTaskStatusList;
    private String specifiedAlg;

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        PatrolTask that = (PatrolTask) object;
        return intervalNumber == that.intervalNumber && Objects.equals(taskId, that.taskId) && Objects.equals(stationName, that.stationName) && Objects.equals(stationCode, that.stationCode) && Objects.equals(type, that.type) && Objects.equals(taskCode, that.taskCode) && Objects.equals(taskName, that.taskName) && Objects.equals(priority, that.priority) && Objects.equals(deviceLevel, that.deviceLevel) && Objects.equals(deviceList, that.deviceList) && Objects.equals(fixedStartTime, that.fixedStartTime) && Objects.equals(cycleMonth, that.cycleMonth) && Objects.equals(cycleWeek, that.cycleWeek) && Objects.equals(cycleExecuteTime, that.cycleExecuteTime) && Objects.equals(cycleStartTime, that.cycleStartTime) && Objects.equals(cycleEndTime, that.cycleEndTime) && Objects.equals(intervalType, that.intervalType) && Objects.equals(intervalExecuteTime, that.intervalExecuteTime) && Objects.equals(intervalStartTime, that.intervalStartTime) && Objects.equals(intervalEndTime, that.intervalEndTime) && Objects.equals(invalidStartTime, that.invalidStartTime) && Objects.equals(invalidEndTime, that.invalidEndTime) && Objects.equals(isEnable, that.isEnable) && Objects.equals(isenable, that.isenable) && Objects.equals(linkageState, that.linkageState) && Objects.equals(devType, that.devType) && Objects.equals(creator, that.creator) && Objects.equals(executionStatus, that.executionStatus) && Objects.equals(fileStatus, that.fileStatus) && Objects.equals(taskCycle, that.taskCycle) && Objects.equals(devNo, that.devNo) && Objects.equals(storage, that.storage) && Objects.equals(taskProgress, that.taskProgress) && Objects.equals(taskState, that.taskState) && Objects.equals(executionMode, that.executionMode) && Objects.equals(beginTime, that.beginTime) && Objects.equals(endTime, that.endTime) && Objects.equals(areaId, that.areaId) && Objects.equals(areaName, that.areaName) && Objects.equals(eqPointList, that.eqPointList) && Objects.equals(patrolTaskStatusList, that.patrolTaskStatusList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(taskId, stationName, stationCode, type, taskCode, taskName, priority, deviceLevel, deviceList, fixedStartTime, cycleMonth, cycleWeek, cycleExecuteTime, cycleStartTime, cycleEndTime, intervalNumber, intervalType, intervalExecuteTime, intervalStartTime, intervalEndTime, invalidStartTime, invalidEndTime, isEnable, isenable, linkageState, devType, creator, executionStatus, fileStatus, taskCycle, devNo, storage, taskProgress, taskState, executionMode, beginTime, endTime, areaId, areaName, eqPointList, patrolTaskStatusList);
    }

    public void setIsEnable(String isEnable) {
        this.isEnable = isEnable;
        this.isenable = isEnable;
    }

    public String getIsEnable() {
        return isEnable;
    }

    public void setIsenable(String isenable) {
        this.isenable = isenable;
        this.isEnable = isenable;
    }

    public String getIsenable() {
        return isenable;
    }

    @Override
    public String toString() {
        return "PatrolTask{" +
                "taskId=" + taskId +
                ", stationName='" + stationName + '\'' +
                ", stationCode='" + stationCode + '\'' +
                ", type='" + type + '\'' +
                ", taskCode='" + taskCode + '\'' +
                ", taskName='" + taskName + '\'' +
                ", priority='" + priority + '\'' +
                ", deviceLevel='" + deviceLevel + '\'' +
                ", deviceList='" + deviceList + '\'' +
                ", fixedStartTime=" + fixedStartTime +
                ", cycleMonth='" + cycleMonth + '\'' +
                ", cycleWeek='" + cycleWeek + '\'' +
                ", cycleExecuteTime='" + cycleExecuteTime + '\'' +
                ", cycleStartTime=" + cycleStartTime +
                ", cycleEndTime=" + cycleEndTime +
                ", intervalNumber=" + intervalNumber +
                ", intervalType='" + intervalType + '\'' +
                ", intervalExecuteTime='" + intervalExecuteTime + '\'' +
                ", intervalStartTime=" + intervalStartTime +
                ", intervalEndTime=" + intervalEndTime +
                ", invalidStartTime=" + invalidStartTime +
                ", invalidEndTime=" + invalidEndTime +
                ", isEnable='" + isEnable + '\'' +
                ", isenable='" + isenable + '\'' +
                ", linkageState='" + linkageState + '\'' +
                ", devType='" + devType + '\'' +
                ", creator='" + creator + '\'' +
                ", executionStatus='" + executionStatus + '\'' +
                ", fileStatus='" + fileStatus + '\'' +
                ", taskCycle='" + taskCycle + '\'' +
                ", devNo='" + devNo + '\'' +
                ", storage='" + storage + '\'' +
                ", taskProgress='" + taskProgress + '\'' +
                ", taskState='" + taskState + '\'' +
                ", executionMode='" + executionMode + '\'' +
                ", beginTime='" + beginTime + '\'' +
                ", endTime='" + endTime + '\'' +
                ", areaId='" + areaId + '\'' +
                ", areaName='" + areaName + '\'' +
                ", eqPointList=" + eqPointList +
                ", patrolTaskStatusList=" + patrolTaskStatusList +
                '}';
    }
}
