PatentInfoStatus.java 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. package com.goafanti.common.enums;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. import org.apache.commons.lang3.StringUtils;
  5. public enum PatentInfoStatus {
  6. CREATE(0, "申请"),
  7. SIGN(1,"签单"),
  8. DELIVERD(2, "派单"),
  9. CIRCULATION(3,"流转"),
  10. COMPOSE(4, "撰写"),
  11. ACCEPT(5, "受理"),
  12. REVIEWNOTICE(6, "审查意见通知"),
  13. REVIEWREPLY(7, "审查意见答复"),
  14. CORRECTIONNOTICE(8, "补正通知"),
  15. CORRECTIONREPLY(9, "补正已答复"),
  16. AUTHORIZE(10, "授权"),
  17. REJECT(11, "驳回"),
  18. LICENSE(12, "发证"),
  19. SETTLEMENT(13, "已结款"),
  20. CALLBACK(14, "退单"),
  21. OTHER(15, "其他");
  22. private Integer code;
  23. private String desc;
  24. private PatentInfoStatus(Integer code, String desc) {
  25. this.code = code;
  26. this.desc = desc;
  27. }
  28. private static Map<Integer, PatentInfoStatus> status = new HashMap<Integer, PatentInfoStatus>();
  29. static {
  30. for (PatentInfoStatus value : PatentInfoStatus.values()) {
  31. status.put(value.getCode(), value);
  32. }
  33. }
  34. public static PatentInfoStatus getStatus(Integer code) {
  35. if (containsType(code)) {
  36. return status.get(code);
  37. }
  38. return OTHER;
  39. }
  40. public static PatentInfoStatus getStatus(String code) {
  41. if (StringUtils.isNumeric(code)) {
  42. return getStatus(Integer.parseInt(code));
  43. }
  44. return OTHER;
  45. }
  46. public static boolean containsType(Integer code) {
  47. return status.containsKey(code);
  48. }
  49. public Integer getCode() {
  50. return code;
  51. }
  52. public String getDesc() {
  53. return desc;
  54. }
  55. }