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

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

View File

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