package com.izouma.zhirongip.dto;

import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.izouma.zhirongip.domain.resource.Company;
import com.izouma.zhirongip.utils.excel.BooleanConverter;
import com.izouma.zhirongip.utils.excel.LocalDateTimeConverter;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel(value = "Company")
public class CompanyDTO extends BaseRowModel {

    @ExcelProperty(value = "企业性质")
    private String settingName;

    @ExcelProperty(value = "所属领域")
    private String fieldName;

    @ExcelProperty(value = "企业名称")
    private String name;

    @ExcelProperty(value = "所属地区")
    private String owner;

    @ExcelProperty(value = "图片")
    private String img;

    @ExcelProperty(value = "企业简介")
    private String manual;

    @ExcelProperty(value = "入库入网")
    private String networkName;

    @ExcelProperty(value = "武器装备科研生产单位保密资格证", converter = BooleanConverter.class)
    private boolean confidentialityQualification;

    @ExcelProperty(value = "保密资格证级别")
    private String confidentialityLevelName;

    @ExcelProperty(value = "武器装备质量管理体系认证", converter = BooleanConverter.class)
    private boolean certification;

    @ExcelProperty(value = "武器装备承制单位资格证", converter = BooleanConverter.class)
    private boolean unitQualification;

    @ExcelProperty(value = "承制单位资格证级别")
    private String unitLevelName;

    @ExcelProperty(value = "武器装备科研生产许可证", converter = BooleanConverter.class)
    private boolean productionLicence;

    @ExcelProperty(value = "生产许可证类别")
    private String productionLevelName;

    @ExcelProperty(value = "涉密信息系统集成", converter = BooleanConverter.class)
    private boolean systemIntegration;

    @ExcelProperty(value = "系统集成级别")
    private String integrationLevelName;

    @ExcelProperty(value = "高新技术企业", converter = BooleanConverter.class)
    private boolean highTech;

    @ExcelProperty(value = "知识产权数量")
    private String numOfIpsName;

    @ExcelProperty(value = "知识产权贯标", converter = BooleanConverter.class)
    private boolean standardization;

    @ExcelProperty(value = "知识产权贯标级别")
    private String standardizationLevelName;

    @ExcelProperty(value = "企业技术资质")
    private String qualificationLevelName;

    @ExcelProperty(value = "联系人")
    private String contact;

    @ExcelProperty(value = "电话")
    private String phone;

    @ExcelProperty(value = "邮箱")
    private String email;

    @ExcelProperty(value = "官网地址")
    private String url;

    @ExcelProperty(value = "信息更新时间", converter = LocalDateTimeConverter.class)
    private LocalDateTime updateAt;

    public CompanyDTO(Company company) {
        BeanUtil.copyProperties(company, this);
    }
}
