package com.inspect.insreport.domain;

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

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

import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

@Setter
@Getter
public class InspectionReport extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private Long lineId;
    @Excel(
            name = "变电站名称"
    )
    private String stationName;
    @Excel(
            name = "电压等级：330kV、500kV、750kV、1000kV"
    )
    private String voltLevel;
    @Excel(
            name = "变电站类型 ：AIS站、GIS站、HGIS站"
    )
    private String stationType;
    @JsonFormat(
            pattern = "yyyy-MM-dd"
    )
    @Excel(
            name = "巡视计划创建日期",
            width = 30.0D,
            dateFormat = "yyyy-MM-dd"
    )
    private Date inspectionDate;
    @Excel(
            name = "巡视任务名称"
    )
    private String inspectionTaskName;
    @Excel(
            name = "环境信息 ：包括当日气温",
            readConverterExp = "℃="
    )
    private String envInfo;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @Excel(
            name = "巡视开始时间",
            width = 30.0D,
            dateFormat = "yyyy-MM-dd HH:mm:ss"
    )
    private Date inspectionStartTime;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @Excel(
            name = "巡视结束时间",
            width = 30.0D,
            dateFormat = "yyyy-MM-dd HH:mm:ss"
    )
    private Date inspectionEndTime;
    @Excel(
            name = "巡视统计"
    )
    private String patrolStatistics;
    @Excel(
            name = "审核人"
    )
    private String checkPerson;
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss"
    )
    @Excel(
            name = "审核时间",
            width = 30.0D,
            dateFormat = "yyyy-MM-dd HH:mm:ss"
    )
    private Date checkTime;
    @Excel(
            name = "巡视结论"
    )
    private String description;
    private String filePath;
    private String taskId;
    private String taskResultId;
    private String areaName;
    private String areaType;
    private String deviceType;
    private String type;
    private Date cycleStartTime;
    private Date cycleEndTime;
    private String taskPatrolledId;
    private String filter;
    List<InspectionReportData> ReportDatalist;
    private List<InspectionReportData> info;

    private Map<String, List<Map<String, List<InspectionReportData>>>> detail;

    public InspectionReport(String taskResultId) {
        this.taskResultId = taskResultId;
    }

    public InspectionReport() {
    }

    @Override
    public boolean equals(Object object) {
        if (this == object) return true;
        if (object == null || getClass() != object.getClass()) return false;
        InspectionReport that = (InspectionReport) object;
        return Objects.equals(lineId, that.lineId) && Objects.equals(stationName, that.stationName) && Objects.equals(voltLevel, that.voltLevel) && Objects.equals(stationType, that.stationType) && Objects.equals(inspectionDate, that.inspectionDate) && Objects.equals(inspectionTaskName, that.inspectionTaskName) && Objects.equals(envInfo, that.envInfo) && Objects.equals(inspectionStartTime, that.inspectionStartTime) && Objects.equals(inspectionEndTime, that.inspectionEndTime) && Objects.equals(patrolStatistics, that.patrolStatistics) && Objects.equals(checkPerson, that.checkPerson) && Objects.equals(checkTime, that.checkTime) && Objects.equals(description, that.description) && Objects.equals(filePath, that.filePath) && Objects.equals(taskId, that.taskId) && Objects.equals(taskResultId, that.taskResultId) && Objects.equals(areaName, that.areaName) && Objects.equals(areaType, that.areaType) && Objects.equals(deviceType, that.deviceType) && Objects.equals(type, that.type) && Objects.equals(cycleStartTime, that.cycleStartTime) && Objects.equals(cycleEndTime, that.cycleEndTime) && Objects.equals(taskPatrolledId, that.taskPatrolledId) && Objects.equals(ReportDatalist, that.ReportDatalist) && Objects.equals(info, that.info);
    }

    @Override
    public int hashCode() {
        return Objects.hash(lineId, stationName, voltLevel, stationType, inspectionDate, inspectionTaskName, envInfo, inspectionStartTime, inspectionEndTime, patrolStatistics, checkPerson, checkTime, description, filePath, taskId, taskResultId, areaName, areaType, deviceType, type, cycleStartTime, cycleEndTime, taskPatrolledId, ReportDatalist, info);
    }

    @Override
    public String toString() {
        return "InspectionReport{" +
                "lineId=" + lineId +
                ", stationName='" + stationName + '\'' +
                ", voltLevel='" + voltLevel + '\'' +
                ", stationType='" + stationType + '\'' +
                ", inspectionDate=" + inspectionDate +
                ", inspectionTaskName='" + inspectionTaskName + '\'' +
                ", envInfo='" + envInfo + '\'' +
                ", inspectionStartTime=" + inspectionStartTime +
                ", inspectionEndTime=" + inspectionEndTime +
                ", patrolStatistics='" + patrolStatistics + '\'' +
                ", checkPerson='" + checkPerson + '\'' +
                ", checkTime=" + checkTime +
                ", description='" + description + '\'' +
                ", filePath='" + filePath + '\'' +
                ", taskId='" + taskId + '\'' +
                ", taskResultId='" + taskResultId + '\'' +
                ", areaName='" + areaName + '\'' +
                ", areaType='" + areaType + '\'' +
                ", deviceType='" + deviceType + '\'' +
                ", type='" + type + '\'' +
                ", cycleStartTime=" + cycleStartTime +
                ", cycleEndTime=" + cycleEndTime +
                ", taskPatrolledId='" + taskPatrolledId + '\'' +
                ", ReportDatalist=" + ReportDatalist +
                ", info=" + info +
                '}';
    }
}
