package com.bonus.material.device.domain;

import com.bonus.common.core.annotation.Excel;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.poi.ss.usermodel.HorizontalAlignment;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;

// EquipmentImportDTO.java
@Data
public class EquipmentImportDTO {

    @Excel(name = "装备类目", sort = 1, combo = {}, align = HorizontalAlignment.CENTER )
    @NotBlank(message = "专业不能为空")
    private String profession;

    @Excel(name = "装备名称", sort = 2, align = HorizontalAlignment.CENTER)
    @NotBlank(message = "装备名称不能为空")
    private String equipmentName;

    @Excel(name = "规格型号", sort = 3, align = HorizontalAlignment.CENTER)
    private String specification;

    @Excel(name = "资产原值(万元)", sort = 4, align = HorizontalAlignment.CENTER)
    @DecimalMin(value = "0.00", message = "资产原值不能小于0")
    private BigDecimal originalValue;

    @Excel(name = "生产厂家", sort = 5, combo = {}, align = HorizontalAlignment.CENTER)
    private String manufacturer;

    @Excel(name = "生产日期", sort = 6, dateFormat = "yyyy-MM-dd", align = HorizontalAlignment.CENTER)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date productionDate;

    @Excel(name = "下次维保日期", sort = 7, dateFormat = "yyyy-MM-dd", align = HorizontalAlignment.CENTER)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date nextMaintenanceDate;

    @Excel(name = "装备原始编码", sort = 8, align = HorizontalAlignment.CENTER)
    @NotBlank(message = "装备原始编码不能为空")
    private String originalCode;

    @Excel(name = "最大使用年限", sort = 9, align = HorizontalAlignment.CENTER)
    @Min(value = 0, message = "最大使用年限不能小于0")
    private Integer maxServiceYears;

    @Excel(name = "计数单位", sort = 10, combo = {}, align = HorizontalAlignment.CENTER)
    @NotBlank(message = "计数单位不能为空")
    private String unit;

    @Excel(name = "采购日期", sort = 11, dateFormat = "yyyy-MM-dd", align = HorizontalAlignment.CENTER)
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date purchaseDate;

    // ==================== 特征项（9组，每组2列：特征项名称 + 特征值） ====================

    @Excel(name = "特征项1", sort = 12, align = HorizontalAlignment.CENTER)
    private String propertyName1;

    @Excel(name = "特征值1", sort = 13, align = HorizontalAlignment.CENTER)
    private String propertyValue1;

    @Excel(name = "特征项2", sort = 14, align = HorizontalAlignment.CENTER)
    private String propertyName2;

    @Excel(name = "特征值2", sort = 15, align = HorizontalAlignment.CENTER)
    private String propertyValue2;

    @Excel(name = "特征项3", sort = 16, align = HorizontalAlignment.CENTER)
    private String propertyName3;

    @Excel(name = "特征值3", sort = 17, align = HorizontalAlignment.CENTER)
    private String propertyValue3;

    @Excel(name = "特征项4", sort = 18, align = HorizontalAlignment.CENTER)
    private String propertyName4;

    @Excel(name = "特征值4", sort = 19, align = HorizontalAlignment.CENTER)
    private String propertyValue4;

    @Excel(name = "特征项5", sort = 20, align = HorizontalAlignment.CENTER)
    private String propertyName5;

    @Excel(name = "特征值5", sort = 21, align = HorizontalAlignment.CENTER)
    private String propertyValue5;

    @Excel(name = "特征项6", sort = 22, align = HorizontalAlignment.CENTER)
    private String propertyName6;

    @Excel(name = "特征值6", sort = 23, align = HorizontalAlignment.CENTER)
    private String propertyValue6;

    @Excel(name = "特征项7", sort = 24, align = HorizontalAlignment.CENTER)
    private String propertyName7;

    @Excel(name = "特征值7", sort = 25, align = HorizontalAlignment.CENTER)
    private String propertyValue7;

    @Excel(name = "特征项8", sort = 26, align = HorizontalAlignment.CENTER)
    private String propertyName8;

    @Excel(name = "特征值8", sort = 27, align = HorizontalAlignment.CENTER)
    private String propertyValue8;

    @Excel(name = "特征项9", sort = 28, align = HorizontalAlignment.CENTER)
    private String propertyName9;

    @Excel(name = "特征值9", sort = 29, align = HorizontalAlignment.CENTER)
    private String propertyValue9;
}

