package com.gyee.alarm.model.vo;

import com.gyee.alarm.model.auto.ProEconEarlyReportWt;

import lombok.AccessLevel;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.util.Date;

/**
 * @description:
 * @auther: Wanghs
 * @date: 2022-09-09
 */
@Data
@Accessors(chain = true)
public class InspectOrderDto implements Serializable {

    private String id;
    //风机编号
    private String windturbineId;
    //风场id
    private String windpowerStationId;
    //诊断报告风机表 id
    private String reportWindturbineId;
    //评审人
    private String verifyUser;
    //评审时间
    private Date verifyTime;
    //评审结论
    private String verifyView;
    //评审结果 0-不巡检 1-巡检
    private boolean verifyResult;
    // 创建计划人
    private String createPlanUser;
    //创建计划时间
    private Date createPlanTime;
    //计划开始时间
    private Date planStartTime;
    //计划结束时间
    private Date planEndTime;
    //巡检人
    private String inspectUser;
    //巡检时间
    private Date inspectTime;
    //巡检结论
    private String inspectView;
    //巡检结果是否符合报告结论
    private boolean accordreport;
    //0-未关闭  1-已关闭
    private boolean closed;
    //是否已审核
    private boolean earlyReport;

    private ProEconEarlyReportWt earlyReportWindturbine;


    @Getter(AccessLevel.NONE)
    @Setter(AccessLevel.NONE)
    private String step;

    public InspectOrderDto setStep(String step) {
        this.step = step;
        return this;
    }
    public String getStep() {
        if (earlyReport) {
            step = "待审核";
        } else {
            if (inspectTime != null && createPlanTime != null && verifyTime != null) {
                step = "已巡检";
            } else if (inspectTime == null && createPlanTime != null && verifyTime != null) {
                step = "已计划，待巡检";

            } else if (inspectTime == null && createPlanTime == null && verifyTime != null && verifyResult == true) {
                step = "已评审，未计划";
            } else if (inspectTime == null && createPlanTime == null && verifyTime != null && verifyResult == false) {
                step = "已评审，不巡检";
            } else {
                return "";
            }
        }
        return step;
    }


}
