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)注解后不能正常读取数据,
没有细究原因,记录下坑
系统推荐
- Cordova+Umi项目搭建步骤
- Oh My ZSH
- JVM垃圾收集器
- Spring Cloud(一):服务治理技术概览【Finchley 版】
- Spring RetryTemplate
- Hadoop 一
- Sublime Text 格式化JSON
- 常用队列
- PasteImageIntoMarkdown插件开发
- JVM异常处理
- Flutter开发需要涉及的知识点大纲
- Mermaid示例
- 随机毒鸡汤:父母说早恋会影响学业,爸妈我对不起你们,我考不过那些早恋的。