package com.engine.htsc.subpayment.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * k1810012
 * 子公司付款类型
 */
public enum SubPay {

  ZG_REI("0", "zgtybx", "htpt",
          "com.engine.htsc.payment.service.impl.HeadBxBudgetCommand"), //资管通用报销
  ZJ_REI("1", "zjtybx", "htpt",
          "com.engine.htsc.payment.service.impl.ZjBxBudgetCommand"), //紫金通用报销
  ZGS_REI("2", "zgstybx", "htpt",
          "com.engine.htsc.payment.service.impl.HeadBxBudgetCommand"), //子公司报销
  ZG_TRAVEL("3", "zgclbx", "htpt",
          "com.engine.htsc.payment.service.impl.HeadClBxBudgetCommand"), //资管差旅报销
  ZJ_TRAVEL("4", "zjclbx", "htpt",
          "com.engine.htsc.payment.service.impl.HeadClBxBudgetCommand"),//紫金差旅报销
  CGSC_TRAVEL("4", "cgscfk", "htpt",
          "com.engine.htsc.payment.service.impl.SettlePaymentCommand"),
  ZGS_TRAVEL("5", "zgsclbx", "htpt",
          "com.engine.htsc.payment.service.impl.SettlePaymentCommand"), //子公司差旅报销
  ZGTY_PAY("6", "zgtyfk", "htfk",
          "com.engine.htsc.payment.service.impl.HeadPaymentBudgetCommand"), //资管通用付款
  ZJTY_PAY("7", "zjtyfk", "htfk",
          "com.engine.htsc.payment.service.impl.HeadPaymentBudgetCommand"); //资管通用付款

  SubPay(String type, String value, String lb, String commandClassName) {
    this.type = type;
    this.value = value;
    this.lb = lb;
    this.commandClassName = commandClassName;
  }

  private final String type;
  private final String value;
  private final String lb;
  private final String commandClassName;

  public String getType() {
    return type;
  }

  public String getValue() {
    return value;
  }

  public String getLb() {
    return lb;
  }

  public String getCommandClassName() {
    return commandClassName;
  }

  public static String getUnNumberByType(String type) {
    if (StringUtils.isBlank(type)) {
      return "";
    }
    String unNumber = "";
    for (SubPay value : SubPay.values()) {
      if (value.type.equalsIgnoreCase(type)) {
        unNumber = value.value;
        break;
      }
    }
    return unNumber;
  }

  public static String getClassByType(String type) {
    if (StringUtils.isBlank(type)) {
      return "";
    }
    String className = "";
    for (SubPay value : SubPay.values()) {
      if (value.type.equalsIgnoreCase(type)) {
        className = value.commandClassName;
        break;
      }
    }
    return className;
  }

  public static String getLbByType(String type) {
    if (StringUtils.isBlank(type)) {
      return "";
    }
    String lb = "";
    for (SubPay value : SubPay.values()) {
      if (value.type.equalsIgnoreCase(type)) {
        lb = value.lb;
        break;
      }
    }
    return lb;
  }
}
