package com.jjt.biz.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Random;

/**
 * 月平均
 *
 * @author wukai
 */
@ApiModel(value = "AvgMonthVO", description = "月平均")
@Data
public class AvgMonthVO {
    @ApiModelProperty("总成本")
    private BigDecimal costTotal;
    @ApiModelProperty("经编成本")
    private BigDecimal costJb;
    @ApiModelProperty("染整成本")
    private BigDecimal costRz;
    @ApiModelProperty("经编产量")
    private BigDecimal yieldJb;
    @ApiModelProperty("染整产量")
    private BigDecimal yieldRz;
    @ApiModelProperty("稼动率")
    private BigDecimal jdl;

    public void mock() {
        Random random = new Random();
        double total = 100000 + 30000 * random.nextDouble();
        this.costTotal = BigDecimal.valueOf(total).setScale(1, RoundingMode.HALF_UP);
        this.costJb = BigDecimal.valueOf(2.5);
        this.costRz = BigDecimal.valueOf(2.6);
        double prod = 20000 + 20000 * random.nextDouble();
        this.yieldJb = BigDecimal.valueOf(prod).setScale(0, RoundingMode.HALF_UP);
        prod = 20000 + 20000 * random.nextDouble();
        this.yieldRz = BigDecimal.valueOf(prod).setScale(0, RoundingMode.HALF_UP);
        double jdl = 70 + 10 * random.nextDouble();
        this.jdl = BigDecimal.valueOf(jdl).setScale(0, RoundingMode.HALF_UP);
    }
}
