Merge pull request #4332 from dataease/pr@dev@fix_details-null-error

fix(视图): 修复导出视图明细当有空值时报错的问题
This commit is contained in:
王嘉豪 2023-01-09 20:04:25 +08:00 committed by GitHub
commit 8dc7c110d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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