当前位置:网站首页>EasyExcel 使用Converter 转换注入时报nullPoint异常
EasyExcel 使用Converter 转换注入时报nullPoint异常
2022-07-19 14:43:00 【地平线上的新曙光】
使用EasyExcel报表导入导出时对其中的字段进行转换
@Override
public CellData convertToExcelData(String code, ExcelContentProperty excelContentProperty, GlobalConfiguration globalConfiguration) throws Exception {
if(StringUtils.isBlank(code)){
return new CellData("");
}else {
try {
RedisUtils redisUtils = SpringUtil.getBean(RedisUtils.class);
String s = redisUtils.get("WYM" + code);
log.info("单位:" + s);
return new CellData(s);
}catch (Exception e){
log.error("错误",e);
return new CellData(code);
}
}
}
这里我需要使用RedisUtils,刚开始我是直接使用@Autowired注解来注入的但是一直报空指针,改成上面的方法来注入就可以解决问题了
边栏推荐
- promise
- 初识Redis(一)
- Enhanced aggregation, theme, data warehouse DWB, DWS layer dimensionality reduction, video, review for the first time, 220620,
- Leetcode57 insert interval details
- Learning Deep Classifiers Consistent With Fine-Grained Novelty DetectionCVPR2021开放集识别论文解读
- Introduction to incluxdb
- Import changes and enable auto import of idea
- Improve the mirror station configuration information - mirror station experience Officer
- Leetcode thought notes for questions
- Explain output analysis of MySQL
猜你喜欢
Detailed explanation of parental delegation model and destructive parental delegation model
零拷贝真的很重要!!!
Redis和mysql数据怎么保持数据一致的?
Li Hongyi, machine learning 3 Gradient descent
10. Thread
Leetcode57-插入区间详解
Generalized odin: Detecting out-of-distribution image without learning from out-of-distribution data
11. 处理机调度的概念、层次
Apifox quick survey
二进制、八进制、十进制、十六进制之间的转换
随机推荐
判断两个时间端是否含有交集
FRP实现内网穿透通过公网服务器实现对外暴露内网服务
Learning Placeholders for Open-Set Recognition
[comprehensive pen test] difficulty 4/5, classic application of line segment tree for character processing
Swagger(或Postman)关于日期类型的传参方式
Review the first time, 220617, DWD layer, DWB layer, video,
Explain output analysis of MySQL
LeetCode78-子集详解
Redis过期删除是如何做的?
C语言的学习之路(一)——初识C语言
# 搭建用户行为分析系统(一)——概述
初识Redis(一)
Worthington core enzyme -- application field of trypsin
2019 十大国产开源项目来势汹汹
Leetcode thought notes for questions
Acquisition and pretreatment of vibration signal
C2AE: Class Conditioned Auto-Encoder for Open-Set RecognitionCVPR2019开放集识别论文解读
微信授权登录
Zero copy is really important!!!
redis中RDB和AOF两种持久化方式的比较