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 InvestigationEnum |
| | | * @Description TODO |
| | | * @Author @cjl |
| | | * @Date 2023-09-20 14:47 |
| | | * @Version 1.0 |
| | | */ |
| | | @Getter |
| | | @JsonFormat(shape = JsonFormat.Shape.OBJECT) |
| | | public enum AllocationExtensionApproveEnum implements IntegerValueEnum{ |
| | | |
| | | /** |
| | | *未申请 |
| | | */ |
| | | NOT_AAPPROVE(10, "未审批"), |
| | | /** |
| | | *申请中 |
| | | */ |
| | | APPLYING(30, "审批中"), |
| | | /** |
| | | *通过 |
| | | */ |
| | | PASS(40, "通过"), |
| | | /** |
| | | *拒绝 |
| | | */ |
| | | REFUSE(50, "拒绝"), |
| | | |
| | | ; |
| | | |
| | | @EnumValue |
| | | public final Integer value; |
| | | public final String name; |
| | | |
| | | AllocationExtensionApproveEnum(Integer value, String name) { |
| | | this.value = value; |
| | | this.name = name; |
| | | } |
| | | |
| | | private static Map<Integer, AllocationExtensionApproveEnum> valueMap = new HashMap<>(); |
| | | static { |
| | | for (AllocationExtensionApproveEnum v : AllocationExtensionApproveEnum.values()) { |
| | | valueMap.put(v.value, v); |
| | | } |
| | | } |
| | | @JsonCreator |
| | | public static AllocationExtensionApproveEnum getByValue(Integer value) { |
| | | if (value == null) { |
| | | return null; |
| | | } |
| | | AllocationExtensionApproveEnum result = valueMap.get(value); |
| | | if (result == null) { |
| | | throw new BusinessException("枚举转换异常" + value); |
| | | } |
| | | return result; |
| | | } |
| | | } |