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

import android.text.TextUtils;

import com.gingersoft.gsa.cloud.table.mvp.model.constant.MealConstant;

import java.util.List;

public class OrderDetail {

    /**
     * code : 0
     * message :
     * datas : []
     */

    private int code;
    private String message;
    private List<DatasBean> datas;

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public List<DatasBean> getDatas() {
        return datas;
    }

    public void setDatas(List<DatasBean> datas) {
        this.datas = datas;
    }


    public static class DatasBean {

        /*******自定义字段*******/
        public boolean RealDiscountNew = false;//
        //新点后是否自动展开
        public int automod = 0;
        //作用于套餐下子食品的限制数量
        public int limitQty = 0;
        /**
         * 是否选择
         * 0 未选中
         * 1 被选中但不是主体
         * 2 作为主体被选中
         * 3 由三级菜单进入选中全部
         */
        public int selected = 0;
        //最后的金额平均数(Famount_price/number)
        public double Famount_price_sign = 0;
        //是否组合商品 1-组合商品 2-组合商品的子商品
        public int ComboLevel = 0;
        //是否显示，当
        public boolean visible = true;
        public String itemNo = "";
        public int index = -1;
        public int parent_index = 0;
        public int my_index = 0;
        //折扣后还应该收多少钱
        public double discount_Main_money = 0.00;
        public double PERCENTAGE = 0.00;
        public int advprice = 0;
        //是否已经折扣过
        public boolean sc_able2 = true;
        //"food" or "discount" or "modifiy"
        public String Prop = "food";
        //false时加 D标
        public boolean discount_double1 = true;
        //fix=6时加S标
        public int discount_Fixed = 0;
        //当作为discount时，记录下值
        public boolean double1_as_discount = true;
        public int fixed_as_discount = 0;
        //手动金额
        public boolean isManualMoney = false;
        public double manualMoney = 0.00;
        public boolean isComboAuto = false;
        //当作为套餐内时的编號
        public String comid = "";
        //是否新的数据
        public boolean isnew = false;
        public int newnumber = 0;
        //修改数量前的数量
        private int changeBeforeQty = 0;
        //是否自定义价格
        private boolean isFuncmoney = false;
        //当前食品是否有子项
        private boolean hasChild = false;

        private String name;

//        private DiscountTypeAndOrderPay.DatasBean discountBean;

        /**
         * ��Ա���ּ����ֶ�
         */
        private double pointsadd;
        private double pointsrote;
        private double PointsRedeem;


        //该食品是否修改过
        private boolean isModify = false;
        //修改食品前的数量
        private int modifyBeforeNumber = 0;
        //取消食品备注
        private String cancelInfo;
        //取消食品id
        private int cancelId;
        //取消食品数量
        private int cancelNumber;


        /*******接口字段*******/
        private int order_detail_id = -1;
        private int parent_order_detail_id = -1;
        private String itemno;
        private String desc1;
        private String desc2;
        private String desc3;
        private int itemtype = 0;
        private boolean isfood;
        //一级序 /二级序 /三级序
        private int seqno = 0;
        private int sseq = 0;
        private int mseq = 0;
        private int qty = 0;
        private double unitprice = 0;//單價
        private double amount_price = 0;//總價格
        private String modid = "";
        private int cancelid = 0;
        private double discount = 0.00;
        private int unit_id = -1;
        private String discount_code;
        private int discount_id = 0;
        private int discount_type = 0;
        private boolean sc_able = false;
        private boolean d_able = true;
        private String User_Qty;
        private int foodTableMode = MealConstant.hall_food_mode;
        /**
         * 以下是碰餐信息
         */
        private int MixGroupID = -1;
        private double MixGroupDiscPrice = 0.00;
        private int MixQty = -1;
        private int Mix_DETAIL_ID;
        private String MixDesc1;
        private String MixDesc2;
        private String MixDesc3;
        private String FTID = "";
        //1=沒有碰餐 2=已碰餐 3=從碰餐到沒有碰餐（需要更新價格數據）
        private int hasMix = 1;


        public DatasBean() {

        }

