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.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

@Setter
public class PatrolLinkagePos extends BaseEntity {
    private static final long serialVersionUID = 1L;
    private Long linkagePosId;
    @Excel(
            name = "设备id"
    )
    private Long deviceId;
    @Excel(
            name = "站序号"
    )
    private Long stationNo;
    @Excel(
            name = "监控索引号"
    )
    private Long monitorIndexNo;
    @Excel(
            name = "设备名称"
    )
    private String deviceName;
    @Excel(
            name = "联动信号"
    )
    private String linkageSignal;
    @Excel(
            name = "实物ID"
    )
    private Long phyAssetId;
    @Excel(
            name = "是否有效"
    )
    private String isEnable;
    private List<PatrolLinkageStrategy> patrolLinkageStrategies;
    private String deviceFullName;

    public String getDeviceFullName() {
        return this.monitorIndexNo + "_" + this.deviceName;
    }

    public boolean addPatrolLinkageStrategy(PatrolLinkageStrategy patrolLinkageStrategy) {
        if (this.patrolLinkageStrategies == null) {
            this.patrolLinkageStrategies = new ArrayList<>();
        }

        return this.patrolLinkageStrategies.add(patrolLinkageStrategy);
    }

    public List<PatrolLinkageStrategy> getPatrolLinkageStrategies() {
        return this.patrolLinkageStrategies;
    }

    public Long getLinkagePosId() {
        return this.linkagePosId;
    }

    public Long getDeviceId() {
        return this.deviceId;
    }

    public Long getStationNo() {
        return this.stationNo;
    }

    public Long getMonitorIndexNo() {
        return this.monitorIndexNo;
    }

    public String getDeviceName() {
        return this.deviceName;
    }

    public String getLinkageSignal() {
        return this.linkageSignal;
    }

    public Long getPhyAssetId() {
        return this.phyAssetId;
    }

    public String getIsEnable() {
        return this.isEnable;
    }

    @Override
    public String toString() {
        return "PatrolLinkagePos{" +
                "linkagePosId=" + linkagePosId +
                ", deviceId=" + deviceId +
                ", stationNo=" + stationNo +
                ", monitorIndexNo=" + monitorIndexNo +
                ", deviceName='" + deviceName + '\'' +
                ", linkageSignal='" + linkageSignal + '\'' +
                ", phyAssetId=" + phyAssetId +
                ", isEnable='" + isEnable + '\'' +
                ", patrolLinkageStrategies=" + patrolLinkageStrategies +
                ", deviceFullName='" + deviceFullName + '\'' +
                '}';
    }
}
