1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
| package com.ruoyi.common.enums;
|
| public enum FileNameType {
|
| SALE(1), // 销售
| PURCHASE(2), // 采购
| INVOICE(3), //发票
| PURCHASELEDGER(4); //
|
| private final int value;
|
| FileNameType(int value) {
| this.value = value;
| }
|
| public int getValue() {
| return value;
|
| }
|
| // 根据整数值获取对应的枚举值
| public static FileNameType fromValue(int value) {
| for (FileNameType type : FileNameType.values()) {
| if (type.getValue() == value) {
| return type;
| }
| }
| throw new IllegalArgumentException("Invalid value: " + value);
| }
| }
|
|