FlowStatusEnum.java 957 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. package com.fjhx.sale.enums;
  2. import org.apache.commons.collections4.MapUtils;
  3. import java.util.LinkedHashMap;
  4. import java.util.Map;
  5. /**
  6. * 流程审批状态枚举
  7. */
  8. public enum FlowStatusEnum {
  9. DRAFT(0, "草稿"),
  10. UNDER_REVIEW(10, "审批中"),
  11. REJECT(20, "驳回"),
  12. PASS(30,"通过"),
  13. ;
  14. private int key;
  15. private String value;
  16. private static Map<Integer, String> map = new LinkedHashMap<>();
  17. FlowStatusEnum(int key, String value) {
  18. this.key = key;
  19. this.value = value;
  20. }
  21. /**
  22. * 获取枚举map
  23. *
  24. * @return
  25. */
  26. public static Map<Integer, String> getMap() {
  27. if (MapUtils.isNotEmpty(map)) {
  28. return map;
  29. }
  30. for (FlowStatusEnum ms : values()) {
  31. map.put(ms.key, ms.value);
  32. }
  33. return map;
  34. }
  35. public int getKey() {
  36. return key;
  37. }
  38. public String getValue() {
  39. return value;
  40. }
  41. }