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())