LiquidationState.java 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package com.goafanti.order.enums;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. public enum LiquidationState {
  5. /** 首付待付清 **/
  6. WAIT_PAY_FIRST_BALANCE(0,"首付待付清"),
  7. /** 尾款待付清 **/
  8. WAIT_PAY_LAST_BALANCE(1,"尾款待付清"),
  9. /** 已付清 **/
  10. ALREADY_PAY(2,"已付清"),
  11. /** 退款待确认 **/
  12. WAIT_FOR_REFUND_CONFIRM(3,"退款待确认"),
  13. /** 退款已同意 **/
  14. AGREE_REFUND(4,"退款中"),
  15. /** 退款已拒绝 **/
  16. REFUSE_REFUND(5,"拒绝退款"),
  17. /** 退款已完成 **/
  18. COMPLETE_REFUND(6,"退款已完成"),
  19. /** 待提现 **/
  20. WAIT_FOR_WITHDRAW(7,"待提现"),
  21. /** 已提现 **/
  22. ALREADY_WITHDRAW(8,"已提现"),
  23. /** 无效 **/
  24. INVALID(10, "INVALID");
  25. private LiquidationState(Integer code, String desc) {
  26. this.code = code;
  27. this.desc = desc;
  28. }
  29. private static Map<Integer, LiquidationState> status = new HashMap<Integer, LiquidationState>();
  30. static {
  31. for (LiquidationState value : LiquidationState.values()) {
  32. status.put(value.getCode(), value);
  33. }
  34. }
  35. public static LiquidationState getStatus(Integer code) {
  36. if (containsType(code)) {
  37. return status.get(code);
  38. }
  39. return INVALID;
  40. }
  41. public static boolean containsType(Integer code) {
  42. return status.containsKey(code);
  43. }
  44. private Integer code;
  45. private String desc;
  46. public Integer getCode() {
  47. return code;
  48. }
  49. public void setCode(Integer code) {
  50. this.code = code;
  51. }
  52. public String getDesc() {
  53. return desc;
  54. }
  55. public void setDesc(String desc) {
  56. this.desc = desc;
  57. }
  58. }