package com.simuwang.base.pojo.dos;

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

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

/**
 * FileName: FundNavAssetVO
 * Author:   chenjianhua
 * Date:     2024/9/15 16:49
 * Description: ${DESCRIPTION}
 */
@Data
public class FundNavAssetDO {
    /**
     * 基金ID
     */
    private String fundId;
    /**
     * 基金名称
     */
    private String fundName;
    /**
     * 净值日期
     */
    private Date priceDate;
    /**
     * 单位净值
     */
    private BigDecimal nav;
    /**
     * 累计净值
     */
    private BigDecimal cumulativeNavWithdrawal;
    /**
     * 资产份额
     */
    private BigDecimal assetShare;
    /**
     * 资产净值
     */
    private BigDecimal assetNet;
    /**
     * 更新时间
     */
    private Date updateTime;

    public FundNavAssetVO toVo() {
        FundNavAssetVO vo = new FundNavAssetVO();
        vo.setFundId(this.fundId);
        vo.setFundName(this.fundName);
        vo.setPriceDate(DateUtils.format(this.priceDate,DateUtils.YYYY_MM_DD));
        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));
        return vo;
    }
}
