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


import com.bonus.core.pay.channel.abc.service.ABCPayExtension;
import com.bonus.core.pay.channel.account.extension.AccPayExtension;
import com.bonus.core.pay.channel.ali.extension.AliPayExtension;
import com.bonus.core.pay.channel.bnj.service.BNJPayExtension;
import com.bonus.core.pay.channel.ccb.service.CcbPayExtension;
import com.bonus.core.pay.channel.cib.service.CIBPayExtension;
import com.bonus.core.pay.channel.cmb.service.CMBPayExtension;
import com.bonus.core.pay.channel.coupon.extension.CouponPayExtension;
import com.bonus.core.pay.channel.diandi.service.DiandiPayExtension;
import com.bonus.core.pay.channel.ecitic.service.EciticPayExtension;
import com.bonus.core.pay.channel.fuiou.service.FuiouPayExtension;
import com.bonus.core.pay.channel.gsrcu.service.GsrcuPayExtension;
import com.bonus.core.pay.channel.icbc.service.ICBCPayExtension;
import com.bonus.core.pay.channel.lcsw.service.LcswPayExtension;
import com.bonus.core.pay.channel.nbcb.service.NbcbPayExtension;
import com.bonus.core.pay.channel.other.extension.OtherPayExtension;
import com.bonus.core.pay.channel.sqb.extension.SqbPayExtension;
import com.bonus.core.pay.channel.szrcb.service.SzrcbPayExtension;
import com.bonus.core.pay.channel.tcrcb.service.TcrcbPayExtension;
import com.bonus.core.pay.channel.third.extension.ThirdPayExtension;
import com.bonus.core.pay.channel.ums.extension.UmsPayExtension;
import com.bonus.core.pay.channel.wechat.extension.WechatPayExtension;
import com.bonus.core.pay.channel.wxrcb.service.WxrcbPayExtension;

import java.util.*;
import java.util.stream.Collectors;

public enum PayChannelEnum {
   ACC(1, "乐牛系统账户", AccPayExtension.class),
   WECHAT(2, "微信", WechatPayExtension.class),
   ALI(3, "支付宝", AliPayExtension.class),
   MIXTURE(4, "混合支付", (Class)null),
   ABC(5, "农业银行", ABCPayExtension.class),
   SQB(6, "收钱吧", SqbPayExtension.class),
   OTHER(7, "其他", OtherPayExtension.class),
   ICBC(8, "工商银行", ICBCPayExtension.class),
   THIRD(9, "第三方支付", ThirdPayExtension.class),
   CASH(10, "现金", OtherPayExtension.class),
   UNION_PAY(11, "银联（云闪付）", (Class)null),
   CMB_PAY(12, "招商银行", CMBPayExtension.class),
   COUPON(13, "餐券支付", CouponPayExtension.class),
   WX_RCB(14, "无锡农商行", WxrcbPayExtension.class),
   ECITIC_PAY(15, "中信银行", EciticPayExtension.class),
   CCB(17, "建设银行", CcbPayExtension.class),
   LENIU_SYSTEM(20, "乐牛系统", (Class)null),
   OLD_LENIU_SYSTEM_IMPORT(21, "老系统导入", (Class)null),
   CIB_PAY(22, "兴业银行", CIBPayExtension.class),
   BOC(23, "中国银行", (Class)null),
   HEBEI_CCB(24, "河北建设银行", (Class)null),
   SZRCB(25, "苏州农商银行", SzrcbPayExtension.class),
   ALLIN_PAY(26, "通联支付", (Class)null),
   HMS_CHINA_PAY(27, "银联支付", UmsPayExtension.class),
   FUIOU_PAY(28, "富友支付", FuiouPayExtension.class),
   TCRCB(29, "太仓农商行", TcrcbPayExtension.class),
   NBCB(30, "宁波银行", NbcbPayExtension.class),
   BNJ(31, "南京银行", BNJPayExtension.class),
   WECHAT_CARD(32, "腾讯微卡", (Class)null),
   KSRCB(33, "昆山农商行", (Class)null),
   HBZF(34, "和包支付", (Class)null),
   XIAOMI(35, "小米支付", (Class)null),
   TAIKANG(36, "泰康聚合支付", (Class)null),
   JSB(37, "江苏银行", (Class)null),
   LCSW(38, "扫呗支付", LcswPayExtension.class),
   DIANDI_PAY(39, "点滴支付", DiandiPayExtension.class),
   YUAN_QI(40, "源启统一支付", (Class)null),
   HMS_CHINA_PAY_CAMPUS(41, "银联园区版", (Class)null),
   GSRCU(42, "甘肃农信社", GsrcuPayExtension.class),
   BJJL(43, "北京嘉利", (Class)null),
   SODEXO(44, "索迪斯支付", (Class)null),
   TC_SSC(45, "太仓社保卡支付", (Class)null),
   HSB_PAY(46, "徽商银行支付", (Class)null),
   DATALOOK_PAY(47, "迪科聚合支付", (Class)null);

