package cn.iocoder.yudao.module.mes.controller.admin.dvrepair.vo;

import cn.iocoder.yudao.module.mes.controller.admin.dvrepair.enums.MoldRecordStatusEnum;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;

@Schema(description = "管理后台 - 设备维修记录 Response VO")
@Data
@ExcelIgnoreUnannotated
public class DvRepairRespVO {

    @Schema(description = "ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "27809")
//    @ExcelProperty("ID")
    private Long id;

    @Schema(description = "维修单编号", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("维修单编号")
    private String repairCode;

    @Schema(description = "维修单名称", example = "王五")
    @ExcelProperty("维修单名称")
    private String repairName;

    @Schema(description = "设备ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6979")
//    @ExcelProperty("设备ID")
    private Long machineryId;


    @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
    @ExcelProperty("设备名称")
    private String machineryName;

    @Schema(description = "设备编码", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("设备编码")
    private String machineryCode;

//    @Schema(description = "品牌")
//    @ExcelProperty("品牌")
//    private String machineryBrand;

    @Schema(description = "规格型号")
    @ExcelProperty("规格型号")
    private String machinerySpec;

    @Schema(description = "设备类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1622")
    @ExcelProperty(value = "设备类型", converter = DictConvert.class)
    @DictFormat("mes_machine_type") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private Long machineryTypeId;

    @Schema(description = "报修日期")
    @ExcelProperty("报修日期")
    @DateTimeFormat(fallbackPatterns = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @ColumnWidth(20)
    private LocalDateTime requireDate;

    @Schema(description = "完成日期")
    @ExcelProperty("完成日期")
    @DateTimeFormat(fallbackPatterns = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @ColumnWidth(20)
    private LocalDateTime finishDate;

    @Schema(description = "验收日期")
    @ExcelProperty("验收日期")
    @DateTimeFormat(fallbackPatterns = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @ColumnWidth(20)
    private LocalDateTime confirmDate;

    @Schema(description = "维修结果")
    @ExcelProperty("维修结果")
    private String repairResult;

    @Schema(description = "维修人员")
    @ExcelProperty("维修人员")
    private String acceptedBy;

    @Schema(description = "验收人员")
    @ExcelProperty("验收人员")
    private String confirmBy;

    @Schema(description = "单据状态 0-待完成 1-已完成", example = "1")
    private Integer status;

    @Schema(description = "单据状态", example = "1")
    @ExcelProperty(value = "单据状态")
    private String statusName;

    @Schema(description = "备注", example = "你猜")
//    @ExcelProperty("备注")
    private String remark;

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

    @Schema(description = "设备类型 1-设备 2-关键件", example = "你猜")
    private Integer deviceType;

    @Schema(description = "设备Id", example = "你猜")
    private Long deviceId;

    @Schema(description = "关键件Id", example = "你猜")
    private Long componentId;

    @Schema(description = "维修状态 0-待完成 1-通过 2-不通过")
    private Integer repairStatus;

    @Schema(description = "维修状态")
    @ExcelProperty("维修状态")
    private String repairStatusName;
}