package com.zcxk.rmcp.api.vo;

import com.zcxk.core.utils.BigDecimalUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * @author Andy
 * @version V1.0
 * @description: 统计抄表率
 * @date 2021/7/26
 **/
@Data
public class StatisticsReadRateVo {

    @ApiModelProperty(value="水表名字")
    private String name;

    @ApiModelProperty(value="应抄数据")
    private int readTimes;

    @ApiModelProperty(value="实抄数据")
    private int realReadTimes;

    @ApiModelProperty(value="未抄数据")
    private int unReadTimes;

    @ApiModelProperty(value="抄表率")
    private String readRate;

    /**
     * 转换
     * @return
     */
    public String getReadRate(){
        return StringUtils.isEmpty(readRate) ? "0%" : (BigDecimalUtils.multiply(readRate, "100").toEngineeringString() + "%");
    }


    public static void main(String[] args) {
        StatisticsReadRateVo vo = new StatisticsReadRateVo();
        System.out.println(StringUtils.isEmpty(vo.getReadRate()));
    }
}
