package com.bonus.canteen.core.pay.common.constants;

import cn.hutool.core.collection.CollUtil;

public enum PayChannelSelectEnum {
   DEVICE_CONSUME(1, "设备消费"),
   DEVICE_OFFLINE_CONSUME(2, "设备离线消费"),
   MOBILE_CONSUME(3, "移动端消费"),
   PAD_CONSUME(4, "点餐Pad消费"),
   OPEN_CONSUME(5, "open接口消费"),
   ACC_EXCEPTION(6, "账户异常再次扣费"),
   DEVICE_RECHARGE(11, "设备充值"),
   MOBILE_RECHARGE(12, "移动端充值"),
   DEVICE_QR_CODE(21, "设备充值");

   private final Integer key;
   private final String desc;

   private PayChannelSelectEnum(Integer key, String desc) {
      this.key = key;
      this.desc = desc;
   }

   public static String getDesc(Integer key) {
      PayChannelSelectEnum[] var1 = values();
      int var2 = var1.length;

      for(int var3 = 0; var3 < var2; ++var3) {
         PayChannelSelectEnum temp = var1[var3];
         if (temp.getKey().equals(key)) {
            return temp.getDesc();
         }
      }

      return "";
   }

   public static boolean isDeviceOnline(Integer key) {
      return CollUtil.toList(new Integer[]{DEVICE_CONSUME.getKey(), PAD_CONSUME.getKey(), DEVICE_RECHARGE.getKey()}).contains(key);
   }

   public static boolean isDeviceOffline(Integer key) {
      return DEVICE_OFFLINE_CONSUME.getKey().equals(key);
   }

   public static boolean isMobile(Integer key) {
      return CollUtil.toList(new Integer[]{MOBILE_CONSUME.getKey(), MOBILE_RECHARGE.getKey()}).contains(key);
   }

   public static boolean isDeviceQrCode(Integer key) {
      return DEVICE_QR_CODE.getKey().equals(key);
   }

   public static boolean isRecharge(Integer key) {
      return CollUtil.toList(new Integer[]{DEVICE_RECHARGE.getKey(), MOBILE_RECHARGE.getKey(), DEVICE_QR_CODE.getKey()}).contains(key);
   }

   public static boolean isExceptionPay(Integer key) {
      return ACC_EXCEPTION.getKey().equals(key);
   }

   public static boolean isOpen(Integer key) {
      return OPEN_CONSUME.getKey().equals(key);
   }

   public Integer getKey() {
      return this.key;
   }

   public String getDesc() {
      return this.desc;
   }

   // $FF: synthetic method
   private static PayChannelSelectEnum[] $values() {
      return new PayChannelSelectEnum[]{DEVICE_CONSUME, DEVICE_OFFLINE_CONSUME, MOBILE_CONSUME, PAD_CONSUME, OPEN_CONSUME, ACC_EXCEPTION, DEVICE_RECHARGE, MOBILE_RECHARGE, DEVICE_QR_CODE};
   }
}
