package com.dcs.dcs.domain.vo;

import com.dcs.common.annotation.Excel;
import com.dcs.dcs.domain.DcsEquipment;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

/**
 * SelectEquipmentVo
 *
 * @author: hmy
 * @date: 2025/3/8 16:03
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class DcsEquipmentFormVo extends DcsEquipment implements Cloneable {

    /** 流程归属 */
    @Excel(name = "流程归属")
    private String flowName;

    /** 设备值 */
    @Excel(name = "设备值")
    @ApiModelProperty(value = "设备值")
    private Object value;

    /** 子部门 */
    private List<DcsEquipmentFormVo> children = new ArrayList<>();

    public DcsEquipmentFormVo() {
    }

    @Override
    public DcsEquipmentFormVo clone() {
        try {
            DcsEquipmentFormVo clone = (DcsEquipmentFormVo) super.clone();
            // 确保 children 是一个新的 List，而不是原对象的引用
            clone.children = new ArrayList<>(this.children.size());
            return clone;
        } catch (CloneNotSupportedException e) {
            throw new RuntimeException(e);
        }
    }

    @Override
    public void setChildren(List<?> children) {
        super.setChildren(children);
    }
}
