package org.agt.module.license.controller.admin.project.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.LocalDateTime;

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

    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25585")
    private Long id;

    @Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "aa")
    @ExcelProperty("项目名称")
    private String name;

    @Schema(description = "serialNo", example = "随便")
    @ExcelProperty("SN")
    private String serialNo;

    @Schema(description = "项目开始时间")
    @ExcelProperty("项目开始时间")
    private LocalDateTime startTime;

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

    @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")
    @ExcelProperty("技术负责人2")
    private Long technicalOwnerB;

    @Schema(description = "技术负责人3ID")
    @ExcelProperty("技术负责人3")
    private Long technicalOwnerC;

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

    @Schema(description = "客户对接人ID", requiredMode = Schema.RequiredMode.REQUIRED)
    @ExcelProperty("客户对接人")
    private String customerOwner;

    @Schema(description = "项目结束时间")
    @ExcelProperty("项目结束时间")
    private LocalDateTime endTime;

    @Schema(description = "环境信息")
    @ExcelProperty(value = "环境信息", converter = DictConvert.class)
    @DictFormat("lic_env_info")
    private Integer envInfo;

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

    @Schema(description = "软件版本")
    @ExcelProperty(value = "软件版本", converter = DictConvert.class)
    @DictFormat("lic_software_version")
    private Integer softwareVersion;

}