package com.sw.common.accessory.server.dto;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.sw.common.core.annotation.Trans;
import com.sw.common.core.easyexcel.EasyBaseConverter;
import com.sw.common.mybatisplus.base.BaseDto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

import static com.sw.common.accessory.config.Constant.*;

/**
 * @Author
 * @Description：
 * @Date: Create in
 * @Modified By:
 */
@Data
@ApiModel(value = "辅材信息Dto")
public class AccessoryDto extends BaseDto {
    @ExcelIgnore
    private Long id;
    @ExcelIgnore
    @ApiModelProperty(value = "设备辅材id", required = true)
    Long equipmentAccessoryId;
    @ExcelProperty(value = "设备编号")
    @ApiModelProperty(value = "设备编号", required = true)
    String equipmentCode;
    @ExcelIgnore
    @ApiModelProperty(value = "物料id", required = true)
    Long materialId;
    @ExcelProperty(value = "物料类型")
    @ApiModelProperty(value = "物料类型", required = true)
    String materialType;
    @ExcelProperty(value = "物料名称")
    @ApiModelProperty(value = "物料名称", required = true)
    String materialName;
    @ExcelProperty(value = "物料料号")
    @ApiModelProperty(value = "物料料号", required = true)
    String materialCode;
    @ExcelProperty(value = "批次号")
    @ApiModelProperty(value = "批次号", required = false)
    String batchCode;
    @ExcelProperty(value = "唯一码")
    @ApiModelProperty(value = "唯一码", required = false)
    String uniqueCode;
    @ExcelProperty(value = "数量")
    @ApiModelProperty(value = "数量", required = true)
    Integer number;
    @ExcelProperty(value = "物料状态", converter = EasyBaseConverter.class)
    @Trans(ENUM_DICT_ACCY_STATUS)
    @ApiModelProperty(value = "物料状态", required = true)
    Integer accessoryStatus;
    @ExcelProperty(value = "使用状态", converter = EasyBaseConverter.class)
    @Trans(ENUM_DICT_ACCY_USE_STATUS)
    @ApiModelProperty(value = "使用状态", required = true)
    Integer status;
    @ExcelProperty(value = "预警状态", converter = EasyBaseConverter.class)
    @Trans(ENUM_DICT_ACCY_WARNING_STATUS)
    @ApiModelProperty(value = "预警状态", required = true)
    Integer warnStatus;

    /**
     * 辅料模型属性
     */
    @ExcelProperty(value = "规格")
    @ApiModelProperty(value = "规格", required = true)
    String specification;
    @ExcelProperty(value = "物料型号")
    @ApiModelProperty(value = "物料型号", required = true)
    String xh;
    @ExcelProperty(value = "物料图号")
    @ApiModelProperty(value = "物料图号", required = true)
    String th;
    @ExcelProperty(value = "物料单位")
    @ApiModelProperty(value = "物料单位", required = true)
    String unit;
    @ExcelProperty(value = "供应商")
    @ApiModelProperty(value = "供应商", required = true)
    String supplier;
    @ExcelProperty(value = "寿命类型", converter = EasyBaseConverter.class)
    @ApiModelProperty(value = "寿命类型", required = true)
    @Trans(ENUM_DICT_ACCY_LIFE_TYPE)
    Integer lifeType;
    @ExcelProperty(value = "额定寿命")
    @ApiModelProperty(value = "额定寿命", required = true)
    Integer ratedLife;
    @ExcelProperty(value = "已使用寿命")
    @ApiModelProperty(value = "已使用寿命", required = true)
    Integer usefulLife;
    @ExcelProperty(value = "剩余寿命")
    @ApiModelProperty(value = "剩余寿命", required = true)
    Integer remainingLife;
    @ExcelProperty(value = "预警寿命")
    @ApiModelProperty(value = "预警寿命", required = true)
    Integer warnLife;
    @ExcelProperty(value = "上机时间")
    @ApiModelProperty(value = "上机时间", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    Date upperTime;
    @ExcelProperty(value = "下机时间")
    @ApiModelProperty(value = "下机时间", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    Date downTime;
    @ExcelProperty(value = "预警时间")
    @ApiModelProperty(value = "预警时间", required = true)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    Date warnTime;
    @ExcelProperty(value = "备注")
    @ApiModelProperty(value = "备注", required = true)
    String remarks;
}