New file |
| | |
| | | package com.moral.api.pojo.enums; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.EnumValue; |
| | | import com.fasterxml.jackson.annotation.JsonCreator; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.moral.api.exception.BusinessException; |
| | | import lombok.Getter; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @ClassName StateEnum |
| | | * @Description TODO |
| | | * @Author @lizijie |
| | | * @Date 2023-09-20 11:11 |
| | | * @Version 1.0 |
| | | */ |
| | | @Getter |
| | | @JsonFormat(shape = JsonFormat.Shape.OBJECT) |
| | | public enum FileTableEnum implements IntegerValueEnum { |
| | | /** |
| | | *交办单基础 |
| | | */ |
| | | ALLOCATION_FOUNDATION(1010201, "交办单基础"), |
| | | /** |
| | | *交办单整改 |
| | | */ |
| | | ALLOCATION_RECTIFICATION(1010202, "交办单整改"), |
| | | /** |
| | | *交办单审批 |
| | | */ |
| | | ALLOCATION_APPROVE(1010203, "交办单审批"), |
| | | |
| | | /** |
| | | *延期申请 |
| | | */ |
| | | ALLOCATION_EXTENSION(1251701, "延期申请"), |
| | | |
| | | ; |
| | | |
| | | @EnumValue |
| | | public final Integer value; |
| | | public final String name; |
| | | |
| | | FileTableEnum(Integer value, String name) { |
| | | this.value = value; |
| | | this.name = name; |
| | | } |
| | | |
| | | private static Map<Integer, FileTableEnum> valueMap = new HashMap<>(); |
| | | static { |
| | | for (FileTableEnum v : FileTableEnum.values()) { |
| | | valueMap.put(v.value, v); |
| | | } |
| | | } |
| | | @JsonCreator |
| | | public static FileTableEnum getByValue(Integer value) { |
| | | if (value == null) { |
| | | return null; |
| | | } |
| | | FileTableEnum result = valueMap.get(value); |
| | | if (result == null) { |
| | | throw new BusinessException("枚举转换异常" + value); |
| | | } |
| | | return result; |
| | | } |
| | | } |