package com.inspect.patrol.domain;

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

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

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

@Setter
@Getter
public class PatrolDevice extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private String deviceId;
    private String linkagePosId;
    @Excel(
            name = "设备编号"
    )
    private String deviceCode;
    @Excel(
            name = "设备名称"
    )
    private String deviceName;
    @Excel(
            name = "生产厂家"
    )
    private String manufacturer;
    @Excel(
            name = "父设备id"
    )
    private Long parentId;
    @Excel(
            name = "祖级列表"
    )
    private String ancestors;
    @Excel(
            name = "区域id"
    )
    private String areaId;
    @Excel(
            name = "区域名称"
    )
    private String areaName;
    @Excel(
            name = "设备类型ID"
    )
    private String deviceTypeId;
    @Excel(
            name = "设备类型名称"
    )
    private String deviceTypeName;
    @Excel(
            name = "电力主设备标识-Yes:是；No：否"
    )
    private String powerMainEquFlag;
    @Excel(
            name = "设备型号"
    )
    private String deviceModel;
    @Excel(
            name = "实物ID"
    )
    private String phyAssetId;
    @Excel(
            name = "场站编号",
            readConverterExp = "当=前实际站号编址"
    )
    private String stationNo;
    @Excel(
            name = "监控索引号：监控系统测点 ID，可用于数据的唯一标识"
    )
    private String monitorIndexNo;
    @Excel(
            name = "相数,0:无相；1：单项；3：三项"
    )
    private String phaseNum;
    @Excel(
            name = "相别，1: = A相 2: = B相 3: = C相，多个相位，采用“,”分隔"
    )
    private String phase;
    @Excel(
            name = "设备类型状态",
            readConverterExp = "0=正常,1=停用"
    )
    private String status;
    @Excel(
            name = "设备X坐标"
    )
    private String positionX;
    @Excel(
            name = "设备Y坐标"
    )
    private String positionY;
    @Excel(
            name = "设备Z坐标"
    )
    private String positionZ;
    @Excel(
            name = "设备长度"
    )
    private String deviceLength;
    @Excel(
            name = "设备宽度"
    )
    private String deviceWidth;
    @Excel(
            name = "设备高度"
    )
    private String deviceHigh;
    private String delFlag;
    private String channelId;
    private String presetCode;
    private String eqpBookId;
    private String channelCode;
    private String patrolDeviceCode;
    private List<PatrolPresetPos> patrolPresetPoses;

    public void addPatrolPresetPos(PatrolPresetPos patrolPresetPos) {
        if (patrolPresetPos == null) {
            this.patrolPresetPoses = new ArrayList<>();
        }

        this.patrolPresetPoses.add(patrolPresetPos);
    }

    @Override
    public String toString() {
        return "PatrolDevice{" +
                "deviceId='" + deviceId + '\'' +
                ", linkagePosId='" + linkagePosId + '\'' +
                ", deviceCode='" + deviceCode + '\'' +
                ", deviceName='" + deviceName + '\'' +
                ", manufacturer='" + manufacturer + '\'' +
                ", parentId=" + parentId +
                ", ancestors='" + ancestors + '\'' +
                ", areaId='" + areaId + '\'' +
                ", areaName='" + areaName + '\'' +
                ", deviceTypeId='" + deviceTypeId + '\'' +
                ", deviceTypeName='" + deviceTypeName + '\'' +
                ", powerMainEquFlag='" + powerMainEquFlag + '\'' +
                ", deviceModel='" + deviceModel + '\'' +
                ", phyAssetId='" + phyAssetId + '\'' +
                ", stationNo='" + stationNo + '\'' +
                ", monitorIndexNo='" + monitorIndexNo + '\'' +
                ", phaseNum='" + phaseNum + '\'' +
                ", phase='" + phase + '\'' +
                ", status='" + status + '\'' +
                ", positionX='" + positionX + '\'' +
                ", positionY='" + positionY + '\'' +
                ", positionZ='" + positionZ + '\'' +
                ", deviceLength='" + deviceLength + '\'' +
                ", deviceWidth='" + deviceWidth + '\'' +
                ", deviceHigh='" + deviceHigh + '\'' +
                ", delFlag='" + delFlag + '\'' +
                ", channelId='" + channelId + '\'' +
                ", presetCode='" + presetCode + '\'' +
                ", eqpBookId='" + eqpBookId + '\'' +
                ", channelCode='" + channelCode + '\'' +
                ", patrolDeviceCode='" + patrolDeviceCode + '\'' +
                ", patrolPresetPoses=" + patrolPresetPoses +
                '}';
    }
}
