package com.zg.project.information.domain;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zg.framework.aspectj.lang.annotation.Excel;
import com.zg.framework.web.domain.BaseEntity;

/**
 * 设备信息对象 device_info
 *
 * ✅ 大小仓模型：
 * - device_info 只落库：warehouse_code（小仓编码）
 * - parentWarehouseCode / parentWarehouseName 仅联查展示 & 查询过滤，不落库
 *
 * @author zg
 * @date 2025-04-14
 */
public class DeviceInfo extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /** 设备ID */
    private Long deviceId;

    /** 设备IP地址 */
    @Excel(name = "设备IP地址")
    private String ipAddress;

    /** 设备端口 */
    @Excel(name = "设备端口")
    private Long port;

    /** ✅ 所属小仓编码（落库字段） */
    private String warehouseCode;

    /** 所属场景编码（落库字段） */
    private String sceneId;

    /** ======= 非数据库字段 ======= */

    /** ✅ 所属大仓编码（仅查询过滤/展示，不落库） */
    private String parentWarehouseCode;

    /** 大仓名称（联查字段） */
    @Excel(name = "大仓名称")
    private String parentWarehouseName;

    /** 小仓名称（联查字段） */
    @Excel(name = "小仓名称")
    private String warehouseName;

    /** 场景名称（联查字段） */
    @Excel(name = "场景名称")
    private String sceneName;

    /** 是否删除（0否 1是） */
    @Excel(name = "是否删除", readConverterExp = "0=否,1=是")
    private String isDelete;

    // ===== Getter & Setter =====

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

    public String getIpAddress() { return ipAddress; }
    public void setIpAddress(String ipAddress) { this.ipAddress = ipAddress; }

    public Long getPort() { return port; }
    public void setPort(Long port) { this.port = port; }

    public String getWarehouseCode() { return warehouseCode; }
    public void setWarehouseCode(String warehouseCode) { this.warehouseCode = warehouseCode; }

    public String getSceneId() { return sceneId; }
    public void setSceneId(String sceneId) { this.sceneId = sceneId; }

    public String getParentWarehouseCode() { return parentWarehouseCode; }
    public void setParentWarehouseCode(String parentWarehouseCode) { this.parentWarehouseCode = parentWarehouseCode; }

    public String getParentWarehouseName() { return parentWarehouseName; }
    public void setParentWarehouseName(String parentWarehouseName) { this.parentWarehouseName = parentWarehouseName; }

    public String getWarehouseName() { return warehouseName; }
    public void setWarehouseName(String warehouseName) { this.warehouseName = warehouseName; }

    public String getSceneName() { return sceneName; }
    public void setSceneName(String sceneName) { this.sceneName = sceneName; }

    public String getIsDelete() { return isDelete; }
    public void setIsDelete(String isDelete) { this.isDelete = isDelete; }

    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("deviceId", getDeviceId())
                .append("ipAddress", getIpAddress())
                .append("port", getPort())
                .append("warehouseCode", getWarehouseCode())
                .append("parentWarehouseCode", getParentWarehouseCode())
                .append("parentWarehouseName", getParentWarehouseName())
                .append("warehouseName", getWarehouseName())
                .append("sceneId", getSceneId())
                .append("sceneName", getSceneName())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("isDelete", getIsDelete())
                .toString();
    }
}
