From cc918d20eb9a735a889aa47cf20414aad6dbda48 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 4 Jul 2024 16:22:45 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E7=9F=A9=E9=98=B5?= =?UTF-8?q?=E7=AE=A1=E7=90=86-=E5=AF=BC=E5=87=BA=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=A1=B9=E7=9F=A9=E9=98=B5=E6=95=B0=E6=8D=AE=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1182565325570048]矩阵管理-导出配置项矩阵数据异常 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1182565325570048 --- .../module/cmdb/matrix/handler/CiDataSourceHandler.java | 7 +++---- .../matrix/handler/CmdbCustomViewDataSourceHandler.java | 8 +++++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/matrix/handler/CiDataSourceHandler.java b/src/main/java/neatlogic/module/cmdb/matrix/handler/CiDataSourceHandler.java index 2eb11d47..c5ecc128 100644 --- a/src/main/java/neatlogic/module/cmdb/matrix/handler/CiDataSourceHandler.java +++ b/src/main/java/neatlogic/module/cmdb/matrix/handler/CiDataSourceHandler.java @@ -318,10 +318,9 @@ public class CiDataSourceHandler extends MatrixDataSourceHandlerBase { JSONArray theadList = getTheadList(attributeVoList); StringBuilder header = new StringBuilder(); List headList = new ArrayList<>(); - for (int i = 0; i < theadList.size(); i++) { - JSONObject obj = theadList.getJSONObject(i); - String title = obj.getString("title"); - String key = obj.getString("key"); + for (MatrixAttributeVo attributeVo : attributeVoList) { + String title = attributeVo.getName(); + String key = attributeVo.getLabel(); if (StringUtils.isNotBlank(title) && StringUtils.isNotBlank(key)) { header.append(title).append(","); headList.add(key); diff --git a/src/main/java/neatlogic/module/cmdb/matrix/handler/CmdbCustomViewDataSourceHandler.java b/src/main/java/neatlogic/module/cmdb/matrix/handler/CmdbCustomViewDataSourceHandler.java index 2ef0e8c5..e9749a4c 100644 --- a/src/main/java/neatlogic/module/cmdb/matrix/handler/CmdbCustomViewDataSourceHandler.java +++ b/src/main/java/neatlogic/module/cmdb/matrix/handler/CmdbCustomViewDataSourceHandler.java @@ -264,7 +264,7 @@ public class CmdbCustomViewDataSourceHandler extends MatrixDataSourceHandlerBase CustomViewConditionVo customViewConditionVo = new CustomViewConditionVo(); customViewConditionVo.setCustomViewId(matrixCmdbCustomViewVo.getCustomViewId()); customViewConditionVo.setCurrentPage(1); - customViewConditionVo.setPageSize(1000); + customViewConditionVo.setPageSize(100); List> dataList = customViewDataService.searchCustomViewData(customViewConditionVo); Integer rowNum = customViewConditionVo.getRowNum(); if (rowNum > 0) { @@ -279,6 +279,9 @@ public class CmdbCustomViewDataSourceHandler extends MatrixDataSourceHandlerBase list = customViewDataService.searchCustomViewData(customViewConditionVo); } if (CollectionUtils.isNotEmpty(list)) { + if (list.size() > customViewConditionVo.getPageSize()) { + list = list.subList(0, customViewConditionVo.getPageSize()); + } StringBuilder content = new StringBuilder(); for (Map map : list) { for (String head : headList) { @@ -536,6 +539,9 @@ public class CmdbCustomViewDataSourceHandler extends MatrixDataSourceHandlerBase rowDataMap.put("uuid", resultObj); } resultList.add(rowDataMap); + if (resultList.size() == dataVo.getPageSize()) { + break; + } } return resultList; } -- Gitee