        /**
         * �ϲ�ʳƷ��Ҫ��д�˷���
         *
         * @param obj
         * @return
         */
        @Override
        public boolean equals(Object obj) {
            if (obj == null)
                return false;
            if (this == obj) {//ͬһ�����󣬱ض���һ�µ�
                return true;
            }
            if (obj instanceof DatasBean) {
                DatasBean datasBean = (DatasBean) obj;
                if (isnew && itemno.equals(datasBean.getItemno())) {
                    return true;
                } else {
                    return false;
                }
            }
            return false;//anObject����DatasBeanʵ������ô����false
        }

        /**
         * ��дhashcode ���������ص�hashCode��һ������ȥ�Ƚ�ÿ�����Ե�ֵ
         */
        @Override
        public int hashCode() {
            return itemno.hashCode() * desc1.hashCode();
        }

        public String getName() {
            if (!TextUtils.isEmpty(name)) {
                return name;
            }
//            return AndroidSettingUtils.getDataLanguage(desc1, desc2, desc3);
            return desc1;
        }

        public void setName(String name) {
            this.name = name;
        }

        public int getHasMix() {
            return hasMix;
        }

        public void setHasMix(int hasMix) {
            if (this.hasMix == 2 && hasMix == 1) {
                hasMix = 3;
            }
            this.hasMix = hasMix;
        }

        public int getFoodTableMode() {
            return foodTableMode;
        }

        public void setFoodTableMode(int foodTableMode) {
            this.foodTableMode = foodTableMode;
        }

        public void setModify(boolean modify) {
            isModify = modify;
        }

        public boolean isSc_able2() {
            return sc_able2;
        }

        public void setSc_able2(boolean sc_able2) {
            this.sc_able2 = sc_able2;
        }

        public int getIndex() {
            return index;
        }

        public void setIndex(int index) {
            this.index = index;
        }

        public boolean isRealDiscountNew() {
            return RealDiscountNew;
        }

        public void setRealDiscountNew(boolean realDiscountNew) {
            RealDiscountNew = realDiscountNew;
        }

        public int getAutomod() {
            return automod;
        }

        public void setAutomod(int automod) {
            this.automod = automod;
        }

        public int getLimitQty() {
            return limitQty;
        }

        public void setLimitQty(int limitQty) {
            this.limitQty = limitQty;
        }

        public int getSelected() {
            return selected;
        }

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

        public double getFamount_price_sign() {
            return Famount_price_sign;
        }

        public void setFamount_price_sign(double famount_price_sign) {
            Famount_price_sign = famount_price_sign;
        }

        public int getComboLevel() {
            return ComboLevel;
        }

        public void setComboLevel(int comboLevel) {
            ComboLevel = comboLevel;
        }

        public boolean isVisible() {
            return visible;
        }

        public void setVisible(boolean visible) {
            this.visible = visible;
        }

        public String getItemNo() {
            return itemNo;
        }

        public void setItemNo(String itemNo) {
            this.itemNo = itemNo;
        }

        public int getParent_index() {
            return parent_index;
        }

        public void setParent_index(int parent_index) {
            this.parent_index = parent_index;
        }

        public int getMy_index() {
            return my_index;
        }

        public void setMy_index(int my_index) {
            this.my_index = my_index;
        }

        public double getDiscount_Main_money() {
            return discount_Main_money;
        }

        public void setDiscount_Main_money(double discount_Main_money) {
            this.discount_Main_money = discount_Main_money;
        }

        public double getPERCENTAGE() {
            return PERCENTAGE;
        }

        public void setPERCENTAGE(double PERCENTAGE) {
            this.PERCENTAGE = PERCENTAGE;
        }

        public int getAdvprice() {
            return advprice;
        }

        public void setAdvprice(int advprice) {
            this.advprice = advprice;
        }

        public String getProp() {
            return Prop;
        }

        public void setProp(String prop) {
            Prop = prop;
        }

        public boolean isDiscount_double1() {
            return discount_double1;
        }

        public void setDiscount_double1(boolean discount_double1) {
            this.discount_double1 = discount_double1;
        }

        public int getDiscount_Fixed() {
            return discount_Fixed;
        }

        public void setDiscount_Fixed(int discount_Fixed) {
            this.discount_Fixed = discount_Fixed;
        }