   private final Integer key;
   private final String desc;
   private final Class<?> beanClass;
   private static final Map<Integer, String> keyMap = (Map)Arrays.stream(values()).collect(Collectors.toMap(PayChannelEnum::getKey, PayChannelEnum::getDesc, (k1, k2) -> {
      return k2;
   }));

   private PayChannelEnum(Integer key, String desc, Class beanName) {
      this.key = key;
      this.desc = desc;
      this.beanClass = beanName;
   }

   public static String getDesc(Integer key) {
      return (String)keyMap.getOrDefault(key, "");
   }

   public static Optional<Class<?>> getBeanClass(Integer key) {
      PayChannelEnum[] var1 = values();
      int var2 = var1.length;

      for(int var3 = 0; var3 < var2; ++var3) {
         PayChannelEnum channelEnum = var1[var3];
         if (channelEnum.getKey().equals(key)) {
            return Optional.ofNullable(channelEnum.getBeanClass());
         }
      }

      return Optional.empty();
   }

   public static List<Map<String, Object>> getAllEnumsList() {
      PayChannelEnum[] enums = values();
      List<Map<String, Object>> list = new ArrayList();
      PayChannelEnum[] var2 = enums;
      int var3 = enums.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         PayChannelEnum channelEnum = var2[var4];
         Map<String, Object> map = new HashMap();
         map.put("key", channelEnum.getKey());
         map.put("value", channelEnum.getDesc());
         list.add(map);
      }

      return list;
   }

   public static List<PayChannelEnum> getAllEnumsListForAccRecharge() {
      List<PayChannelEnum> typeList = new ArrayList();
      typeList.add(WECHAT);
      typeList.add(ALI);
      typeList.add(ABC);
      typeList.add(ICBC);
      typeList.add(SQB);
      typeList.add(CASH);
      typeList.add(OLD_LENIU_SYSTEM_IMPORT);
      typeList.add(THIRD);
      typeList.add(OTHER);
      typeList.add(CMB_PAY);
      typeList.add(CIB_PAY);
      typeList.add(CCB);
      typeList.add(SZRCB);
      typeList.add(FUIOU_PAY);
      typeList.add(NBCB);
      typeList.add(BNJ);
      typeList.add(TCRCB);
      typeList.add(ECITIC_PAY);
      typeList.add(KSRCB);
      typeList.add(WX_RCB);
      typeList.add(HMS_CHINA_PAY);
      typeList.add(LCSW);
      typeList.add(DIANDI_PAY);
      typeList.add(GSRCU);
      return typeList;
   }

   public static List<Integer> getBankPayChannelList() {
      List<Integer> typeList = new ArrayList();
      typeList.add(ABC.getKey());
      typeList.add(ICBC.getKey());
      typeList.add(CMB_PAY.getKey());
      typeList.add(WX_RCB.getKey());
      typeList.add(ECITIC_PAY.getKey());
      typeList.add(CCB.getKey());
      typeList.add(CIB_PAY.getKey());
      typeList.add(BOC.getKey());
      typeList.add(HEBEI_CCB.getKey());
      typeList.add(SZRCB.getKey());
      typeList.add(TCRCB.getKey());
      typeList.add(NBCB.getKey());
      typeList.add(BNJ.getKey());
      typeList.add(HMS_CHINA_PAY.getKey());
      typeList.add(DIANDI_PAY.getKey());
      typeList.add(GSRCU.getKey());
      return typeList;
   }

   public static List<Integer> getOtherPayChannelList() {
      List<Integer> typeList = new ArrayList();
      typeList.add(SQB.getKey());
      typeList.add(OTHER.getKey());
      typeList.add(UNION_PAY.getKey());
      typeList.add(LENIU_SYSTEM.getKey());
      typeList.add(OLD_LENIU_SYSTEM_IMPORT.getKey());
      typeList.add(ALLIN_PAY.getKey());
      typeList.add(FUIOU_PAY.getKey());
      typeList.add(WECHAT_CARD.getKey());
      typeList.add(LCSW.getKey());
      return typeList;
   }

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

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

   public Class<?> getBeanClass() {
      return this.beanClass;
   }

   // $FF: synthetic method
   private static PayChannelEnum[] $values() {
      return new PayChannelEnum[]{ACC, WECHAT, ALI, MIXTURE, ABC, SQB, OTHER, ICBC, THIRD, CASH, UNION_PAY, CMB_PAY, COUPON, WX_RCB, ECITIC_PAY, CCB, LENIU_SYSTEM, OLD_LENIU_SYSTEM_IMPORT, CIB_PAY, BOC, HEBEI_CCB, SZRCB, ALLIN_PAY, HMS_CHINA_PAY, FUIOU_PAY, TCRCB, NBCB, BNJ, WECHAT_CARD, KSRCB, HBZF, XIAOMI, TAIKANG, JSB, LCSW, DIANDI_PAY, YUAN_QI, HMS_CHINA_PAY_CAMPUS, GSRCU, BJJL, SODEXO, TC_SSC, HSB_PAY, DATALOOK_PAY};
   }
}
