AnnexActEnum.java 733 B

123456789101112131415161718192021222324252627282930313233343536
  1. package com.ruoyi.warehouseBusiness.domain.enums;
  2. import lombok.AllArgsConstructor;
  3. import lombok.Getter;
  4. import java.util.Objects;
  5. /**
  6. * @author caifc
  7. * @date 2021-10-22 17:19
  8. */
  9. @Getter
  10. @AllArgsConstructor
  11. public enum AnnexActEnum {
  12. // 活动号
  13. STORAGE_FEE(1L, "仓储费协议"),
  14. HOMEWORK_FEE(10L, "作业费协议"),
  15. WAREHOUSE(30L, "仓库"),
  16. ;
  17. private final Long type;
  18. private final String name;
  19. public static AnnexActEnum fromType(Long tp) {
  20. for (AnnexActEnum type : AnnexActEnum.values()) {
  21. if (Objects.equals(type.getType(), tp)) {
  22. return type;
  23. }
  24. }
  25. throw new IllegalArgumentException("fees type not exist");
  26. }
  27. }