        public boolean isDouble1_as_discount() {
            return double1_as_discount;
        }

        public void setDouble1_as_discount(boolean double1_as_discount) {
            this.double1_as_discount = double1_as_discount;
        }

        public int getFixed_as_discount() {
            return fixed_as_discount;
        }

        public void setFixed_as_discount(int fixed_as_discount) {
            this.fixed_as_discount = fixed_as_discount;
        }

        public boolean isManualMoney() {
            return isManualMoney;
        }

        public void setManualMoney(boolean manualMoney) {
            isManualMoney = manualMoney;
        }

        public double getManualMoney() {
            return manualMoney;
        }

        public void setManualMoney(double manualMoney) {
            this.manualMoney = manualMoney;
        }

        public int getChangeBeforeQty() {
            return changeBeforeQty;
        }

        public void setChangeBeforeQty(int changeBeforeQty) {
            this.changeBeforeQty = changeBeforeQty;
        }

        public boolean isComboAuto() {
            return isComboAuto;
        }

        public void setComboAuto(boolean comboAuto) {
            isComboAuto = comboAuto;
        }

        public String getComid() {
            return comid;
        }

        public void setComid(String comid) {
            this.comid = comid;
        }

        public boolean isIsnew() {
            return isnew;
        }

        public void setIsnew(boolean isnew) {
            this.isnew = isnew;
        }

        public int getNewnumber() {
            return newnumber;
        }

        public void setNewnumber(int newnumber) {
            this.newnumber = newnumber;
        }

        public int getOrder_detail_id() {
            return order_detail_id;
        }

        public void setOrder_detail_id(int order_detail_id) {
            this.order_detail_id = order_detail_id;
        }

        public int getParent_order_detail_id() {
            return parent_order_detail_id;
        }

        public void setParent_order_detail_id(int parent_order_detail_id) {
            this.parent_order_detail_id = parent_order_detail_id;
        }

        public boolean isFuncmoney() {
            return isFuncmoney;
        }

        public void setFuncmoney(boolean funcmoney) {
            isFuncmoney = funcmoney;
        }

        public String getItemno() {
            return itemno;
        }

        public void setItemno(String itemno) {
            this.itemno = itemno;
        }

        public String getDesc1() {
            return desc1;
        }

        public void setDesc1(String desc1) {
            this.desc1 = desc1;
        }

        public String getDesc2() {
            return desc2;
        }

        public void setDesc2(String desc2) {
            this.desc2 = desc2;
        }

        public String getDesc3() {
            return desc3;
        }

        public void setDesc3(String desc3) {
            this.desc3 = desc3;
        }

        public int getItemtype() {
            return itemtype;
        }

        public void setItemtype(int itemtype) {
            this.itemtype = itemtype;
        }

        public boolean isIsfood() {
            return isfood;
        }

        public void setIsfood(boolean isfood) {
            this.isfood = isfood;
        }

        public int getSeqno() {
            return seqno;
        }

        public void setSeqno(int seqno) {
            this.seqno = seqno;
        }

        public int getSseq() {
            return sseq;
        }

        public void setSseq(int sseq) {
            this.sseq = sseq;
        }

        public int getMseq() {
            return mseq;
        }

        public void setMseq(int mseq) {
            this.mseq = mseq;
        }

        public int getQty() {
            return qty;
        }

        public void setQty(int qty) {
            this.qty = qty;
        }

        public double getUnitprice() {
            return unitprice;
        }

        public void setUnitprice(double unitprice) {
            this.unitprice = unitprice;
        }

        public double getAmount_price() {
            return amount_price;
        }

        public void setAmount_price(double amount_price) {
            this.amount_price = amount_price;
        }

        public String getModid() {
            return modid;
        }

        public void setModid(String modid) {
            this.modid = modid;
        }

        public int getCancelid() {
            return cancelid;
        }

        public void setCancelid(int cancelid) {
            this.cancelid = cancelid;
        }

        public double getDiscount() {
            return discount;
        }

        public void setDiscount(double discount) {
            this.discount = discount;
        }

        public int getUnit_id() {
            return unit_id;
        }

        public void setUnit_id(int unit_id) {
            this.unit_id = unit_id;
        }

