package com.simuwang.base.pojo.dto.report;

import com.simuwang.base.pojo.dos.report.ReportInvestmentIndustryDO;
import lombok.Getter;
import lombok.Setter;

/**
 * @author wangzaijun
 * @date 2024/9/26 16:49
 * @description 按行业分类的股票投资组合
 */
@Setter
@Getter
public class ReportInvestmentIndustryDTO extends BaseReportDTO<ReportInvestmentIndustryDO> {
    /**
     * 行业分类编码
     */
    private String industryCode;
    /**
     * 行业分类名称
     */
    private String industryName;
    /**
     * 投资地区: 1-境内, 2-港股通
     */
    private Integer investType;
    /**
     * 行业标准编码
     */
    private String isbCode;
    /**
     * 公允价值，市值
     */
    private String marketValue;
    /**
     * 占基金资产净值的比例，占净值比，权重
     */
    private String ratio;

    public ReportInvestmentIndustryDTO() {
        super();
    }

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

    @Override
    public ReportInvestmentIndustryDO toEntity() {
        ReportInvestmentIndustryDO entity = new ReportInvestmentIndustryDO();
        entity.setFileId(this.getFileId());
        entity.setIndustryCode(this.industryCode);
        entity.setIndustryName(this.industryName);
        entity.setInvestType(this.investType);
        entity.setIsbCode(this.isbCode);
        entity.setMarketValue(this.toBigDecimal(this.marketValue));
        entity.setRatio(this.toBigDecimal(this.ratio));
        return entity;
    }

    @Override
    public String toString() {
        return "{" +
                super.toString() +
                ", industryCode='" + industryCode + '\'' +
                ", industryName='" + industryName + '\'' +
                ", investType=" + investType +
                ", isbCode='" + isbCode + '\'' +
                ", marketValue=" + marketValue +
                ", ratio=" + ratio +
                '}';
    }
}
