From a5debf6cd2b591ec5574f61332e90eb2eedb4244 Mon Sep 17 00:00:00 2001 From: wanxiaoli Date: Thu, 4 Jun 2026 17:58:12 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=AF=BC=E5=87=BA=E8=B6=85?= =?UTF-8?q?=E9=95=BF=E6=8B=93=E6=89=91=E8=BF=9B=E8=A1=8C=E6=88=AA=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../css/service/impl/ProjectServiceImpl.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/business-css/src/main/java/com/yfd/business/css/service/impl/ProjectServiceImpl.java b/business-css/src/main/java/com/yfd/business/css/service/impl/ProjectServiceImpl.java index dc42a9b..81ef5c6 100644 --- a/business-css/src/main/java/com/yfd/business/css/service/impl/ProjectServiceImpl.java +++ b/business-css/src/main/java/com/yfd/business/css/service/impl/ProjectServiceImpl.java @@ -95,7 +95,7 @@ public class ProjectServiceImpl row.createCell(1).setCellValue(p.getCode() == null ? "" : p.getCode()); row.createCell(2).setCellValue(p.getName() == null ? "" : p.getName()); row.createCell(3).setCellValue(p.getDescription() == null ? "" : p.getDescription()); - row.createCell(4).setCellValue(p.getTopology() == null ? "" : p.getTopology()); + row.createCell(4).setCellValue(clampExcelCellText(p.getTopology())); row.createCell(5).setCellValue(p.getCreatedAt() == null ? "" : fmt.format(p.getCreatedAt())); row.createCell(6).setCellValue(p.getUpdatedAt() == null ? "" : fmt.format(p.getUpdatedAt())); row.createCell(7).setCellValue(p.getModifier() == null ? "" : p.getModifier()); @@ -109,6 +109,14 @@ public class ProjectServiceImpl } } + private static String clampExcelCellText(String s) { + if (s == null) return ""; + int max = 32767; + if (s.length() <= max) return s; + if (max <= 3) return s.substring(0, max); + return s.substring(0, max - 3) + "..."; + } + @Override /** * 解析指定项目的拓扑结构,生成节点、边与线性计算计划 @@ -1256,7 +1264,7 @@ public class ProjectServiceImpl row.createCell(1).setCellValue(p.getCode()==null?"":p.getCode()); row.createCell(2).setCellValue(p.getName()==null?"":p.getName()); row.createCell(3).setCellValue(p.getDescription()==null?"":p.getDescription()); - row.createCell(4).setCellValue(p.getTopology()==null?"":p.getTopology()); + row.createCell(4).setCellValue(clampExcelCellText(p.getTopology())); row.createCell(5).setCellValue(p.getVisibility()==null?"":p.getVisibility()); row.createCell(6).setCellValue(p.getCreator()==null?"":p.getCreator()); row.createCell(7).setCellValue(p.getCreatedAt()==null?"":fmt.format(p.getCreatedAt())); @@ -1800,4 +1808,3 @@ public class ProjectServiceImpl // } } -