GeneStatusEnum.java 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package com.github.jfcloud.gene.constants;
  2. import java.util.Arrays;
  3. import java.util.List;
  4. /**
  5. * 基因定制流程状态
  6. */
  7. public enum GeneStatusEnum {
  8. DRAFT("0", "待提交"),
  9. REJECTED("-1", "驳回"),
  10. GENE_EDITING("20", "基因编辑部门负责人审核"),
  11. PROJECT_LEADER("40", "项目负责人审核"),
  12. PROJECT_MANAGEMENT("60", "项目管理部审核"),
  13. COMPLETED("100", "已完成");
  14. private final String status;
  15. private final String description;
  16. GeneStatusEnum(String status, String description) {
  17. this.status = status;
  18. this.description = description;
  19. }
  20. /**
  21. * 提交状态
  22. */
  23. public static final List<String> SUBMIT_STATUS = Arrays.asList(DRAFT.getStatus(), REJECTED.getStatus());
  24. public String getStatus() {
  25. return status;
  26. }
  27. public String getDescription() {
  28. return description;
  29. }
  30. public static GeneStatusEnum getByStatus(String status) {
  31. for (GeneStatusEnum e : values()) {
  32. if (e.getStatus().equals(status)) {
  33. return e;
  34. }
  35. }
  36. return null;
  37. }
  38. }