| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- package com.yingpaipay.business.enumeration;
- import lombok.AccessLevel;
- import lombok.AllArgsConstructor;
- import lombok.Getter;
- import org.springframework.context.i18n.LocaleContextHolder;
- import java.util.Locale;
- @Getter
- @AllArgsConstructor(access = AccessLevel.PRIVATE)
- public enum DocumentStatusEnum {
- UN_UPLOAD(0, "待上传", "Pending Upload"),
- UN_AUDIT(1, "待审核", "Pending Audit"),
- AUDIT_REJECT(2, "审核驳回", "Audit Reject"),
- UN_ARCHIEVED(3, "待归档", "Pending Archieved"),
- ARCHIEVED(4, "已归档", "Archieved"),
- UN_QC(5, "待质控", "Pending QC"),
- QC_PASS(6, "质控通过", "QC Pass"),
- QC_REJECT(7, "质控驳回", "QC Reject"),
- ;
- private final Integer value;
- private final String zhLabel;
- private final String enLabel;
- public static String getLabel(Integer value) {
- if (value == null) {
- return "";
- }
- for (DocumentStatusEnum enumeration : values()) {
- if (enumeration.getValue().equals(value)) {
- return LocaleContextHolder.getLocale().getLanguage().equals("zh") ? enumeration.getZhLabel() : enumeration.getEnLabel();
- }
- }
- throw new IllegalArgumentException("未知状态");
- }
- }
|