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)注解后不能正常读取数据,
没有细究原因,记录下坑
系统推荐
- Git合并多个提交并push到远程仓库
- Nacos-Spring Gateway-Spring boot无感发布
- 弱引用示例
- Hadoop 一
- istio基础知识
- 线上FullGC频繁的排查
- Redis高可用
- 行转列不再复杂:SQL高手都在用的技巧揭秘
- Arthas使用记录
- vuepress-theme-hope使用心得
- sofajraft
- BBR加速
- 随机毒鸡汤:第一个称马尾辫为马尾的人,有没有想过,马尾长在马的哪里?