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

import cn.iocoder.yudao.framework.common.pojo.PageParam;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;

import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;

@Schema(description = "管理后台 - PMS 保养计划明细BOM分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class IotMaintenanceBomPageReqVO extends PageParam {

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

    @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 = "保养规则(量程 运行时间 自然日期) 可多选")
    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 = "上次保养运行时长(小时)")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private BigDecimal[] lastRunningTime;

    @Schema(description = "下次保养运行时长(小时)")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    private BigDecimal[] nextRunningTime;

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

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

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

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

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

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

    @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 = "创建时间")
    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
    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 = "设备id集合")
    private List<Long> deviceIds;
    @Schema(description = "保养项节点id集合")
    private List<Long> bomNodeIds;
    @Schema(description = "保养项节点名称集合")
    private List<String> bomNodeNames;

    @Schema(description = "保养计划id 唯一性校验", example = "18063")
    private Long notPlanId;

    @Schema(description = "保养计划id 集合", example = "181,182")
    private Collection<Long> planIds;

    @Schema(description = "多种累计属性名称集合", example = "累计运行时间H,底盘发动机累计公里数KM")
    private Collection<String> codesOrTypes;

    @Schema(description = "保养计划查询条件")
    private Long deptId;

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

    @Schema(description = "计划名称")
    private String planName;
}