jeecgboot / autopoi

AutoPOI 功能如同名字auto,追求的就是自动化,让一个没接触过poi的人员,可以傻瓜化的快速实现Excel导入导出、Word模板导出、可以仅仅5行代码就可以完成Excel的导入导出。
http://www.jeecg.com
Apache License 2.0
477 stars 204 forks source link

当字段为Integer类型,excel导入,dict翻译时候,如果字段值有空格等情况不会自动过滤,而且很难排查 #124

Open 490937333 opened 2 months ago

490937333 commented 2 months ago

当字段为Integer类型,比如sex性别,字典里面性别1男 2女,如果excel输入的时候 是“女空格”的话,就无法处理,转换也不行,转换需要字段类型一致的情况 转换会报错,提示 Excel 值获取失败 ERROR o.jeecgframework.poi.excel.imports.CellValueServer:284 - For input string: "女 " java.lang.NumberFormatException: For input string: "女 " at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.valueOf(Integer.java:766)