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

import cn.iocoder.yudao.module.pms.controller.admin.iotdevicerunlog.vo.IotDeviceRunLogRespVO;
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.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Schema(description = "管理后台 - PMS 保养计划明细BOM Response VO")
@Data
@ExcelIgnoreUnannotated
public class IotMaintenanceBomRespVO {

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

    @Schema(description = "保养计划id", example = "11371")
    private Long planId;

    @Schema(description = "保养计划名称", example = "连油主车鲁EA5535")
    @ExcelProperty("保养计划名称")
    private String planName;

    @Schema(description = "保养计划编号")
    @ExcelProperty("保养计划编号")
    private String serialNumber;

    @Schema(description = "保养计划负责人")
    @ExcelProperty("保养计划负责人")
    private String responsiblePersonName;

    @Schema(description = "保养计划明细id", example = "17738")
    private Long planDetailId;

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

    @Schema(description = "设备id", example = "19729")
    private Long deviceId;

    @Schema(description = "设备名称")
    @ExcelProperty("设备名称")
    private String deviceName;

    @Schema(description = "设备编码")
    @ExcelProperty("设备编码")
    private String deviceCode;

    @Schema(description = "BOM名称", example = "张三")
    @ExcelProperty("保养项名称")
    private String name;

    @Schema(description = "保养规则(量程 运行时间 自然日期) 可多选")
    private String rule;

    @Schema(description = "保养规则-里程(0启用 1停用)", example = "2")
    private Integer mileageRule;
    @Schema(description = "保养规则-自然日期(0启用 1停用)", example = "2")
    private Integer naturalDateRule;
    @Schema(description = "保养规则-运行时间(0启用 1停用)", example = "2")
    private Integer runningTimeRule;

    @Schema(description = "保养规则-里程(0启用 1停用)", example = "2")
    @ExcelProperty("运行里程规则")
    private String mileageRuleName;
    @Schema(description = "保养规则-自然日期(0启用 1停用)", example = "2")
    @ExcelProperty("自然日期规则")
    private String naturalDateRuleName;
    @Schema(description = "保养规则-运行时间(0启用 1停用)", example = "2")
    @ExcelProperty("运行时间规则")
    private String runningTimeRuleName;

    @Schema(description = "累计运行公里数", example = "20238km")
    @ExcelProperty("累计运行公里数(KM)")
    private BigDecimal totalMileage;

    @Schema(description = "上次保养时间")
    @ExcelProperty("上次保养时间")
    private String lastMaintenanceDateStr;

    @Schema(description = "上次保养运行时长(小时)")
    @ExcelProperty("上次保养时长(H)")
    private BigDecimal lastRunningTime;

    @Schema(description = "运行时间周期(小时)")
    @ExcelProperty("运行时间周期(H)")
    private BigDecimal nextRunningTime;

    @Schema(description = "下次保养时长(小时)")
    @ExcelProperty("下次保养时长(H)")
    private BigDecimal nextMaintenanceTime;

    @Schema(description = "剩余时长(小时)")
    @ExcelProperty("剩余时长(H)")
    private BigDecimal remainMaintenanceTime;

    @Schema(description = "运行时长周期提前量 H")
    @ExcelProperty("时间周期提前量(H)")
    private BigDecimal timePeriodLead;

    @Schema(description = "上次保养运行公里数(千米)")
    @ExcelProperty("上次保养里程数(KM)")
    private BigDecimal lastRunningKilometers;

    @Schema(description = "下次保养运行公里数(千米)")
    @ExcelProperty("运行里程周期(KM)")
    private BigDecimal nextRunningKilometers;

    @Schema(description = "下次保养公里数(KM)")
    @ExcelProperty("下次保养公里数(KM)")
    private BigDecimal nextMaintenanceKilo;

    @Schema(description = "剩余公里数(KM)")
    @ExcelProperty("剩余公里数(KM)")
    private BigDecimal remainMaintenanceKilo;

    @Schema(description = "公里数周期-提前量 km")
    @ExcelProperty("里程周期提前量(KM)")
    private BigDecimal kiloCycleLead;

    @Schema(description = "上次保养自然日期(天)")
    private LocalDateTime lastNaturalDate;

    @Schema(description = "上次保养自然日期(天)")
    @ExcelProperty("上次保养日期")
    private LocalDateTime lastNaturalDateStr;

    @Schema(description = "下次保养自然日期(天)")
    @ExcelProperty("自然日周期(D)")
    private BigDecimal nextNaturalDate;

    @Schema(description = "自然日周期-提前量(天)")
    @ExcelProperty("自然日周期提前量(D)")
    private BigDecimal naturalDatePeriodLead;

    @Schema(description = "BOM节点 id", example = "18063")
    private Long bomNodeId;

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

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

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

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

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

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

    @Schema(description = "M维修 S保养 维修+保养", example = "2")
    private String type;

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

    @Schema(description = "备注", example = "你说的对")
    private String remark;

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

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

    /**
     * 扩展属性 设备关联字段
     */
    @Schema(description = "设备状态")
    private String deviceStatus;
    @Schema(description = "资产性质")
    private String assetProperty;
    @Schema(description = "累计运行时间", example = "30000H")
    private BigDecimal totalRunTime;

    @Schema(description = "临时 累计运行时间 用于运行记录模板中包含多个累计类型属性的场景", example = "30000H")
    private BigDecimal tempTotalRunTime;
    @Schema(description = "临时 累计运行公里数 用于运行记录模板中包含多个累计类型属性的场景", example = "20238km")
    private BigDecimal tempTotalMileage;

    @Schema(description = "模板中涉及多个累计运转时长的属性集合")
    private List<IotDeviceRunLogRespVO> timeAccumulatedAttrs;

    @Schema(description = "模板中涉及多个累计运行公里数的属性集合")
    private List<IotDeviceRunLogRespVO> mileageAccumulatedAttrs;

    @Schema(description = "上次保养时间")
    private LocalDateTime lastMaintenanceDate;


}