package com.smppw.modaq.domain.dto.report;

import cn.hutool.core.date.DateUtil;
import com.smppw.modaq.domain.entity.report.ReportBaseInfoDO;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * @author wangzaijun
 * @date 2024/9/26 16:44
 * @description 基协报告基础信息表
 */
@Setter
@Getter
public class ReportBaseInfoDTO extends BaseReportDTO<ReportBaseInfoDO> {
    /**
     * 报告日期
     */
    private Date reportDate;
    /**
     * 报告名称
     */
    private String reportName;
    /**
     * 报告类型
     */
    private String reportType;
    /**
     * 月报类型
     *
     * @see com.smppw.modaq.common.enums.ReportMonthlyType
     */
    private Integer monthlyType;
    /**
     * 报告是否用印
     */
    private Boolean withSeals;
    /**
     * 观点报告是否存在联系人信息（可能包含联系电话、地址等敏感信息）
     */
    private Boolean withContacts;

    public ReportBaseInfoDTO() {
        super();
    }

    public ReportBaseInfoDTO(Integer fileId) {
        super(fileId);
    }

    @Override
    public ReportBaseInfoDO toEntity() {
        ReportBaseInfoDO entity = new ReportBaseInfoDO();
        entity.setFileId(this.getFileId());
        entity.setReportDate(this.reportDate);
        entity.setReportName(this.reportName);
        entity.setReportType(this.reportType);
        entity.setMonthlyType(this.monthlyType);
        entity.setWithSeals(this.withSeals);
        entity.setWithContacts(this.withContacts);
        this.initEntity(entity);
        return entity;
    }

    @Override
    public String toString() {
        return "{" +
                super.toString() +
                ", reportDate='" + (reportDate == null ? null : DateUtil.formatDate(reportDate)) + '\'' +
                ", reportName='" + reportName + '\'' +
                ", reportType='" + reportType + '\'' +
                ", monthlyType=" + monthlyType +
                ", withSeals=" + withSeals +
                ", withContacts=" + withContacts +
                '}';
    }
}
