代码拉取完成,页面将自动刷新
获取单元格内容函数未针对日期类型处理
ExcelUtils.getContent(src :
public static String getContent(Sheet src, int rowNum, int colNum) {
if(colNum < src.getRow(rowNum).length) {
return src.getRow(rowNum)[colNum].getContents().trim();
} else {
return null;
}
}
临时增加单元格日期类型判断和返回解决问题
Cell cell=src.getRow(rowNum)[colNum];
if(cell.getType()== CellType.DATE){
DateCell dateCell = (DateCell) cell;
Date date = dateCell.getDate();
return new SimpleDateFormat("yyyy-MM-dd").format(date);
}else{
return src.getRow(rowNum)[colNum].getContents().trim();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
如果不处理是会出现日期格式错误吗
登录 后才可以发表评论