@Data public class Demo { @ExcelProperty({"责任人","姓名"}) private String name; @ExcelProperty({"责任人","手机号"}) private String mobile; @ExcelProperty({"创建人","姓名"}) private String cName; @ExcelProperty({"创建人","手机号"}) private String cMobile; public Demo(String name,String mobile, String cName,String cMobile){ this.name = name; this.mobile = mobile; this.cName = cName; this.cMobile = cMobile; }
public static void main(String[] args) {
a();
}
public static void a(){
List<Demo> demoList = new ArrayList<>();
demoList.add(new Demo("1","2","3","4"));
demoList.add(new Demo("1","2","3","4"));
demoList.add(new Demo("1","2","3","4"));
EasyExcel.write("C:\\Users\\tzxx\\Desktop\\1234.xlsx",Demo.class)
.sheet("报销").doWrite(demoList);
}
}
上边是我测试的写出时 出现的问题 创建人的 姓名和手机号都没值