QueryEmptyLocationDto.java 1.59 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 QueryEmptyLocationDto implements Serializable {


    private static final long serialVersionUID = 1148867716183617160L;

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

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

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

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

    /**
     * 空库位数量
     */
    private int emptyLocationQty;

    /**
     * 空载具数量:空载具在库位上,未与盛具绑定
     */
    private int emptyContainerQty;

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

    /**
     * 空库位率
     */
    private String emptyContainerRate;

    /**
     * 空载具率
     */
    private String emptyLocationRate;
}