package com.engine.htsc.branchpayment.enums;

import org.apache.commons.lang3.StringUtils;

/**
 * k1810012
 * 分支机构付款类型
 */
public enum BranchPay {

  GE_PAY("0", "fzjgtyfk", "htfk",
          "com.engine.htsc.payment.service.impl.HeadPaymentBudgetCommand"), //通用付款
  GE_REI("1", "fzjgtybx", "htpt",
          "com.engine.htsc.payment.service.impl.HeadBxBudgetCommand"), //通用报销
  TRA_REI("2", "fzjgclbx", "htcl",
          "com.engine.htsc.payment.service.impl.HeadClBxBudgetCommand"), //差旅报销
  SETTLE_PAY("3", "fzjgsljsfk", "htfk",
          "com.engine.htsc.payment.service.impl.HeadPaymentBudgetCommand"), //商旅结算
  CGSC_TRAVEL("4", "cgscfk", "htfk",
                      "com.engine.htsc.payment.service.impl.SettlePaymentCommand"); //采购商城付款

  BranchPay(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 (BranchPay value : BranchPay.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 (BranchPay value : BranchPay.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 (BranchPay value : BranchPay.values()) {
      if (value.type.equalsIgnoreCase(type)) {
        lb = value.lb;
        break;
      }
    }
    return lb;
  }

}