        public String getDiscount_code() {
            return discount_code;
        }

        public void setDiscount_code(String discount_code) {
            this.discount_code = discount_code;
        }

        public int getDiscount_id() {
            return discount_id;
        }

        public void setDiscount_id(int discount_id) {
            this.discount_id = discount_id;
        }

        public int getDiscount_type() {
            return discount_type;
        }

        public void setDiscount_type(int discount_type) {
            this.discount_type = discount_type;
        }

        public boolean isSc_able() {
            return sc_able;
        }

        public void setSc_able(boolean sc_able) {
            this.sc_able = sc_able;
        }

        public boolean isD_able() {
            return d_able;
        }

        public void setD_able(boolean d_able) {
            this.d_able = d_able;
        }

        public String getUser_Qty() {
            return User_Qty;
        }

        public void setUser_Qty(String user_Qty) {
            User_Qty = user_Qty;
        }

        public int getMixGroupID() {
            return MixGroupID;
        }

        public void setMixGroupID(int mixGroupID) {
            MixGroupID = mixGroupID;
        }

        public double getMixGroupDiscPrice() {
            return MixGroupDiscPrice;
        }

        public void setMixGroupDiscPrice(double mixGroupDiscPrice) {
            MixGroupDiscPrice = mixGroupDiscPrice;
        }

        public int getMixQty() {
            return MixQty;
        }

        public void setMixQty(int mixQty) {
            MixQty = mixQty;
        }

        public int getMix_DETAIL_ID() {
            return Mix_DETAIL_ID;
        }

        public void setMix_DETAIL_ID(int mix_DETAIL_ID) {
            Mix_DETAIL_ID = mix_DETAIL_ID;
        }

        public String getMixDesc1() {
            return MixDesc1;
        }

        public void setMixDesc1(String mixDesc1) {
            MixDesc1 = mixDesc1;
        }

        public String getMixDesc2() {
            return MixDesc2;
        }

        public void setMixDesc2(String mixDesc2) {
            MixDesc2 = mixDesc2;
        }

        public String getMixDesc3() {
            return MixDesc3;
        }

        public void setMixDesc3(String mixDesc3) {
            MixDesc3 = mixDesc3;
        }

        public String getFTID() {
            return FTID;
        }

        public void setFTID(String FTID) {
            this.FTID = FTID;
        }

//        public DiscountTypeAndOrderPay.DatasBean getDiscountTypeAndOrderPayBean() {
//            return discountBean;
//        }
//
//        public void setDiscountTypeAndOrderPayBean(DiscountTypeAndOrderPay.DatasBean discountBean) {
//            this.discountBean = discountBean;
//        }

        public double getPointsadd() {
            return pointsadd;
        }

        public void setPointsadd(double pointsadd) {
            this.pointsadd = pointsadd;
        }

        public double getPointsrote() {
            return pointsrote;
        }

        public void setPointsrote(double pointsrote) {
            this.pointsrote = pointsrote;
        }

        public double getPointsRedeem() {
            return PointsRedeem;
        }

        public void setPointsRedeem(double pointsRedeem) {
            PointsRedeem = pointsRedeem;
        }

        public boolean isModify() {
            if (!isnew && qty != modifyBeforeNumber) {
                isModify = true;
            } else {
                isModify = false;
            }
            return isModify;
        }

        public int getModifyBeforeNumber() {
            return modifyBeforeNumber;
        }

        public void setModifyBeforeNumber(int modifyBeforeNumber) {
            this.modifyBeforeNumber = modifyBeforeNumber;
        }

        public String getCancelInfo() {
            return cancelInfo;
        }

        public void setCancelInfo(String cancelInfo) {
            this.cancelInfo = cancelInfo;
        }

        public int getCancelId() {
            return cancelId;
        }

        public void setCancelId(int cancelId) {
            this.cancelId = cancelId;
        }

        public int getCancelNumber() {
            return cancelNumber;
        }

        public void setCancelNumber(int cancelNumber) {
            this.cancelNumber = cancelNumber;
        }

        public boolean isHasChild() {
            return hasChild;
        }

        public void setHasChild(boolean hasChild) {
            this.hasChild = hasChild;
        }
    }
}
