package com.sw.mes.enumvalue;


import com.sw.mes.core.enums.EnumValue;
import com.sw.mes.core.enums.EnumValues;
import lombok.Getter;

public class EnumValuesFbServer {
    /**
     * 任务状态 - 方棒工单排除
     */
    public enum ProductionScheduleStatus implements EnumValue.KeyValueInt {
        未开始(0, "未开始"), 进行中(1, "进行中"), 已完成(2, "已完成"), 已取消(3, "已取消");

        private ProductionScheduleStatus(int key, String value) {
            this.key = key;
            this.value = value;
        }

        public static String getText(int value) {
            ProductionScheduleStatus[] businessModeEnums = values();
            for (ProductionScheduleStatus businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey() == value) {
                    return businessModeEnum.getValue();
                }
            }
            return null;
        }

        private int key;
        private String value;

        public int getKey() {
            return key;
        }

        void setKey(int key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        void setValue(String value) {
            this.value = value;
        }
    }


    /**
     * 订单类型 - 方棒工单排除
     */
    public enum ProductionOrderType implements EnumValue.KeyValue {
        常规("常规", "常规"), 研发("研发", "研发"), 在建("ZH05", "在建"), 返工("ZH04", "返工"),
        内部代工("ZH06", "内部代工"), 客户受托("ZH07", "客户受托"), 工厂代工("工厂代工", "工厂代工"), ZRB4("ZRB4","研发工单");

        ProductionOrderType(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public static String getText(String value) {
            ProductionOrderType[] businessModeEnums = values();
            for (ProductionOrderType businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey().equals(value)) {
                    return businessModeEnum.getValue();
                }
            }
            return null;
        }

        public static ProductionOrderType getEnum(String value) {
            ProductionOrderType[] enums = values();
            for (ProductionOrderType enumz : enums) {
                if (enumz.getKey().equals(value)) {
                    return enumz;
                }
            }
            return null;
        }

        private String key;
        private String value;

        public String getKey() {
            return key;
        }

        void setKey(String key) {
            this.key = key;
        }

        public String getValue() {
            return value;
        }

        void setValue(String value) {
            this.value = value;
        }
    }


    /**
     * 加工类型
     */
    @Getter
    public enum MatchingType implements EnumValue.KeyValueInt {
        普通加工(0, "普通加工"), 非标加工(1, "非标加工");

        MatchingType(int key, String value) {
            this.key = key;
            this.value = value;
        }

        public static String getText(int value) {
            MatchingType[] businessModeEnums = values();
            for (MatchingType businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey() == value) {
                    return businessModeEnum.getValue();
                }
            }
            return null;
        }

        private int key;
        private String value;
    }

    /**
     * 收尾方式
     */
    @Getter
    public enum WindUp implements EnumValues.KeyValue {
        完结棒("V", "完结棒"),
        完结尾("W", "完结尾"),
        正常收尾("Y", "正常收尾"),
        等径断线("N1", "等径断线"),
        收尾断线("N2", "收尾断线"),
        多晶棒("D", "多晶棒");

        private WindUp(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public static String getText(String value) {
            WindUp[] businessModeEnums = values();
            for (WindUp businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey().equals(value)) {
                    return businessModeEnum.getValue();
                }
            }
            return null;
        }

        private String key;
        private String value;
    }

    /**
     * 完结标识
     */
    @Getter
    public enum ClosureIdentification implements EnumValues.KeyValue {
        无("无", "无"),
        完结尾("W", "完结尾"),
        完结棒("V", "完结棒");

        private ClosureIdentification(String key, String value) {
            this.key = key;
            this.value = value;
        }

        public static String getText(String value) {
            ClosureIdentification[] businessModeEnums = values();
            for (ClosureIdentification businessModeEnum : businessModeEnums) {
                if (businessModeEnum.getKey().equals(value)) {
                    return businessModeEnum.getValue();
                }
            }
            return null;
        }

        private String key;
        private String value;
    }

    //region 方棒检验类型
    public static String checkoutNameOne = "一次检验";
    public static String checkoutNameGoodsRejected = "退货复检";
    public static String checkoutNameCancellingStocks = "退库复检";
    public static String checkoutNameZfb = "粘方棒复检";
    public static String checkoutNameFq = "返切复检";
    public static String checkoutNameFx = "返修复检";
    //endregion
}