package com.simuwang.base.pojo.dos;

import com.simuwang.base.common.util.DateUtils;
import com.simuwang.base.pojo.vo.EmailParseDetailVO;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

/**
 * FileName: EmailParseDetailDO
 * Author:   chenjianhua
 * Date:     2024/9/18 18:38
 * Description: ${DESCRIPTION}
 */
@Data
public class EmailParseDetailDO {
    /**
     * 邮件解析的基金名称
     */
    private String fundId;
    /**
     * 邮件解析的基金名称
     */
    private String fundName;
    /**
     * 邮件解析的备案编码
     */
    private String registerNumber;
    /**
     * 净值日期
     */
    private String priceDate;
    /**
     * 单位净值
     */
    private BigDecimal nav;
    /**
     * 累计单位净值
     */
    private BigDecimal cumulativeNavWithdrawal;
    /**
     * 资产份额
     */
    private BigDecimal assetShare;
    /**
     * 资产净值(基金规模)
     */
    private BigDecimal assetNet;
    /**
     * 净值入库情况 0-未入库，1-入库
     */
    private Integer navIsStored;
    /**
     * 净值异常情况:1-无异常,2-净值缺失,3-未匹配基金,4-净值<=0,5-资产净值<=0
     */
    private Integer navExceptionStatus;

    /**
     * 规模入库情况 0-未入库，1-入库
     */
    private Integer assetIsStored;
    /**
     * 规模异常情况:1-无异常,2-资产净值<=0
     */
    private Integer assetExceptionStatus;

    /**
     * 更新时间
     */
    private Date updateTime;

    public EmailParseDetailVO toVO() {
        EmailParseDetailVO vo = new EmailParseDetailVO();
        vo.setFundId(this.fundId);
        vo.setFundName(this.fundName);
        vo.setRegisterNumber(this.registerNumber);
        vo.setPriceDate(this.priceDate);
        vo.setNav(this.nav);
        vo.setCumulativeNavWithdrawal(this.cumulativeNavWithdrawal);
        vo.setAssetNet(this.assetNet);
        vo.setAssetShare(this.assetShare);
        vo.setUpdateTime(DateUtils.format(this.updateTime,DateUtils.YYYY_MM_DD_HH_MM_SS));
        vo.setNavIsStored(this.navIsStored);
        vo.setNavExceptionStatus(this.navExceptionStatus);
        vo.setAssetIsStored(this.assetIsStored);
        vo.setAssetExceptionStatus(this.assetExceptionStatus);
        return vo;
    }
}
