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

import cn.iocoder.yudao.framework.excel.core.annotations.DictFormat;
import cn.iocoder.yudao.framework.excel.core.convert.DictConvert;
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
import cn.iocoder.yudao.module.erp.dal.dataobject.product.ErpProductDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.criticalcomponent.CriticalComponentDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.dvrepair.DvRepairLineDO;
import cn.iocoder.yudao.module.mes.dal.dataobject.ticketresults.TicketResultsDO;
import cn.iocoder.yudao.module.common.dal.dataobject.mold.MoldDO;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

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

import com.alibaba.excel.annotation.*;
import org.springframework.format.annotation.DateTimeFormat;

@Schema(description = "管理后台 - 设备类型 Response VO")
@Data
@ExcelIgnoreUnannotated
public class DeviceLedgerRespVO extends BaseDO {

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

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

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

    @Schema(description = "设备类型")
    private String deviceType;

    @Schema(description = "设备类型名称", example = "1")
    @ExcelProperty("类型")
    private String typeName;

    @Schema(description = "设备状态 (0-正常, 1-停用, 2-维修, 3-报废)", example = "2")
    @ExcelProperty(value = "状态", converter = DictConvert.class)
    @DictFormat("mes_tz_status") // TODO 代码优化：建议设置到对应的 DictTypeConstants 枚举类中
    private String deviceStatus;

    @Schema(description = "设备规格")
    @ExcelProperty("设备规格")
    private String deviceSpec;

    @Schema(description = "设备型号")
    @ExcelProperty("设备型号")
    private String deviceModel;

    @Schema(description = "设备生产日期")
    @ExcelProperty("设备生产日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate productionDate;

    @Schema(description = "设备入厂日期")
    @ExcelProperty("设备入厂日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate  factoryEntryDate;

    @Schema(description = "设备位置")
    @ExcelProperty("设备位置")
    private String deviceLocation;

    @Schema(description = "设备负责人")
//    @ExcelProperty("设备负责人")
    private String deviceManager;
    @Schema(description = "设备负责人名字", example = "随便")
    @ExcelProperty("设备负责人名字")
    private String deviceManagerName;

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

    @Schema(description = "创建人名字", example = "随便")
    @ExcelProperty("创建人名字")
    private String creatorName;

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

    @Schema(description = "设备品牌")
//    @ExcelProperty("设备品牌")
    private String deviceBrand;

    @Schema(description = "供应商")
//    @ExcelProperty("供应商")
    private String supplier;

    @Schema(description = "所属产线")
    @ExcelProperty("所属产线")
    private String workshopName;

    @Schema(description = "所属产线ID")
    private String workshop;

    @Schema(description = "所属系统组织")
    @ExcelProperty("所属系统组织")
    private String systemOrg;

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

    @Schema(description = "排序")
//    @ExcelProperty("排序")
    private Integer sort;

    @Schema(description = "点检结果列表")
    private List<TicketResultsDO> inspectionList;

    @Schema(description = "保养结果列表")
    private List<TicketResultsDO> maintainList;
    @Schema(description = "维修列表")
    private Map<String,List<DvRepairLineDO>> repairList;
     ;
    @Schema(description = "关键件列表")
    private List<CriticalComponentDO> componentList;

    @Schema(description = "备件列表")
    private List<ErpProductDO> beijianList;

    @Schema(description = "模具列表")
    private List<MoldDO> moldList;

    @Schema(description = "附件地址")
//    @ExcelProperty("附件地址")
    private String fileUrl;

    @Schema(description = "关键件id")
    private String componentId;

    @Schema(description = "备件id")
    private String beijianId;

    @Schema(description = "模具id")
    private String moldId;

    @Schema(description = "关联采集设备id")
    private Long  dvId;
}