From dafdefd378a2807da1724ed94bc07ed48c80fc01 Mon Sep 17 00:00:00 2001 From: FCL Date: Wed, 5 Nov 2025 17:22:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=8A=A5=E5=91=8A=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reportdoc/service/ReportDocumentDataServiceImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java index 5ef65e5..d44beb8 100644 --- a/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java +++ b/zt-module-qms/zt-module-qms-server/src/main/java/com/zt/plat/module/qms/business/reportdoc/service/ReportDocumentDataServiceImpl.java @@ -107,6 +107,8 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService * @param customConfig 报告配置项 * */ private List assembleStep1(List fieldList, List dataList, String customConfig){ + if(dataList.isEmpty()) + return new ArrayList<>(); JSONObject jsonObject = JSONObject.parseObject(customConfig); Integer dynamicColCount = 3; Integer fixedColCount = 3; @@ -263,8 +265,10 @@ public class ReportDocumentDataServiceImpl implements ReportDocumentDataService String colKey = colPrefix + "01"; t = new JSONObject(); t.put(colKey, "以下为空白"); - int rowIndex = (dataLength + emptyRowCount) * (rowAssist) + 1; - rowList.set(rowIndex + 1, t.clone()); + int rowIndex = (dataLength + emptyRowCount) * (rowAssist) + 2; + if(rowAssist == 1) + rowIndex = dataLength + emptyRowCount; + rowList.set(rowIndex, t.clone()); } //前面的计数是从1开始,移除第一个元素 if(!rowList.isEmpty())