yanghb
2024-12-17 1287337fd0b0c156ec79712f9a600ebeffefe3a6
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
package com.zzg.web.core.enums;
 
import com.zzg.system.domain.vo.*;
 
/**
 * 模板文件类型 enum
 * 为了方便引入所以放在这个包里面
 *
 * @date 2024/09/05
 */
public enum TemplateFileTypeEnum {
    FILE_1(1, StateProjectCompensateStandardVO.class, "补偿标准导入模板.xlsx"),
    FILE_2(2, StateHouseholdImportVO.class, "房产导入模板.xlsx"),
    FILE_3(3, StateProjectCompensateStandardVO.class, "房产导出.xlsx"),
    FILE_4(4, ImportSettlementTemplateCurrencyVO.class, "安置货币补偿导入模板.xlsx"),
    FILE_5(5, SettleDetailExportVO.class, "安置详情.xlsx"),
    FILE_6(6, ApplyOwnerVO.class, "权利人导入模板.xlsx"),
 
    FILE_7(7, ImportSettlementTemplatePropertyVO.class, "安置产权置换导入模板.xlsx"),
 
    ;
 
 
    private final Integer fileType;
    private final Class<?> clazz;
    private final String fileName;
 
    TemplateFileTypeEnum(Integer fileType, Class<?> clazz, String fileName) {
        this.fileType = fileType;
        this.clazz = clazz;
        this.fileName = fileName;
    }
 
    public Integer getFileType() {
        return fileType;
    }
 
    public Class<?> getClazz() {
        return clazz;
    }
 
    public String getFileName() {
        return fileName;
    }
 
    public static Class<?> getClazzByFileType(Integer fileType) {
        for (TemplateFileTypeEnum file : TemplateFileTypeEnum.values()) {
            if (file.getFileType().equals(fileType)) {
                return file.getClazz();
            }
        }
        throw new IllegalArgumentException("Invalid file name: " + fileType);
    }
 
    public static TemplateFileTypeEnum getEnumByFileType(Integer fileType) {
        for (TemplateFileTypeEnum file : TemplateFileTypeEnum.values()) {
            if (file.getFileType().equals(fileType)) {
                return file;
            }
        }
        throw new IllegalArgumentException("Invalid file name: " + fileType);
    }
}