package com.njcn.process.pojo.vo.gw;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.njcn.db.bo.BaseEntity;
import com.njcn.process.pojo.po.SupvPlanRel;
import lombok.Getter;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * @author wr
 * @description
 * @date 2023/9/6 9:33
 */
@Getter
public class PlanVO extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @TableId
    private String planId;

    @TableField(exist = false)
    private String provinceId;

    @TableField(exist = false)
    private String provinceName;

    @TableField(exist = false)
    private String cityId;

    @TableField(exist = false)
    private String cityName;

    @TableField(exist = false)
    private String countyId;

    @TableField(exist = false)
    private String countyName;

    /**
     * 计划名称
     */
    private String workPlanName;

    /**
     * 监督类型
     */
    private String supvType;

    /**
     * 监督阶段
     */
    private String supvStage;

    /**
     * 监督单位
     */
    private String supvOrgId;

    /**
     * 监督单位
     */
    @TableField(exist = false)
    private String supvOrgName;

    /**
     * 计划监督时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate planSupvDate;

    /**
     * 计划编制人id
     */
    private String planUserId;

    @TableField(exist = false)
    private String planUserName;

    /**
     * 计划编制单位id
     */
    private String planOrgId;

    @TableField(exist = false)
    private String planOrgName;

    /**
     * 备注
     */
    private String otherRemark;

    /**
     * 计划执行开始时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private LocalDateTime effectStartTime;

    /**
     * 计划执行结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private LocalDateTime effectEndTime;


    /**
     * 实施状态
     */
    private String effectStatus;

    /**
     * 监督对象名称
     */

    private String supvObjName;

    @TableField(exist = false)
    private String supvObjId;

    /**
     * 对象类型
     */
    private String supvObjType;

    /**
     * 对象电压等级
     */
    private String objVoltageLevel;

    @TableField(exist = false)
    private String objVoltageLevelName;

    /**
     * 关联电站
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String substationName;


    /**
     * 关联电站电压等级
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String substationVoltageLevel;

    /**
     * 关联电站电压等级名称
     */
    @TableField(exist = false)
    private String substationVoltageLevelName;


    /**
     * 监督对象属性
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String objType;

    /**
     * 监督对象属性名称
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String objTypeName;

    /**
     * 监督对象协议容量(MVA)
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private Double objCapacity;


    /**
     * 报告出具时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private LocalDateTime reportIssueTime;

    /**
     * 电能质量问题发生时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private LocalDateTime problemOcTime;









    /**
     * 0.未上送 1.上送 2.取消上送
     */
    private Integer isUploadHead;

    /**
     * 删除标识	0否1是
     */
    private String deleteFlag = "0";
    /**
     * 计划状态	1新建2变更 3取消
     */
    private String planStatus;
    /**
     * 删除时间
     */
    private LocalDateTime deleteTime;
    /**
     * 实施人id
     */
    private String effectUserId;
    /**
     * 实施人姓名
     */
    private String effectUserName;


    /**
     * 计划来源
     */
    private String dataSource = "01";


    @TableField(exist = false)
    private List<SupvPlanRel> planRel;


    public void setDataSource(String dataSource) {
        this.dataSource = dataSource;
    }

    public void setPlanRel(List<SupvPlanRel> planRel) {
        this.planRel = planRel;
    }

    public void setPlanId(String planId) {
        if (StrUtil.isNotBlank(planId)) {
            this.planId = planId;
        } else {
            this.planId = null;
        }

    }

    public void setProvinceId(String provinceId) {
        if (StrUtil.isNotBlank(provinceId)) {
            this.provinceId = provinceId;
        } else {
            this.provinceId = null;
        }
    }

    public void setProvinceName(String provinceName) {
        if (StrUtil.isNotBlank(provinceName)) {
            this.provinceName = provinceName;
        } else {
            this.provinceName = null;
        }
    }

    public void setCityId(String cityId) {
        if (StrUtil.isNotBlank(cityId)) {
            this.cityId = cityId;
        } else {
            this.cityId = null;
        }

    }

    public void setCityName(String cityName) {
        if (StrUtil.isNotBlank(cityName)) {
            this.cityName = cityName;
        } else {
            this.cityName = null;
        }
    }

    public void setCountyId(String countyId) {
        if (StrUtil.isNotBlank(countyId)) {
            this.countyId = countyId;
        } else {
            this.countyId = null;
        }
    }

    public void setCountyName(String countyName) {
        if (StrUtil.isNotBlank(countyName)) {
            this.countyName = countyName;
        } else {
            this.countyName = null;
        }
    }

    public void setWorkPlanName(String workPlanName) {
        if (StrUtil.isNotBlank(workPlanName)) {
            this.workPlanName = workPlanName;
        } else {
            this.workPlanName = null;
        }
    }

    public void setSupvType(String supvType) {
        if (StrUtil.isNotBlank(supvType)) {
            this.supvType = supvType;
        } else {
            this.supvType = null;
        }
    }

    public void setSupvStage(String supvStage) {
        if (StrUtil.isNotBlank(supvStage)) {
            this.supvStage = supvStage;
        } else {
            this.supvStage = null;
        }
    }

    public void setSupvOrgId(String supvOrgId) {
        if (StrUtil.isNotBlank(supvOrgId)) {
            this.supvOrgId = supvOrgId;
        } else {
            this.supvOrgId = null;
        }
    }

    public void setSupvOrgName(String supvOrgName) {
        if (StrUtil.isNotBlank(supvOrgName)) {
            this.supvOrgName = supvOrgName;
        } else {
            this.supvOrgName = null;
        }
    }

    public void setPlanSupvDate(LocalDate planSupvDate) {
        this.planSupvDate = planSupvDate;
    }

    public void setPlanUserId(String planUserId) {
        if (StrUtil.isNotBlank(planUserId)) {
            this.planUserId = planUserId;
        } else {
            this.planUserId = null;
        }
    }

    public void setPlanUserName(String planUserName) {
        if (StrUtil.isNotBlank(planUserName)) {
            this.planUserName = planUserName;
        } else {
            this.planUserName = null;
        }
    }

    public void setPlanOrgId(String planOrgId) {
        if (StrUtil.isNotBlank(planOrgId)) {
            this.planOrgId = planOrgId;
        } else {
            this.planOrgId = null;
        }
    }

    public void setPlanOrgName(String planOrgName) {
        if (StrUtil.isNotBlank(planOrgName)) {
            this.planOrgName = planOrgName;
        } else {
            this.planOrgName = null;
        }
    }

    public void setOtherRemark(String otherRemark) {
        if (StrUtil.isNotBlank(otherRemark)) {
            this.otherRemark = otherRemark;
        } else {
            this.otherRemark = null;
        }
    }

    public void setEffectStartTime(LocalDateTime effectStartTime) {
        this.effectStartTime = effectStartTime;

    }

    public void setEffectEndTime(LocalDateTime effectEndTime) {
        this.effectEndTime = effectEndTime;

    }

    public void setEffectStatus(String effectStatus) {
        if (StrUtil.isNotBlank(effectStatus)) {
            this.effectStatus = effectStatus;
        } else {
            this.effectStatus = null;
        }
    }

    public void setSupvObjName(String supvObjName) {
        if (StrUtil.isNotBlank(supvObjName)) {
            this.supvObjName = supvObjName;
        } else {
            this.supvObjName = null;
        }
    }

    public void setSupvObjId(String supvObjId) {
        if (StrUtil.isNotBlank(supvObjId)) {
            this.supvObjId = supvObjId;
        } else {
            this.supvObjId = null;
        }
    }

    public void setSupvObjType(String supvObjType) {
        if (StrUtil.isNotBlank(supvObjType)) {
            this.supvObjType = supvObjType;
        } else {
            this.supvObjType = null;
        }
    }

    public void setObjVoltageLevel(String objVoltageLevel) {
        if (StrUtil.isNotBlank(objVoltageLevel)) {
            this.objVoltageLevel = objVoltageLevel;
        } else {
            this.objVoltageLevel = null;
        }
    }

    public void setObjVoltageLevelName(String objVoltageLevelName) {
        if (StrUtil.isNotBlank(objVoltageLevelName)) {
            this.objVoltageLevelName = objVoltageLevelName;
        } else {
            this.objVoltageLevelName = null;
        }
    }

    public void setSubstationName(String substationName) {
        if (StrUtil.isNotBlank(substationName)) {
            this.substationName = substationName;
        } else {
            this.substationName = null;
        }
    }

    public void setSubstationVoltageLevel(String substationVoltageLevel) {
        if (StrUtil.isNotBlank(substationVoltageLevel)) {
            this.substationVoltageLevel = substationVoltageLevel;
        } else {
            this.substationVoltageLevel = null;
        }
    }

    public void setSubstationVoltageLevelName(String substationVoltageLevelName) {
        if (StrUtil.isNotBlank(substationVoltageLevelName)) {
            this.substationVoltageLevelName = substationVoltageLevelName;
        } else {
            this.substationVoltageLevelName = null;
        }
    }

    public void setObjType(String objType) {
        if (StrUtil.isNotBlank(objType)) {
            this.objType = objType;
        } else {
            this.objType = null;
        }
    }

    public void setObjTypeName(String objTypeName) {
        if (StrUtil.isNotBlank(objTypeName)) {
            this.objTypeName = objTypeName;
        } else {
            this.objTypeName = null;
        }
    }

    public void setObjCapacity(Double objCapacity) {
        if (ObjectUtil.isNotNull(objCapacity)) {
            this.objCapacity = objCapacity;
        } else {
            this.objCapacity = null;
        }
    }

    public void setReportIssueTime(LocalDateTime reportIssueTime) {
        this.reportIssueTime = reportIssueTime;
    }

    public void setProblemOcTime(LocalDateTime problemOcTime) {
        this.problemOcTime = problemOcTime;
    }

    public void setIsUploadHead(Integer isUploadHead) {
        this.isUploadHead = isUploadHead;
    }

    public void setDeleteFlag(String deleteFlag) {
        if (StrUtil.isNotBlank(deleteFlag)) {
            this.deleteFlag = deleteFlag;
        } else {
            this.deleteFlag = null;
        }
    }

    public void setPlanStatus(String planStatus) {
        if (StrUtil.isNotBlank(planStatus)) {
            this.planStatus = planStatus;
        } else {
            this.planStatus = null;
        }
    }

    public void setDeleteTime(LocalDateTime deleteTime) {
        this.deleteTime = deleteTime;
    }

    public void setEffectUserId(String effectUserId) {
        if (StrUtil.isNotBlank(effectUserId)) {
            this.effectUserId = effectUserId;
        } else {
            this.effectUserId = null;
        }
    }

    public void setEffectUserName(String effectUserName) {
        if (StrUtil.isNotBlank(effectUserName)) {
            this.effectUserName = effectUserName;
        } else {
            this.effectUserName = null;
        }
    }
}
