package com.gingersoft.gsa.cloud.table.mvp.model.bean;

import lombok.Data;

/**
 * 作者：ELEGANT_BIN
 * 版本：1.6.0
 * 创建日期：2020-04-30
 * 修订历史：2020-04-30
 * 描述：
 */
public class SoldoutCtrFood {

    private long id;
    private int restaurantId;
    private long brandId;
    private Long foodId;
    private Long modifierId;
    /**
     * 1-食品組
     * 2-食品
     * 3-細項
     **/
    private byte type;
    /**
     * 庫存數量
     */
    private int remainingNumber = -999999999;
    /**
     * 使用數量
     */
    private int useNumber = -999999999;
    private String foodName;
    private String foodName1;
    private String foodName2;

    /**
     * 自定義字段
     */
    /**
     * 是否已暫停
     */
    private boolean isStop = false;
    private int selected;

    public String getQtyName() {
        if (isStop) {
            return "暫停";
        }
        if (remainingNumber == 0) {
            return "";
        }
        if (useNumber == -999999999) {
            useNumber = 0;
        }
        if (remainingNumber - useNumber > 0) {
            return String.valueOf(remainingNumber - useNumber);
        }
        if (remainingNumber - useNumber == 0) {
            return "售罄";
        }
        return "";
    }

    public SoldoutCtrFood() {
    }

    public SoldoutCtrFood(SoldoutCtrFood ctrFood) {
        this.id = ctrFood.id;
        this.restaurantId = ctrFood.restaurantId;
        this.brandId = ctrFood.brandId;
        this.foodId = ctrFood.foodId;
        this.modifierId = ctrFood.modifierId;
        this.type = ctrFood.type;
        this.remainingNumber = ctrFood.remainingNumber;
        this.useNumber = ctrFood.useNumber;
        this.foodName = ctrFood.foodName;
        this.foodName1 = ctrFood.foodName1;
        this.foodName2 = ctrFood.foodName2;
        this.isStop = ctrFood.isStop;
        this.selected = ctrFood.selected;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getName() {
        return foodName;
    }

    public String getFoodName() {
        return foodName;
    }

    public void setFoodName(String foodName) {
        this.foodName = foodName;
    }

    public String getFoodName1() {
        return foodName1;
    }

    public void setFoodName1(String foodName1) {
        this.foodName1 = foodName1;
    }

    public String getFoodName2() {
        return foodName2;
    }

    public void setFoodName2(String foodName2) {
        this.foodName2 = foodName2;
    }

    public int getRestaurantId() {
        return restaurantId;
    }

    public void setRestaurantId(int restaurantId) {
        this.restaurantId = restaurantId;
    }

    public long getBrandId() {
        return brandId;
    }

    public void setBrandId(long brandId) {
        this.brandId = brandId;
    }

    public Long getFoodId() {
        return foodId;
    }

    public void setFoodId(Long foodId) {
        this.foodId = foodId;
    }

    public Long getModifierId() {
        return modifierId;
    }

    public void setModifierId(Long modifierId) {
        this.modifierId = modifierId;
    }

    public byte getType() {
        return type;
    }

    public void setType(byte type) {
        this.type = type;
    }

    public int getRemainingNumber() {
        return remainingNumber;
    }

    public void setRemainingNumber(int remainingNumber) {
        this.remainingNumber = remainingNumber;
    }

    public int getUseNumber() {
        return useNumber;
    }

    public void setUseNumber(int useNumber) {
        this.useNumber = useNumber;
    }

    public boolean isStop() {
        return isStop;
    }

    public void setStop(boolean stop) {
        isStop = stop;
    }

    public int getSelected() {
        return selected;
    }

    public void setSelected(int selected) {
        this.selected = selected;
    }
}
