fix(视图): 修复导出视图明细当有空值时报错的问题

This commit is contained in:
wangjiahao 2023-01-09 20:00:04 +08:00
parent cbd41dda6f
commit 418ef10bef

View File

@ -755,19 +755,20 @@ public class PanelGroupService {
cell.setCellStyle(cellStyle); cell.setCellStyle(cellStyle);
//设置列的宽度 //设置列的宽度
detailsSheet.setColumnWidth(j, 255 * 20); detailsSheet.setColumnWidth(j, 255 * 20);
} else { } else if (cellValObj != null) {
// with DataType try {
if ((excelTypes[j] == DeTypeConstants.DE_INT || excelTypes[j] == DeTypeConstants.DE_FLOAT) && StringUtils.isNotEmpty(cellValObj.toString())) { // with DataType
try { if ((excelTypes[j] == DeTypeConstants.DE_INT || excelTypes[j] == DeTypeConstants.DE_FLOAT) && StringUtils.isNotEmpty(cellValObj.toString())) {
cell.setCellValue(Double.valueOf(cellValObj.toString())); cell.setCellValue(Double.valueOf(cellValObj.toString()));
} catch (Exception e) { } else {
LogUtil.warn("export excel data transform error"); cell.setCellValue(cellValObj.toString());
} }
} else { } catch (Exception e) {
cell.setCellValue(cellValObj.toString()); LogUtil.warn("export excel data transform error");
} }
} }
} }
} }
} }