ContactorStatusEnum.java 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. package com.care.common.enums;
  2. import cn.hutool.core.util.StrUtil;
  3. /**
  4. * @Author:java
  5. * @Date: 2021/05/27
  6. */
  7. public enum ContactorStatusEnum {
  8. /**
  9. *
  10. */
  11. WEI_LIAN_XI(1,"未联系"),
  12. WEI_JIE_TONG(2,"未接通"),
  13. YI_LIAN_XI(3,"已联系"),
  14. WU_FA_GAN_WANG(4,"无法赶往"),
  15. YI_GAN_WANG(5,"已赶往"),
  16. YI_DAO_DA(6,"已到达"),
  17. SHEN_QING_YAO_SHI(7,"申请钥匙"),
  18. YI_HUO_QU_YAOS_HI(8,"已获取钥匙"),
  19. GUI_HUAN_YAOS_HI(9,"归还钥匙");
  20. private Integer value;
  21. private String name;
  22. ContactorStatusEnum(Integer value, String name) {
  23. this.value = value;
  24. this.name = name;
  25. }
  26. public Integer getValue() {
  27. return value;
  28. }
  29. public static String getCodeToName(Integer code){
  30. if (code == null){
  31. return null;
  32. }
  33. if (WEI_LIAN_XI.getValue().intValue() == code.intValue()){
  34. return WEI_LIAN_XI.name;
  35. }else if (WEI_JIE_TONG.getValue().intValue() == code.intValue()){
  36. return WEI_JIE_TONG.name;
  37. }else if (YI_LIAN_XI.getValue().intValue() == code.intValue()){
  38. return YI_LIAN_XI.name;
  39. }else if (WU_FA_GAN_WANG.getValue().intValue() == code.intValue()){
  40. return WU_FA_GAN_WANG.name;
  41. }else if (YI_GAN_WANG.getValue().intValue() == code.intValue()){
  42. return YI_GAN_WANG.name;
  43. }else if (YI_DAO_DA.getValue().intValue() == code.intValue()){
  44. return YI_DAO_DA.name;
  45. }else if (SHEN_QING_YAO_SHI.getValue().intValue() == code.intValue()){
  46. return SHEN_QING_YAO_SHI.name;
  47. }else if (YI_HUO_QU_YAOS_HI.getValue().intValue() == code.intValue()){
  48. return YI_HUO_QU_YAOS_HI.name;
  49. }else if (GUI_HUAN_YAOS_HI.getValue().intValue() == code.intValue()){
  50. return GUI_HUAN_YAOS_HI.name;
  51. }
  52. return null;
  53. }
  54. }