Lombok的Accessors导致EasyExcel读取失败
大约 2 分钟
相关代码
@Data
public class XXXXStoreDTO {
@ExcelIgnore
private String aaaa;
@ExcelProperty(value = "*门店编码",index = 0)
private String storeNo;
@ExcelProperty("门店名称")
private String storeName;
@ExcelIgnore
private String bbbb;
}
@Override
public List<XXXXStoreDTO > getStore(String filePath) throws IOException {
URL url = new URL(filePath);
InputStream inputStream = new BufferedInputStream(url.openStream());
List<CampaignStoreDTO> allList = new ArrayList<>();
EasyExcel.read(inputStream, XXXXStoreDTO .class, new PageReadListener<XXXXStoreDTO >(dataList -> {
allList.addAll(dataList);
})).sheet().headRowNumber(1).doRead();
return allList;
}
当XXXXStoreDTO类上没有添加@Accessors(chain = true)注解后不能正常读取数据,
没有细究原因,记录下坑
系统推荐
- 常见问题
- Redis笔记
- Git合并多个提交并push到远程仓库
- Spring Cloud(一):服务治理技术概览【Finchley 版】
- 提取Docker镜像中的文件
- 批量修改git历史记录中的用户名和邮箱
- 分库分表
- 搭建基于docker的elk平台来分析java日志
- AQS源码解读
- Git Merge 、Rebase
- 批量替换文件名中的指定字符串
- 分布式问题
- 随机毒鸡汤:经常废寝,从不忘食。