package com.hzu.labbooking.domain.vo;

import java.math.BigDecimal;

public class LabUseVO {
    /**
     * 实验室名称
     */
    private String labName;
    /**
     * 使用学时
     */
    private Integer use;
    /**
     * 总共学时
     */
    private Integer all;
    /**
     * 实验室利用率
     */
    private BigDecimal rate;

    public LabUseVO() {
    }

    public String getLabName() {
        return labName;
    }

    public void setLabName(String labName) {
        this.labName = labName;
    }

    public Integer getUse() {
        return use;
    }

    public void setUse(Integer use) {
        this.use = use * 2;
    }

    public Integer getAll() {
        return all;
    }

    public void setAll(Integer all) {
        this.all = all;
    }

    public BigDecimal getRate() {
        return rate;
    }

    public void setRate(BigDecimal rate) {
        this.rate = rate;
    }

    public void setAll() {
        this.all = 18 * 7 * 5 * 2;
    }

    public void setRate() {
        this.rate = new BigDecimal(this.use).divide(new BigDecimal(this.all), 3, BigDecimal.ROUND_HALF_UP);
    }

    @Override
    public String toString() {
        return "LabUseVO{" +
                "labName='" + labName + '\'' +
                ", use=" + use +
                ", all=" + all +
                ", rate=" + rate +
                '}';
    }
}
