package cn.iocoder.yudao.module.pms.controller.admin.iotbom.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

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

@Schema(description = "管理后台 - PMS BOM 关系 Response VO")
@Data
@ExcelIgnoreUnannotated
public class IotBomRespVO {

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25349")
    @ExcelProperty("主键")
    private Long id;

    @Schema(description = "BOM名称", example = "李四")
    @ExcelProperty("BOM名称")
    private String name;

    @Schema(description = "BOM编码")
    @ExcelProperty("BOM编码")
    private String code;

    @Schema(description = "父BOM id 顶级为0", example = "3918")
    @ExcelProperty("父BOM id 顶级为0")
    private Long parentId;

    @Schema(description = "子节点id 逗号分隔")
    @ExcelProperty("子节点id 逗号分隔")
    private String childIds;

    @Schema(description = "层级")
    @ExcelProperty("层级")
    private Integer level;

    @Schema(description = "所属设备分类", example = "23419")
    @ExcelProperty("所属设备分类")
    private Long deviceCategoryId;

    @Schema(description = "显示顺序")
    @ExcelProperty("显示顺序")
    private Integer sort;

    @Schema(description = "1维修 2保养 维修+保养", example = "1,2")
    @ExcelProperty("1维修 2保养 维修+保养")
    private List<Integer> type;

    @Schema(description = "状态 0启用  1停用", example = "1")
    @ExcelProperty("状态 0启用  1停用")
    private Integer status;

    @Schema(description = "是否叶子节点 0是 1否")
    @ExcelProperty("是否叶子节点 0是 1否")
    private Integer leafFlag;

    @Schema(description = "备注", example = "随便")
    @ExcelProperty("备注")
    private String remark;

    @Schema(description = "版本")
    @ExcelProperty("版本")
    private Integer version;

    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    /**
     * 设备关联字段
     */
    @Schema(description = "设备名称")
    private String deviceName;
    @Schema(description = "设备编码")
    private String deviceCode;
    @Schema(description = "设备状态")
    private String deviceStatus;
    @Schema(description = "资产性质")
    private String assetProperty;

    /**
     * 扩展字段
     */
    @Schema(description = "已经绑定的物料数量")
    private Integer materials;

    @Schema(description = "所属设备分类名称", example = "空压机")
    @ExcelProperty("所属设备分类")
    private String deviceCategoryName;

    @Schema(description = "子BOM列表 递归树层级")
    private List<IotBomRespVO> children;
}