package com.bonus.canteen.core.supply.purchase.constants;

import com.google.common.collect.Lists;

import java.util.List;

public enum DrpApproveStatusEnum {
   WAIT_APPROVE(1, "待审批"),
   IN_APPROVE(2, "审批中"),
   AGREE_APPROVE(3, "审批同意"),
   REJECT_APPROVE(4, "审批拒绝"),
   CANCEL(5, "已撤销");

   private final Integer key;
   private final String value;

   private DrpApproveStatusEnum(Integer key, String value) {
      this.key = key;
      this.value = value;
   }

   public static Integer getKey(String value) {
      DrpApproveStatusEnum[] enums = values();
      DrpApproveStatusEnum[] var2 = enums;
      int var3 = enums.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         DrpApproveStatusEnum temp = var2[var4];
         if (temp.value().equals(value)) {
            return temp.key();
         }
      }

      return null;
   }

   public static String getValue(Integer key) {
      DrpApproveStatusEnum[] enums = values();
      DrpApproveStatusEnum[] var2 = enums;
      int var3 = enums.length;

      for(int var4 = 0; var4 < var3; ++var4) {
         DrpApproveStatusEnum temp = var2[var4];
         if (temp.key().equals(key)) {
            return temp.value();
         }
      }

      return null;
   }

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

   public String value() {
      return this.value;
   }

   public static List<Integer> getApproveAgreeAndReject() {
      return Lists.newArrayList(new Integer[]{AGREE_APPROVE.key, REJECT_APPROVE.key});
   }

   public static List<Integer> getApproveWait() {
      return Lists.newArrayList(new Integer[]{WAIT_APPROVE.key, IN_APPROVE.key});
   }
}
