jiangping
2025-03-31 06a46e017886bec692223a626ff50a06b83910cd
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
package com.doumee.core.annotation.excel;
 
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.IndexedColors;
 
import java.lang.annotation.*;
 
/**
 * 标记为Excel导出列
 * @author Eva.Caesar Liu
 * @since 2025/03/31 16:44
 */
@Inherited
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
public @interface ExcelExportColumn {
 
    /**
     * 列名
     */
    String name();
 
    /**
     * 列宽(单位为字符),-1按字段反射顺序排序
     */
    int width() default -1;
 
    /**
     * 排序,值越小越靠前,-1按字段反射顺序排序
     */
    int index() default -1;
 
    /**
     * 对齐方式
     */
    HorizontalAlignment align() default HorizontalAlignment.LEFT;
 
    /**
     * 列头背景色
     */
    IndexedColors backgroundColor() default IndexedColors.GREY_25_PERCENT;
 
    /**
     * 数据单元格的背景色
     */
    IndexedColors dataBackgroundColor() default IndexedColors.WHITE;
 
    /**
     * 字体颜色
     */
    IndexedColors color () default IndexedColors.BLACK;
 
    /**
     * 字体大小(像素)
     */
    short fontSize () default 12;
 
    /**
     * 是否加粗
     */
    boolean bold () default false;
 
    /**
     * 是否倾斜
     */
    boolean italic () default false;
 
    /**
     * 值映射,如0=女;1=男
     */
    String valueMapping() default "";
 
    /**
     * 数据前缀
     */
    String prefix() default "";
 
    /**
     * 数据后缀
     */
    String suffix() default "";
 
    /**
     * 日期格式,只有数据为java.util.Date时才生效
     */
    String dateFormat() default "yyyy-MM-dd";
 
    /**
     * 数据转换器
     */
    Class<? extends ExcelDataConverterAdapter> converter() default ExcelDataConverterAdapter.class;
 
    /**
     * 数据转换器参数
     */
    String[] args() default {};
 
}