package org.agt.module.license.controller.admin.license.vo;

import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.VO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.agt.framework.excel.core.annotations.DictFormat;
import org.agt.framework.excel.core.convert.DictConvert;
import org.agt.module.system.api.user.AdminUserApi;

import java.time.LocalDate;

/**
 * License Excel 导入 VO
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = false) // 设置 chain = false，避免导入有问题
@ExcelIgnoreUnannotated
public class LicenseImportExcelVO implements VO {

    @Schema(description = "客户")
    @ExcelProperty("客户")
    private String customerName;

    @Schema(description = "项目")
    @ExcelProperty("项目")
    private String projectName;

    @Schema(description = "sn")
    @ExcelProperty("SN")
    private String serialNo;

    @Schema(description = "创建日期")
    @ExcelProperty("创建日期")
    private LocalDate applicationTime;

    @Schema(description = "网元")
    @ExcelProperty("安装网元")
    private String neListStr;

    @Schema(description = "到期时间")
    @ExcelProperty("license有效期")
    private String expiryDateExt;

    @Schema(description = "操作系统")
    @ExcelProperty(value = "操作系统平台", converter = DictConvert.class)
    @DictFormat("lic_operating_system")
    private Integer operatingSystem;

    @Schema(description = "合同编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1111")
    @ExcelProperty("合同编号")
    private String contractCode;

    @Schema(description = "商务状态", example = "2")
    @ExcelProperty(value = "商务状态", converter = DictConvert.class)
    @DictFormat("lic_business_status")
    private Integer businessStatus;

    @Schema(description = "项目状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
    @ExcelProperty(value = "项目状态", converter = DictConvert.class)
    @DictFormat("lic_project_status")
    private Integer status;

    @Schema(description = "业务负责人ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "businessOwnerName")
    private Long businessOwner;

    @Schema(description = "业务负责人", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("业务负责人")
    private String businessOwnerName;

    @Schema(description = "技术负责人1ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "technicalOwnerAName")
    private Long technicalOwnerA;

    @Schema(description = "技术负责人1", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("技术负责人1")
    private String technicalOwnerAName;

    @Schema(description = "技术负责人2ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "technicalOwnerBName")
    private Long technicalOwnerB;

    @Schema(description = "技术负责人2", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("技术负责人2")
    private String technicalOwnerBName;

    @Schema(description = "备注", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("备注")
    private String remark;

//    @Schema(description = "激活码")
//    @ExcelProperty("激活码")
//    private String activationCode;
//
//    @Schema(description = "用户数")
//    @ExcelProperty("用户数")
//    private Integer userNumber;
//
//    @Schema(description = "基站数")
//    @ExcelProperty("基站数")
//    private Integer ranNumber;

}
