From 418ef10beff7bf6deeff832af5155113c0ceb2aa Mon Sep 17 00:00:00 2001 From: wangjiahao <1522128093@qq.com> Date: Mon, 9 Jan 2023 20:00:04 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E8=A7=86=E5=9B=BE):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E8=A7=86=E5=9B=BE=E6=98=8E=E7=BB=86=E5=BD=93?= =?UTF-8?q?=E6=9C=89=E7=A9=BA=E5=80=BC=E6=97=B6=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/panel/PanelGroupService.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java index d026e84bc5..665a9c0609 100644 --- a/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java +++ b/backend/src/main/java/io/dataease/service/panel/PanelGroupService.java @@ -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"); } } + } } }