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

import com.smppw.modaq.domain.entity.report.ReportInvestmentIndustryDO;
import com.smppw.modaq.infrastructure.util.ConvertUtil;
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 industryName;
    /**
     * 投资地区: 1-境内, 2-港股通
     */
    private Integer investType;
    /**
     * 公允价值，市值
     */
    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.setIndustryName(this.industryName);
        entity.setInvestType(this.investType);
        entity.setMarketValue(ConvertUtil.toBigDecimal(this.marketValue));
        entity.setRatio(ConvertUtil.toBigDecimal(this.ratio));
        return entity;
    }

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