EmptyLocationDto.java 1.04 KB
package com.huaheng.api.mes.domain;

import com.huaheng.common.utils.StringUtils;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;

/**
 * MES查询空库位Dto类
 */
@Data
public class EmptyLocationDto implements Serializable {

    private static final long serialVersionUID = 1148867716183617160L;

    /**
     * 库区编码
     */
    private String zoneCode;

    /**
     * 库区名称
     */
    private String zoneName;

    public void setSomeLocationQty(int someLocationQty) {
        this.someLocationQty = someLocationQty;
        if (StringUtils.isNotNull(totalLocationQty)) {
            this.someLocationRate = BigDecimal.valueOf((double) someLocationQty / (double) totalLocationQty * 100).setScale(2, RoundingMode.HALF_UP).doubleValue() + "%";
        }
    }

    /**
     * 有货位数量
     */
    private int someLocationQty;

    /**
     * 有货位数量
     */
    private String someLocationRate;

    /**
     * 总库位数
     */
    private int totalLocationQty;
}