PsnSetlWay.java 915 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package thyyxxk.simzfeeoprnsystm.dicts;
  2. import thyyxxk.simzfeeoprnsystm.utils.StringUtil;
  3. /**
  4. * @description: 个人结算方式
  5. * @author: DingJie
  6. * @create: 2021/7/2216:31
  7. */
  8. public enum PsnSetlWay {
  9. SETTLE_BY_ITEMS("01", "按项目结算"),
  10. SETTLE_BY_QUOTA("02", "按定额结算");
  11. private final String code;
  12. private final String name;
  13. PsnSetlWay(String code, String name) {
  14. this.code = code;
  15. this.name = name;
  16. }
  17. public String getCode() {
  18. return code;
  19. }
  20. public String getName() {
  21. return name;
  22. }
  23. public static PsnSetlWay get(String code) {
  24. if (StringUtil.isBlank(code)) {
  25. return null;
  26. }
  27. for (PsnSetlWay psnSetlWay : PsnSetlWay.values()) {
  28. if (code.trim().equals(psnSetlWay.getCode())) {
  29. return psnSetlWay;
  30. }
  31. }
  32. return null;
  33. }
  34. }