package com.hdkj.lt.bf.constants;

import com.hdkj.lt.base.model.response.ResultCode;

import java.util.Objects;

/**
 * @author luorui
 * @date 2025/5/20 12:04
 */
public class PlanPowerCutConstants {
    /**
     * 用户类型
     **/
    public class UserType {
        public static final String MEDIUM = "1";//中压
        public static final String LOW = "2";//低压
    }

    /**
     * 计划状态
     **/
    public class PlanState {
        public static final String CONFIRMED = "01";//已确认
        public static final String UNCONFIRMED = "02";//未确认
        public static final String REJECTED = "03";//已否决
    }


    /**
     * 计划状态枚举
     **/
    public enum PlanStateEnum {
        /**
         * 删除
         */
        CONFIRMED("01", "已确认"),

        /**
         * 新增
         */
        UNCONFIRMED("02", "未确认"),

        /**
         * 修改
         */
        REJECTED("03", "已否决");
        final String code;

        final String name;

        PlanStateEnum(String code, String name) {
            this.code = code;
            this.name = name;
        }

        public String getCode() {
            return this.code;
        }

        public String getName() {
            return this.name;
        }

        public static PlanStateEnum getByCode(String code) {
            PlanStateEnum[] values = values();
            for (PlanStateEnum item : values) {
                if (Objects.equals(item.getCode(), code)) {
                    return item;
                }
            }
            return null;
        }
        public static String getNameByCode(String code) {
            PlanStateEnum[] values = values();
            for (PlanStateEnum item : values) {
                if (Objects.equals(item.getCode(), code)) {
                    return item.name;
                }
            }
            return null;
        }
    }

}
