From fe0b0becb3292afe9f490feb6600a29eace9bf72 Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Wed, 3 Sep 2025 19:49:21 +0800 Subject: [PATCH 01/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D=20#[1500817822023680]=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=BB=84=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D?= =?UTF-8?q?=E9=83=BD=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E2=80=9D=20http://192.168.0.96:8090?= =?UTF-8?q?/demo/rdm.html#/story-detail/939050947543040/939050947543042/15?= =?UTF-8?q?00817822023680?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheckResourceInputNodeListApi.java | 10 ++- .../resource/ExportResourceApi.java | 9 ++ .../resource/ListResourceCustomApi.java | 6 ++ .../mapper/resourcecenter/ResourceMapper.xml | 88 +++++++++++++++++++ .../DefaultResourceCenterDataSourceImpl.java | 8 ++ 5 files changed, 119 insertions(+), 2 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java index faa98653..f8126daf 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java @@ -61,7 +61,7 @@ public class CheckResourceInputNodeListApi extends PrivateApiComponentBase { } @Input({ - @Param(name = "filter", type = ApiParamType.JSONOBJECT, desc = "过滤条件", help="简单过滤条件和高级过滤条件都用这个字段"), + @Param(name = "filter", type = ApiParamType.JSONOBJECT, desc = "过滤条件", help = "简单过滤条件和高级过滤条件都用这个字段"), @Param(name = "cmdbGroupType", type = ApiParamType.STRING, desc = "通过团体过滤权限"), @Param(name = "inputNodeList", type = ApiParamType.JSONARRAY, isRequired = true, minSize = 1, desc = "输入节点列表"), }) @@ -103,7 +103,13 @@ public class CheckResourceInputNodeListApi extends PrivateApiComponentBase { searchVo.setPort(node.getPort()); searchVo.setName(node.getName()); searchVo.setCmdbGroupType(cmdbGroupType); - List idList = resourceMapper.getResourceIdListByDynamicCondition(searchVo, sqlSb.toString()); + //是否存在前置条件 + if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { + StringBuilder preSqlSb = new StringBuilder(); + searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); + searchVo.setPreConditionWhereSql(preSqlSb.toString()); + } + List idList = resourceMapper.getResourceIdListByDynamicCondition(searchVo, sqlSb.toString()); if (CollectionUtils.isEmpty(idList)) { if (!nonExistList.contains(inputNodeObj)) { nonExistList.add(inputNodeObj); diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java index f1de6a86..ce9ea8e8 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java @@ -143,6 +143,12 @@ public class ExportResourceApi extends PrivateBinaryStreamApiComponentBase { ResourceSearchVo searchVo = resourceCenterResourceService.assembleResourceSearchVo(paramObj); resourceCenterResourceService.handleBatchSearchList(searchVo); resourceCenterResourceService.setIpFieldAttrIdAndNameFieldAttrId(searchVo); + //是否存在前置条件 + if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { + StringBuilder preSqlSb = new StringBuilder(); + searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); + searchVo.setPreConditionWhereSql(preSqlSb.toString()); + } int rowNum = resourceMapper.getResourceCount(searchVo); if (rowNum > 0) { searchVo.setPageSize(100); @@ -172,6 +178,7 @@ public class ExportResourceApi extends PrivateBinaryStreamApiComponentBase { /** * 表头信息 + * * @return */ private List getHeaderList() { @@ -198,6 +205,7 @@ public class ExportResourceApi extends PrivateBinaryStreamApiComponentBase { /** * 每列对应的key + * * @return */ private List getColumnList() { @@ -224,6 +232,7 @@ public class ExportResourceApi extends PrivateBinaryStreamApiComponentBase { /** * 资产对象转换成excel中一行数据dataMap + * * @param resourceVo 资产对象 */ private Map resourceConvertDataMap(ResourceVo resourceVo) { diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ListResourceCustomApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ListResourceCustomApi.java index cbb2518c..3c6a9b0a 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ListResourceCustomApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ListResourceCustomApi.java @@ -78,6 +78,12 @@ public class ListResourceCustomApi extends PrivateApiComponentBase { ResourceSearchVo resourceSearch = resourceCenterResourceService.assembleResourceSearchVo(paramObj); List resultList = new ArrayList<>(); StringBuilder sqlSb = new StringBuilder(); + //是否存在前置条件 + if (resourceSearch.getPreCondition() != null && resourceSearch.getPreCondition().isCustomCondition()) { + StringBuilder preSqlSb = new StringBuilder(); + resourceSearch.getPreCondition().buildConditionWhereSql(preSqlSb, resourceSearch.getPreCondition()); + resourceSearch.setPreConditionWhereSql(preSqlSb.toString()); + } resourceSearch.buildConditionWhereSql(sqlSb, resourceSearch); int rowNum = resourceMapper.getResourceCountByDynamicCondition(resourceSearch, sqlSb.toString()); if (rowNum == 0) { diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index 7947f1a2..8cb72ad6 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -200,6 +200,84 @@ along with this program. If not, see .--> + + + + AND a.`type_id` IN + + #{typeId} + + + + AND a.`state_id` IN + + #{stateId} + + + + AND a.`vendor_id` IN + + #{vendorId} + + + + AND a.`env_id` IN + + #{envId} + + + + AND a.`env_id` is null + + + AND a.`app_system_id` IN + + #{appSystemId} + + + + AND a.`app_module_id` IN + + #{appModuleId} + + + + AND a.`id` IN + + #{id} + + + + AND a.`id` IN + + #{id} + + + + AND a.`inspect_status` IN + + #{inspectStatus} + + + + AND c.`protocol_id` IN + + #{protocolId} + + + + AND d.`tag_id` IN + + #{tagId} + + + + AND ajpn.status in + + #{status} + + + @@ -488,6 +568,8 @@ along with this program. If not, see .--> AND (a.`name` LIKE CONCAT('%', #{keyword}, '%') OR a.`ip` LIKE CONCAT('%', #{keyword}, '%')) --> + + ${preConditionWhereSql} group by a.id @@ -529,6 +611,8 @@ along with this program. If not, see .--> ${conditionSql} + + ${searchVo.preConditionWhereSql} ORDER BY sid.`id` LIMIT #{searchVo.startNum}, #{searchVo.pageSize} @@ -1905,6 +1989,8 @@ along with this program. If not, see .--> + + .--> ${conditionSql} - + ${searchVo.preConditionWhereSql} diff --git a/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java b/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java index e7f8854f..e3b066c6 100644 --- a/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java @@ -650,30 +650,30 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS public List getResourceList(ResourceSearchVo searchVo) { String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); List resultList = new ArrayList<>(); - String getResourceIdListSql = resourceBuildSqlService.buildGetResourceIdListSql(searchVo); - List idList = resourceMapper.getIdListBySql(getResourceIdListSql); +// String getResourceIdListSql = resourceBuildSqlService.buildGetResourceIdListSql(searchVo); +// List idList = resourceMapper.getIdListBySql(getResourceIdListSql); //是否存在前置条件 if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { StringBuilder preSqlSb = new StringBuilder(); searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); searchVo.setPreConditionWhereSql(preSqlSb.toString()); } - if (Objects.equals(enable, "1")) { - List oldIdList = resourceMapper.getResourceIdList(searchVo); - if (!Objects.equals(oldIdList, idList)) { - JSONObject errorObj = new JSONObject(); - errorObj.put("idList", idList); - errorObj.put("oldIdList", oldIdList); - logger.error("资产清单新旧SQL获取idList结果不一致:{}", errorObj); - } - } +// if (Objects.equals(enable, "1")) { + List idList = resourceMapper.getResourceIdList(searchVo); +// if (!Objects.equals(oldIdList, idList)) { +// JSONObject errorObj = new JSONObject(); +// errorObj.put("idList", idList); +// errorObj.put("oldIdList", oldIdList); +// logger.error("资产清单新旧SQL获取idList结果不一致:{}", errorObj); +// } +// } if (CollectionUtils.isNotEmpty(idList)) { - String getResourceListSql = resourceBuildSqlService.buildGetResourceListSql(idList); - List resourceList = resourceMapper.getResourceListBySql(getResourceListSql); - if (Objects.equals(enable, "1")) { - List oldResourceList = resourceMapper.getResourceListByIdList(idList); - checkResourceListIsEquals(resourceList, oldResourceList); - } +// String getResourceListSql = resourceBuildSqlService.buildGetResourceListSql(idList); +// List resourceList = resourceMapper.getResourceListBySql(getResourceListSql); +// if (Objects.equals(enable, "1")) { + List resourceList = resourceMapper.getResourceListByIdList(idList); +// checkResourceListIsEquals(resourceList, oldResourceList); +// } //排序 for (Long id : idList) { for (ResourceVo resourceVo : resourceList) { diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java index d754c434..769d226e 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java @@ -25,7 +25,7 @@ import neatlogic.framework.cmdb.dto.ci.AttrVo; import neatlogic.framework.cmdb.dto.ci.CiVo; import neatlogic.framework.cmdb.dto.globalattr.GlobalAttrVo; import neatlogic.framework.cmdb.dto.resourcecenter.AccountComponentVo; -import neatlogic.framework.cmdb.dto.resourcecenter.ResourceConditionConfigVo; +import neatlogic.framework.cmdb.dto.resourcecenter.ResourceCustomConditionConfigVo; import neatlogic.framework.cmdb.dto.resourcecenter.ResourceSearchVo; import neatlogic.framework.cmdb.dto.resourcecenter.ResourceVo; import neatlogic.framework.cmdb.dto.resourcecenter.config.*; @@ -1021,7 +1021,7 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe JSONObject conditionConfigObj = new JSONObject(); conditionConfigObj.put("conditionGroupList", searchVo.getConditionGroupList()); conditionConfigObj.put("conditionGroupRelList", searchVo.getConditionGroupRelList()); - ResourceConditionConfigVo resourceConditionConfigVo = conditionConfigObj.toJavaObject(ResourceConditionConfigVo.class); + ResourceCustomConditionConfigVo resourceConditionConfigVo = conditionConfigObj.toJavaObject(ResourceCustomConditionConfigVo.class); List filterItemFieldNameList2 = resourceConditionConfigVo.getFilterItemFieldNameList(); System.out.println("filterItemFieldNameList2 = " + filterItemFieldNameList2); filterItemFieldNameList.addAll(filterItemFieldNameList2); -- Gitee From d94917b2f3b9666f2c0feb03e2a901762cb18eb1 Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Thu, 4 Sep 2025 16:05:36 +0800 Subject: [PATCH 04/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D=20#[1500817822023680]=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=BB=84=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D?= =?UTF-8?q?=E9=83=BD=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E2=80=9D=20http://192.168.0.96:8090?= =?UTF-8?q?/demo/rdm.html#/story-detail/939050947543040/939050947543042/15?= =?UTF-8?q?00817822023680?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../CheckResourceInputNodeListApi.java | 2 +- .../resource/ExportResourceApi.java | 2 +- .../resource/ListResourceCustomApi.java | 7 +- .../resource/ResourceListApi.java | 6 + .../mapper/resourcecenter/ResourceMapper.java | 4 +- .../mapper/resourcecenter/ResourceMapper.xml | 536 ++++++++---------- .../DefaultResourceCenterDataSourceImpl.java | 2 +- .../resource/ResourceBuildSqlServiceImpl.java | 4 +- 8 files changed, 242 insertions(+), 321 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java index f8126daf..902448bc 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java @@ -107,7 +107,7 @@ public class CheckResourceInputNodeListApi extends PrivateApiComponentBase { if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { StringBuilder preSqlSb = new StringBuilder(); searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); - searchVo.setPreConditionWhereSql(preSqlSb.toString()); + searchVo.getPreCondition().setConditionWhereSql(preSqlSb.toString()); } List idList = resourceMapper.getResourceIdListByDynamicCondition(searchVo, sqlSb.toString()); if (CollectionUtils.isEmpty(idList)) { diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java index ce9ea8e8..16a84033 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java @@ -147,7 +147,7 @@ public class ExportResourceApi extends PrivateBinaryStreamApiComponentBase { if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { StringBuilder preSqlSb = new StringBuilder(); searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); - searchVo.setPreConditionWhereSql(preSqlSb.toString()); + searchVo.getPreCondition().setConditionWhereSql(preSqlSb.toString()); } int rowNum = resourceMapper.getResourceCount(searchVo); if (rowNum > 0) { diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ListResourceCustomApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ListResourceCustomApi.java index 3c6a9b0a..bdb226c8 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ListResourceCustomApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ListResourceCustomApi.java @@ -82,15 +82,16 @@ public class ListResourceCustomApi extends PrivateApiComponentBase { if (resourceSearch.getPreCondition() != null && resourceSearch.getPreCondition().isCustomCondition()) { StringBuilder preSqlSb = new StringBuilder(); resourceSearch.getPreCondition().buildConditionWhereSql(preSqlSb, resourceSearch.getPreCondition()); - resourceSearch.setPreConditionWhereSql(preSqlSb.toString()); + resourceSearch.setConditionWhereSql(preSqlSb.toString()); } resourceSearch.buildConditionWhereSql(sqlSb, resourceSearch); - int rowNum = resourceMapper.getResourceCountByDynamicCondition(resourceSearch, sqlSb.toString()); + resourceSearch.setConditionWhereSql(sqlSb.toString()); + int rowNum = resourceMapper.getResourceCountByDynamicCondition(resourceSearch); if (rowNum == 0) { return TableResultUtil.getResult(resultList, resourceSearch); } resourceSearch.setRowNum(rowNum); - List idList = resourceMapper.getResourceIdListByDynamicCondition(resourceSearch, sqlSb.toString()); + List idList = resourceMapper.getResourceIdListByDynamicCondition(resourceSearch); if (CollectionUtils.isNotEmpty(idList)) { List resourceList = resourceMapper.getResourceListByIdList(idList); if (CollectionUtils.isNotEmpty(resourceList)) { diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceListApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceListApi.java index 12cdf650..9f0b1ca4 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceListApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ResourceListApi.java @@ -105,13 +105,19 @@ public class ResourceListApi extends PrivateApiComponentBase { @Override public Object myDoService(JSONObject jsonObj) throws Exception { ResourceSearchVo searchVo; + ResourceSearchVo preCondition = null; JSONArray defaultValue = jsonObj.getJSONArray("defaultValue"); + //先处理前置过滤器 + if (jsonObj.containsKey("preCondition")) { + preCondition = resourceCenterResourceService.assembleResourceSearchVo(jsonObj.getJSONObject("preCondition")); + } if (CollectionUtils.isNotEmpty(defaultValue)) { searchVo = new ResourceSearchVo(); searchVo.setDefaultValue(defaultValue); } else { searchVo = resourceCenterResourceService.assembleResourceSearchVo(jsonObj); } + searchVo.setPreCondition(preCondition); resourceCenterResourceService.handleBatchSearchList(searchVo); resourceCenterResourceService.setIpFieldAttrIdAndNameFieldAttrId(searchVo); IResourceCenterDataSource resourceCenterDataSource = ResourceCenterDataSourceFactory.getResourceCenterDataSource(); diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java index 9953a999..f06c6119 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java @@ -57,12 +57,12 @@ public interface ResourceMapper extends IResourceCrossoverMapper { int getAllResourceCount(ResourceSearchVo searchVo); - int getResourceCountByDynamicCondition(@Param("searchVo") ResourceSearchVo searchVo, @Param("conditionSql") String conditionSql); + int getResourceCountByDynamicCondition(ResourceSearchVo searchVo); @Deprecated List getResourceIdList(ResourceSearchVo searchVo); - List getResourceIdListByDynamicCondition(@Param("searchVo") ResourceSearchVo searchVo, @Param("conditionSql") String conditionSql); + List getResourceIdListByDynamicCondition(ResourceSearchVo searchVo); @Deprecated List getResourceListByIdList(List idList); diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index 37436aca..e2ecfb66 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -29,7 +29,8 @@ along with this program. If not, see .--> ${sql} - ${sql} @@ -37,7 +38,8 @@ along with this program. If not, see .--> ${sql} - ${sql} @@ -45,7 +47,8 @@ along with this program. If not, see .--> ${sql} - ${sql} @@ -79,7 +82,7 @@ along with this program. If not, see .--> or ( - cg.id is not null and + cg.id is not null and a.`type_id` IN #{typeId} @@ -202,156 +205,137 @@ along with this program. If not, see .--> - + AND a.`type_id` IN #{typeId} - + AND a.`state_id` IN #{stateId} - + AND a.`vendor_id` IN #{vendorId} - + AND a.`env_id` IN #{envId} - + AND a.`env_id` is null - + AND a.`app_system_id` IN #{appSystemId} - + AND a.`app_module_id` IN #{appModuleId} - - AND a.`id` IN - - #{id} - - - - AND a.`id` IN - - #{id} - - - - AND a.`inspect_status` IN - - #{inspectStatus} - - - + AND c.`protocol_id` IN #{protocolId} - + AND d.`tag_id` IN #{tagId} - - AND ajpn.status in - - #{status} - - - + AND a.`type_id` IN #{typeId} - + AND a.`state_id` IN #{stateId} - + AND a.`vendor_id` IN #{vendorId} - + AND a.`env_id` IN #{envId} - + AND a.`env_id` is null - + AND a.`app_system_id` IN - + #{appSystemId} - + AND a.`app_module_id` IN - + #{appModuleId} - + AND a.`id` IN #{id} - + AND a.`id` IN #{id} - + AND a.`inspect_status` IN - + #{inspectStatus} - + AND c.`protocol_id` IN - + #{protocolId} - + AND d.`tag_id` IN #{tagId} - + AND ajpn.status in - + #{status} @@ -411,7 +395,7 @@ along with this program. If not, see .--> LEFT JOIN cmdb_cientity_group ccg ON ccg.cientity_id = a.id LEFT JOIN cmdb_group_auth cga ON ccg.group_id = cga.group_id - + LEFT JOIN cmdb_group cg ON cga.group_id = cg.id AND cg.type in ('autoexec') @@ -439,21 +423,15 @@ along with this program. If not, see .--> resultType="int"> SELECT COUNT(DISTINCT a.`id`) FROM @{DATA_SCHEMA}.`scence_ipobject_detail` a - - LEFT JOIN `cmdb_resourcecenter_resource_account` b ON b.`resource_id` = a.`id` - LEFT JOIN `cmdb_resourcecenter_account` c ON c.`id` = b.`account_id` - - - LEFT JOIN `cmdb_resourcecenter_resource_tag` d ON d.`resource_id` = a.`id` - - - left join autoexec_job_resource_inspect ajri on ajri.resource_id=a.id - left join autoexec_job_phase_node ajpn on ajpn.job_phase_id =ajri.phase_id AND ajpn.resource_id = a.id - + LEFT JOIN `cmdb_resourcecenter_resource_account` b ON b.`resource_id` = a.`id` + LEFT JOIN `cmdb_resourcecenter_account` c ON c.`id` = b.`account_id` + LEFT JOIN `cmdb_resourcecenter_resource_tag` d ON d.`resource_id` = a.`id` + left join autoexec_job_resource_inspect ajri on ajri.resource_id=a.id + left join autoexec_job_phase_node ajpn on ajpn.job_phase_id =ajri.phase_id AND ajpn.resource_id = a.id LEFT JOIN cmdb_cientity_group ccg ON ccg.cientity_id = a.id LEFT JOIN cmdb_group_auth cga ON ccg.group_id = cga.group_id - + LEFT JOIN cmdb_group cg ON cga.group_id = cg.id AND cg.type in ('autoexec') @@ -463,7 +441,8 @@ along with this program. If not, see .--> - JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field IN (#{nameFieldAttrId}, #{ipFieldAttrId}) + JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field IN (#{nameFieldAttrId}, + #{ipFieldAttrId}) JOIN fulltextindex_word fw ON ffc.word_id = fw.id AND (fw.word IN @@ -493,8 +472,10 @@ along with this program. If not, see .--> AND (a.`name` LIKE CONCAT('%', #{keyword}, '%') OR a.`ip` LIKE CONCAT('%', #{keyword}, '%')) --> - - ${preConditionWhereSql} + + + ${preCondition.conditionWhereSql} + @@ -507,7 +488,7 @@ along with this program. If not, see .--> COUNT(DISTINCT a.`id`) - FROM @{DATA_SCHEMA}.`${viewName}` b + FROM @{DATA_SCHEMA}.`${viewName}` b JOIN `cmdb_cientity` a on a.`id` = b.`cientity_id` LEFT JOIN `cmdb_cientity_expiredtime` `ex` ON `ex`.`cientity_id` = `a`.`id` @@ -544,7 +525,7 @@ along with this program. If not, see .--> or ( - cg.id is not null and + cg.id is not null and a.`ci_id` IN #{typeId} @@ -592,21 +573,15 @@ along with this program. If not, see .--> ,count(distinct fw.word) as match_count FROM @{DATA_SCHEMA}.`scence_ipobject_detail` a - - LEFT JOIN `cmdb_resourcecenter_resource_account` b ON b.`resource_id` = a.`id` - LEFT JOIN `cmdb_resourcecenter_account` c ON c.`id` = b.`account_id` - - - LEFT JOIN `cmdb_resourcecenter_resource_tag` d ON d.`resource_id` = a.`id` - - - left join autoexec_job_resource_inspect ajri on ajri.resource_id=a.id - left join autoexec_job_phase_node ajpn on ajpn.job_phase_id =ajri.phase_id AND ajpn.resource_id = a.id - + LEFT JOIN `cmdb_resourcecenter_resource_account` b ON b.`resource_id` = a.`id` + LEFT JOIN `cmdb_resourcecenter_account` c ON c.`id` = b.`account_id` + LEFT JOIN `cmdb_resourcecenter_resource_tag` d ON d.`resource_id` = a.`id` + left join autoexec_job_resource_inspect ajri on ajri.resource_id=a.id + left join autoexec_job_phase_node ajpn on ajpn.job_phase_id =ajri.phase_id AND ajpn.resource_id = a.id LEFT JOIN cmdb_cientity_group ccg ON ccg.cientity_id = a.id LEFT JOIN cmdb_group_auth cga ON ccg.group_id = cga.group_id - + LEFT JOIN cmdb_group cg ON cga.group_id = cg.id AND cg.type in ('autoexec') @@ -616,7 +591,8 @@ along with this program. If not, see .--> - JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field IN (#{nameFieldAttrId}, #{ipFieldAttrId}) + JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field IN (#{nameFieldAttrId}, + #{ipFieldAttrId}) JOIN fulltextindex_word fw ON ffc.word_id = fw.id AND (fw.word IN @@ -646,8 +622,10 @@ along with this program. If not, see .--> AND (a.`name` LIKE CONCAT('%', #{keyword}, '%') OR a.`ip` LIKE CONCAT('%', #{keyword}, '%')) --> - - ${preConditionWhereSql} + + + ${preCondition.conditionWhereSql} + group by a.id @@ -665,16 +643,16 @@ along with this program. If not, see .--> @@ -715,7 +695,8 @@ along with this program. If not, see .--> - + @@ -794,35 +775,37 @@ along with this program. If not, see .--> - SELECT COUNT(DISTINCT `id`) FROM @{DATA_SCHEMA}.`${viewName}` a - - AND a.`app_system_id` = #{appSystemId} - - - AND a.`app_module_id` = #{appModuleId} - - - AND a.`env_id` = #{envId} - - - AND a.`env_id` is null - - - AND a.`type_id` = #{typeId} - - - AND a.`inspect_status` IN - - #{inspectStatus} - - + + AND a.`app_system_id` = #{appSystemId} + + + AND a.`app_module_id` = #{appModuleId} + + + AND a.`env_id` = #{envId} + + + AND a.`env_id` is null + + + AND a.`type_id` = #{typeId} + + + AND a.`inspect_status` IN + + #{inspectStatus} + + - SELECT DISTINCT a.`id` FROM @{DATA_SCHEMA}.`${viewName}` a @@ -852,7 +835,8 @@ along with this program. If not, see .--> LIMIT #{startNum}, #{pageSize} - SELECT a.`id`, a.`name`, @@ -999,18 +983,18 @@ along with this program. If not, see .--> ( - a.`ip` = #{item.ip} - - - AND a.`port` = #{item.port} - - - AND a.`port` is null - - - - and a.`name` = #{item.name} - + a.`ip` = #{item.ip} + + + AND a.`port` = #{item.port} + + + AND a.`port` is null + + + + and a.`name` = #{item.name} + ) @@ -1021,7 +1005,8 @@ along with this program. If not, see .--> --> - + SELECT a.`id`, + a.`name`, + a.`ip`, + a.`type_id` AS typeId, + a.`type_name` AS typeName, + a.`type_label` AS typeLabel + FROM @{DATA_SCHEMA}.`scence_os` a WHERE a.`ip` = #{ip} LIMIT 1 @@ -1502,21 +1487,21 @@ along with this program. If not, see .--> @@ -1646,23 +1630,21 @@ along with this program. If not, see .--> @@ -1901,9 +1883,9 @@ along with this program. If not, see .--> - SELECT IFNULL(a.env_id, -2) as id, - IFNULL(a.env_name, '未配置') as name, - IFNULL(a.env_seq_no, 9999) as seqNo, - a.app_module_id as moduleId, - a.app_module_name as moduleName, - a.app_module_abbr_name as moduleAbbrName, - a.type_id as typeId, - a.type_name as typeName, - a.type_label as typeLabel + SELECT IFNULL(a.env_id, -2) as id, + IFNULL(a.env_name, '未配置') as name, + IFNULL(a.env_seq_no, 9999) as seqNo, + a.app_module_id as moduleId, + a.app_module_name as moduleName, + a.app_module_abbr_name as moduleAbbrName, + a.type_id as typeId, + a.type_name as typeName, + a.type_label as typeLabel FROM @{DATA_SCHEMA}.`${viewName}` a WHERE a.`app_system_id` = #{appSystemId} @@ -1980,106 +1962,36 @@ along with this program. If not, see .--> - + SELECT a.`app_module_id` AS appModuleId, + COUNT(DISTINCT a.`env_id`) AS count FROM @{DATA_SCHEMA}.`scence_ipobject_detail` a WHERE a.`app_system_id` = #{value} AND a.`env_id` IS NOT NULL GROUP BY a.`app_module_id` - - - AND sid.`id` IN - - #{id} - - - - - AND sid.`type_id` IN - - #{typeId} - - - - AND ( - - - sid.`type_id` IN - - #{authedTypeId} - - - - 1 = 0 - - - or ( - cg.id is not null and - sid.`type_id` IN - - #{typeId} - - and - ((cga.auth_type = 'common' AND cga.auth_uuid = 'alluser') - - OR ( - cga.auth_type = 'user' - AND - cga.auth_uuid = #{searchVo.authenticationInfo.userUuid} - ) - - - OR ( - cga.auth_type = 'team' - AND - cga.auth_uuid IN - - #{item} - - ) - - - OR ( - cga.auth_type = 'role' - AND - cga.auth_uuid IN - - #{item} - ) - - ) - ) - ) - - - - - - SELECT - DISTINCT a.`type_id` + DISTINCT a.`type_id` FROM @{DATA_SCHEMA}.`${viewName}` a - AND a.`app_system_id` = #{appSystemId} + AND a.`app_system_id` = #{appSystemId} AND a.`app_module_id` = #{appModuleId} @@ -2164,10 +2079,9 @@ along with this program. If not, see .--> diff --git a/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java b/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java index e3b066c6..c19bf9d8 100644 --- a/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java @@ -656,7 +656,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { StringBuilder preSqlSb = new StringBuilder(); searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); - searchVo.setPreConditionWhereSql(preSqlSb.toString()); + searchVo.getPreCondition().setConditionWhereSql(preSqlSb.toString()); } // if (Objects.equals(enable, "1")) { List idList = resourceMapper.getResourceIdList(searchVo); diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java index 769d226e..d754c434 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java @@ -25,7 +25,7 @@ import neatlogic.framework.cmdb.dto.ci.AttrVo; import neatlogic.framework.cmdb.dto.ci.CiVo; import neatlogic.framework.cmdb.dto.globalattr.GlobalAttrVo; import neatlogic.framework.cmdb.dto.resourcecenter.AccountComponentVo; -import neatlogic.framework.cmdb.dto.resourcecenter.ResourceCustomConditionConfigVo; +import neatlogic.framework.cmdb.dto.resourcecenter.ResourceConditionConfigVo; import neatlogic.framework.cmdb.dto.resourcecenter.ResourceSearchVo; import neatlogic.framework.cmdb.dto.resourcecenter.ResourceVo; import neatlogic.framework.cmdb.dto.resourcecenter.config.*; @@ -1021,7 +1021,7 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe JSONObject conditionConfigObj = new JSONObject(); conditionConfigObj.put("conditionGroupList", searchVo.getConditionGroupList()); conditionConfigObj.put("conditionGroupRelList", searchVo.getConditionGroupRelList()); - ResourceCustomConditionConfigVo resourceConditionConfigVo = conditionConfigObj.toJavaObject(ResourceCustomConditionConfigVo.class); + ResourceConditionConfigVo resourceConditionConfigVo = conditionConfigObj.toJavaObject(ResourceConditionConfigVo.class); List filterItemFieldNameList2 = resourceConditionConfigVo.getFilterItemFieldNameList(); System.out.println("filterItemFieldNameList2 = " + filterItemFieldNameList2); filterItemFieldNameList.addAll(filterItemFieldNameList2); -- Gitee From 24bec91ac9217041fe444d71ebc66d6fcb9bdee3 Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Thu, 4 Sep 2025 16:53:14 +0800 Subject: [PATCH 05/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D=20#[1500817822023680]=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=BB=84=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D?= =?UTF-8?q?=E9=83=BD=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E2=80=9D=20http://192.168.0.96:8090?= =?UTF-8?q?/demo/rdm.html#/story-detail/939050947543040/939050947543042/15?= =?UTF-8?q?00817822023680?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index e2ecfb66..b1de76d4 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -666,7 +666,7 @@ along with this program. If not, see .--> #{keyword}, '%')) - ${conditionSql} + ${conditionWhereSql} ${preCondition.conditionWhereSql} @@ -2005,7 +2005,7 @@ along with this program. If not, see .--> #{keyword}, '%')) - ${conditionSql} + ${conditionWhereSql} ${preCondition.conditionWhereSql} -- Gitee From 97add7cdee60686b352db02e516a96a3dd001810 Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Thu, 4 Sep 2025 16:55:02 +0800 Subject: [PATCH 06/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D=20#[1500817822023680]=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=BB=84=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D?= =?UTF-8?q?=E9=83=BD=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E2=80=9D=20http://192.168.0.96:8090?= =?UTF-8?q?/demo/rdm.html#/story-detail/939050947543040/939050947543042/15?= =?UTF-8?q?00817822023680?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resourcecenter/resource/CheckResourceInputNodeListApi.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java index 902448bc..58513887 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java @@ -94,6 +94,7 @@ public class CheckResourceInputNodeListApi extends PrivateApiComponentBase { } StringBuilder sqlSb = new StringBuilder(); searchVo.buildConditionWhereSql(sqlSb, searchVo); + searchVo.setConditionWhereSql(sqlSb.toString()); searchVo.setPageSize(1); for (int i = 0; i < inputNodeList.size(); i++) { JSONObject inputNodeObj = inputNodeList.getJSONObject(i); @@ -109,7 +110,7 @@ public class CheckResourceInputNodeListApi extends PrivateApiComponentBase { searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); searchVo.getPreCondition().setConditionWhereSql(preSqlSb.toString()); } - List idList = resourceMapper.getResourceIdListByDynamicCondition(searchVo, sqlSb.toString()); + List idList = resourceMapper.getResourceIdListByDynamicCondition(searchVo); if (CollectionUtils.isEmpty(idList)) { if (!nonExistList.contains(inputNodeObj)) { nonExistList.add(inputNodeObj); -- Gitee From 4fd17ed102d113051fa16b7da9ae3b00b6816bb1 Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Thu, 4 Sep 2025 17:06:02 +0800 Subject: [PATCH 07/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D=20#[1500817822023680]=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=BB=84=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D?= =?UTF-8?q?=E9=83=BD=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E2=80=9D=20http://192.168.0.96:8090?= =?UTF-8?q?/demo/rdm.html#/story-detail/939050947543040/939050947543042/15?= =?UTF-8?q?00817822023680?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/resourcecenter/ResourceMapper.xml | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index b1de76d4..6c535b6d 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -259,82 +259,82 @@ along with this program. If not, see .--> - + AND a.`type_id` IN - + #{typeId} - + AND a.`state_id` IN - + #{stateId} - + AND a.`vendor_id` IN - + #{vendorId} - + AND a.`env_id` IN - + #{envId} - + AND a.`env_id` is null - + AND a.`app_system_id` IN - #{appSystemId} - + AND a.`app_module_id` IN - #{appModuleId} - + AND a.`id` IN - + #{id} - + AND a.`id` IN - + #{id} - + AND a.`inspect_status` IN - #{inspectStatus} - + AND c.`protocol_id` IN - #{protocolId} - + AND d.`tag_id` IN - + #{tagId} - + AND ajpn.status in - #{status} -- Gitee From d7fd2789ad635cd49e5d4fc65adbc1daa7623e76 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Thu, 4 Sep 2025 19:33:17 +0800 Subject: [PATCH 08/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1500817822023680]自动化组合工具“全局“、“阶段组”和“阶段”都支持选择执行目标支持“前置过滤器” http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1500817822023680 --- .../DefaultResourceCenterDataSourceImpl.java | 55 +----------- .../resource/ResourceBuildSqlServiceImpl.java | 83 +++++++++++++------ .../ResourceCenterResourceServiceImpl.java | 15 ++++ 3 files changed, 75 insertions(+), 78 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java b/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java index c19bf9d8..16a22c27 100644 --- a/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/resourcecenter/datasource/handler/DefaultResourceCenterDataSourceImpl.java @@ -28,7 +28,6 @@ import neatlogic.framework.cmdb.dto.resourcecenter.config.ResourceEntityConfigVo import neatlogic.framework.cmdb.dto.resourcecenter.config.ResourceEntityFieldMappingVo; import neatlogic.framework.cmdb.dto.resourcecenter.config.ResourceEntityVo; import neatlogic.framework.cmdb.dto.resourcecenter.config.SceneEntityVo; -import neatlogic.framework.cmdb.enums.CmdbTenantConfig; import neatlogic.framework.cmdb.exception.ci.CiNotFoundException; import neatlogic.framework.cmdb.exception.resourcecenter.AppModuleNotFoundException; import neatlogic.framework.cmdb.exception.resourcecenter.AppSystemNotFoundException; @@ -37,7 +36,6 @@ import neatlogic.framework.cmdb.resourcecenter.datasource.core.Ordered; import neatlogic.framework.common.constvalue.InspectStatus; import neatlogic.framework.common.dto.BasePageVo; import neatlogic.framework.common.dto.ValueTextVo; -import neatlogic.framework.config.ConfigManager; import neatlogic.framework.util.TableResultUtil; import neatlogic.module.cmdb.dao.mapper.ci.CiMapper; import neatlogic.module.cmdb.dao.mapper.cientity.CiEntityCachedMapper; @@ -648,32 +646,10 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS @Override public List getResourceList(ResourceSearchVo searchVo) { - String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); List resultList = new ArrayList<>(); -// String getResourceIdListSql = resourceBuildSqlService.buildGetResourceIdListSql(searchVo); -// List idList = resourceMapper.getIdListBySql(getResourceIdListSql); - //是否存在前置条件 - if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { - StringBuilder preSqlSb = new StringBuilder(); - searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); - searchVo.getPreCondition().setConditionWhereSql(preSqlSb.toString()); - } -// if (Objects.equals(enable, "1")) { - List idList = resourceMapper.getResourceIdList(searchVo); -// if (!Objects.equals(oldIdList, idList)) { -// JSONObject errorObj = new JSONObject(); -// errorObj.put("idList", idList); -// errorObj.put("oldIdList", oldIdList); -// logger.error("资产清单新旧SQL获取idList结果不一致:{}", errorObj); -// } -// } + List idList = resourceCenterResourceService.getResourceIdList(searchVo); if (CollectionUtils.isNotEmpty(idList)) { -// String getResourceListSql = resourceBuildSqlService.buildGetResourceListSql(idList); -// List resourceList = resourceMapper.getResourceListBySql(getResourceListSql); -// if (Objects.equals(enable, "1")) { - List resourceList = resourceMapper.getResourceListByIdList(idList); -// checkResourceListIsEquals(resourceList, oldResourceList); -// } + List resourceList = resourceCenterResourceService.getResourceListByIdList(idList); //排序 for (Long id : idList) { for (ResourceVo resourceVo : resourceList) { @@ -684,32 +660,7 @@ public class DefaultResourceCenterDataSourceImpl implements IResourceCenterDataS } } if (Objects.equals(searchVo.getRowNum(), 0)) { - String getResourceCountSql = resourceBuildSqlService.buildGetResourceCountSql(searchVo); - int rowNum = resourceMapper.getCountBySql(getResourceCountSql); - if (Objects.equals(enable, "1")) { - int oldRowNum = 0; - if (noFilterCondition(searchVo)) { - ResourceEntityVo resourceEntityVo = resourceEntityMapper.getResourceEntityByName("scence_ipobject_detail"); - if (resourceEntityVo != null) { - ResourceEntityConfigVo config = resourceEntityVo.getConfig(); - if (config != null) { - CiVo ciVo = ciMapper.getCiByName(config.getMainCi()); - if (ciVo != null) { - searchVo.setViewName(ciVo.getCiTableName(false)); - oldRowNum = resourceMapper.getAllResourceCount(searchVo); - } - } - } - } else { - oldRowNum = resourceMapper.getResourceCount(searchVo); - } - if (oldRowNum != rowNum) { - JSONObject errorObj = new JSONObject(); - errorObj.put("rowNum", rowNum); - errorObj.put("oldRowNum", oldRowNum); - logger.error("资产清单新旧SQL获取rowNum结果不一致:{}", errorObj); - } - } + int rowNum = resourceCenterResourceService.getResourceCount(searchVo); searchVo.setRowNum(rowNum); } } else { diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java index 2a741f5a..a54f6245 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java @@ -173,17 +173,27 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe try { ResourceEntityVo resourceEntityVo = resourceEntityMapper.getResourceEntityByName("scence_ipobject_detail"); ResourceEntityConfigVo config = getResourceEntityConfigVo(resourceEntityVo); + List filterItemFieldNameList = new ArrayList<>(); + ResourceQueryCriteriaVo preConditionQueryCriteriaVo = null; + ResourceSearchVo preCondition = searchVo.getPreCondition(); + if (preCondition != null) { + preConditionQueryCriteriaVo = new ResourceQueryCriteriaVo(preCondition); + filterItemFieldNameList.addAll(getFilterItemFieldNameList(preConditionQueryCriteriaVo)); + } ResourceQueryCriteriaVo queryCriteriaVo = new ResourceQueryCriteriaVo(searchVo); + filterItemFieldNameList.addAll(getFilterItemFieldNameList(queryCriteriaVo)); + filterItemFieldNameList.add("id"); + config.setFilterItemFieldNameList(filterItemFieldNameList); List selectItemFieldNameList = new ArrayList<>(); selectItemFieldNameList.add("id"); - List filterItemFieldNameList = getFilterItemFieldNameList(queryCriteriaVo); - filterItemFieldNameList.add("id"); config.setSelectItemFieldNameList(selectItemFieldNameList); - config.setFilterItemFieldNameList(filterItemFieldNameList); Map fieldName2ColumnMap = new HashMap<>(); PlainSelect plainSelect = getPlainSelect(config, fieldName2ColumnMap); - - SqlVo sqlVo = getSqlVoForResource(queryCriteriaVo, fieldName2ColumnMap); + SqlVo sqlVo = new SqlVo(); + if (preConditionQueryCriteriaVo != null) { + getSqlVoForResource(sqlVo, preConditionQueryCriteriaVo, fieldName2ColumnMap); + } + getSqlVoForResource(sqlVo, queryCriteriaVo, fieldName2ColumnMap); $sql.addSql(plainSelect, sqlVo); if (CollectionUtils.isNotEmpty(searchVo.getKeywordList()) && searchVo.getNameFieldAttrId() != null && searchVo.getIpFieldAttrId() != null) { $sql.addOrderBy(plainSelect, $sql.fun("COUNT", "fw.word").withDistinct(true), "desc"); @@ -206,16 +216,27 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe try { ResourceEntityVo resourceEntityVo = resourceEntityMapper.getResourceEntityByName("scence_ipobject_detail"); ResourceEntityConfigVo config = getResourceEntityConfigVo(resourceEntityVo); + List filterItemFieldNameList = new ArrayList<>(); + ResourceQueryCriteriaVo preConditionQueryCriteriaVo = null; + ResourceSearchVo preCondition = searchVo.getPreCondition(); + if (preCondition != null) { + preConditionQueryCriteriaVo = new ResourceQueryCriteriaVo(preCondition); + filterItemFieldNameList.addAll(getFilterItemFieldNameList(preConditionQueryCriteriaVo)); + } ResourceQueryCriteriaVo queryCriteriaVo = new ResourceQueryCriteriaVo(searchVo); + filterItemFieldNameList.addAll(getFilterItemFieldNameList(queryCriteriaVo)); + filterItemFieldNameList.add("id"); + config.setFilterItemFieldNameList(filterItemFieldNameList); List selectItemFieldNameList = new ArrayList<>(); selectItemFieldNameList.add("id"); - List filterItemFieldNameList = getFilterItemFieldNameList(queryCriteriaVo); - filterItemFieldNameList.add("id"); config.setSelectItemFieldNameList(selectItemFieldNameList); - config.setFilterItemFieldNameList(filterItemFieldNameList); Map fieldName2ColumnMap = new HashMap<>(); PlainSelect plainSelect = getPlainSelect(config, fieldName2ColumnMap); - SqlVo sqlVo = getSqlVoForResource(queryCriteriaVo, fieldName2ColumnMap); + SqlVo sqlVo = new SqlVo(); + if (preConditionQueryCriteriaVo != null) { + getSqlVoForResource(sqlVo, preConditionQueryCriteriaVo, fieldName2ColumnMap); + } + getSqlVoForResource(sqlVo, queryCriteriaVo, fieldName2ColumnMap); $sql.addSql(plainSelect, sqlVo); Column column = fieldName2ColumnMap.get("id"); $sql.setSelectColumn(plainSelect, $sql.fun("COUNT", column.toString()).withDistinct(true)); @@ -1016,14 +1037,12 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe filterItemFieldNameList.add("id"); ResourceQueryCriteriaVo queryCriteriaVo = new ResourceQueryCriteriaVo(searchVo); List filterItemFieldNameList1 = getFilterItemFieldNameList(queryCriteriaVo); - System.out.println("filterItemFieldNameList1 = " + filterItemFieldNameList1); filterItemFieldNameList.addAll(filterItemFieldNameList1); JSONObject conditionConfigObj = new JSONObject(); conditionConfigObj.put("conditionGroupList", searchVo.getConditionGroupList()); conditionConfigObj.put("conditionGroupRelList", searchVo.getConditionGroupRelList()); ResourceConditionConfigVo resourceConditionConfigVo = conditionConfigObj.toJavaObject(ResourceConditionConfigVo.class); List filterItemFieldNameList2 = resourceConditionConfigVo.getFilterItemFieldNameList(); - System.out.println("filterItemFieldNameList2 = " + filterItemFieldNameList2); filterItemFieldNameList.addAll(filterItemFieldNameList2); config.setSelectItemFieldNameList(selectItemFieldNameList); config.setFilterItemFieldNameList(filterItemFieldNameList); @@ -1064,14 +1083,12 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe filterItemFieldNameList.add("id"); ResourceQueryCriteriaVo queryCriteriaVo = new ResourceQueryCriteriaVo(searchVo); List filterItemFieldNameList1 = getFilterItemFieldNameList(queryCriteriaVo); - System.out.println("filterItemFieldNameList1 = " + filterItemFieldNameList1); filterItemFieldNameList.addAll(filterItemFieldNameList1); JSONObject conditionConfigObj = new JSONObject(); conditionConfigObj.put("conditionGroupList", searchVo.getConditionGroupList()); conditionConfigObj.put("conditionGroupRelList", searchVo.getConditionGroupRelList()); ResourceConditionConfigVo resourceConditionConfigVo = conditionConfigObj.toJavaObject(ResourceConditionConfigVo.class); List filterItemFieldNameList2 = resourceConditionConfigVo.getFilterItemFieldNameList(); - System.out.println("filterItemFieldNameList2 = " + filterItemFieldNameList2); filterItemFieldNameList.addAll(filterItemFieldNameList2); config.setSelectItemFieldNameList(selectItemFieldNameList); config.setFilterItemFieldNameList(filterItemFieldNameList); @@ -2578,11 +2595,20 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe if (CollectionUtils.isNotEmpty(queryCriteriaVo.getInspectStatusList())) { filterItemFieldNameSet.add("inspect_status"); } + if (queryCriteriaVo.getConditionConfig() != null) { + filterItemFieldNameSet.addAll(queryCriteriaVo.getConditionConfig().getFilterItemFieldNameList()); + } return new ArrayList<>(filterItemFieldNameSet); } private SqlVo getSqlVoForResource(ResourceQueryCriteriaVo queryCriteriaVo, Map fieldName2ColumnMap) { SqlVo sqlVo = new SqlVo(); + getSqlVoForResource(sqlVo, queryCriteriaVo, fieldName2ColumnMap); + return sqlVo; + } + + private void getSqlVoForResource(SqlVo sqlVo, ResourceQueryCriteriaVo queryCriteriaVo, Map fieldName2ColumnMap) { +// SqlVo sqlVo = new SqlVo(); List joinList = new ArrayList<>(); List whereExpressionList = new ArrayList<>(); /* @@ -2606,11 +2632,12 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe joinList.add($sql.join("join", "fulltextindex_field_cmdb", "ffc").withOn(expressionVo)); } { - ExpressionVo expressionVo = $sql.exp( - $sql.exp("fw.id", "=", "ffc.word_id"), - "and", - $sql.exp("fw.word", "in", queryCriteriaVo.getKeywordList())); - joinList.add($sql.join("join", "fulltextindex_word", "fw").withOn(expressionVo)); +// ExpressionVo expressionVo = $sql.exp( +// $sql.exp("fw.id", "=", "ffc.word_id"), +// "and", +// $sql.exp("fw.word", "in", queryCriteriaVo.getKeywordList())); + joinList.add($sql.join("join", "fulltextindex_word", "fw").withOn($sql.exp("fw.id", "=", "ffc.word_id"))); + whereExpressionList.add($sql.exp("fw.word", "in", queryCriteriaVo.getKeywordList())); } } /* @@ -2649,11 +2676,12 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe joinList.add($sql.join("join", "fulltextindex_field_cmdb", "ffc2").withOn(expressionVo)); } { - ExpressionVo expressionVo = $sql.exp( - $sql.exp("fw2.id", "=", "ffc2.word_id"), - "and", - $sql.exp("fw2.word", "in", queryCriteriaVo.getBatchSearchList())); - joinList.add($sql.join("join", "fulltextindex_word", "fw2").withOn(expressionVo)); +// ExpressionVo expressionVo = $sql.exp( +// $sql.exp("fw2.id", "=", "ffc2.word_id"), +// "and", +// $sql.exp("fw2.word", "in", queryCriteriaVo.getBatchSearchList())); + joinList.add($sql.join("join", "fulltextindex_word", "fw2").withOn($sql.exp("fw2.id", "=", "ffc2.word_id"))); + whereExpressionList.add($sql.exp("fw2.word", "in", queryCriteriaVo.getBatchSearchList())); } } /* @@ -2947,9 +2975,12 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe // System.out.println("x"); whereExpressionList.add($sql.exp(fieldName2ColumnMap.get("inspect_status").toString(), "in", queryCriteriaVo.getInspectStatusList())); } - sqlVo.withJoinList(joinList); - sqlVo.withWhereExpressionList(whereExpressionList); - return sqlVo; + sqlVo.withAddJoinList(joinList); + sqlVo.withAddWhereExpressionList(whereExpressionList); + if (queryCriteriaVo.getConditionConfig() != null) { + queryCriteriaVo.getConditionConfig().buildConditionSqlVo(sqlVo, fieldName2ColumnMap); + } +// return sqlVo; } private SqlVo getSqlVoForInspect(ResourceQueryCriteriaVo queryCriteriaVo, Map fieldName2ColumnMap) { diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java index d712b52e..ba6d22fe 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java @@ -607,6 +607,12 @@ public class ResourceCenterResourceServiceImpl implements IResourceCenterResourc } } } else { + //是否存在前置条件 + if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { + StringBuilder preSqlSb = new StringBuilder(); + searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); + searchVo.getPreCondition().setConditionWhereSql(preSqlSb.toString()); + } oldRowNum = resourceMapper.getResourceCount(searchVo); } } @@ -637,6 +643,12 @@ public class ResourceCenterResourceServiceImpl implements IResourceCenterResourc newIdList = resourceMapper.getIdListBySql(sql); } if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { + //是否存在前置条件 + if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { + StringBuilder preSqlSb = new StringBuilder(); + searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); + searchVo.getPreCondition().setConditionWhereSql(preSqlSb.toString()); + } oldIdList = resourceMapper.getResourceIdList(searchVo); } if (Objects.equals(enable, COMPARISON_ENABLED)) { @@ -770,6 +782,9 @@ public class ResourceCenterResourceServiceImpl implements IResourceCenterResourc if (CollectionUtils.isNotEmpty(searchVo.getInspectJobPhaseNodeStatusList())) { return false; } + if (CollectionUtils.isNotEmpty(searchVo.getConditionGroupList())) { + return false; + } return true; } } -- Gitee From 00dad1806aa371d828fbddff573b465c81878126 Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Fri, 5 Sep 2025 16:06:36 +0800 Subject: [PATCH 09/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D=20#[1500817822023680]=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=BB=84=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D?= =?UTF-8?q?=E9=83=BD=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E2=80=9D=20http://192.168.0.96:8090?= =?UTF-8?q?/demo/rdm.html#/story-detail/939050947543040/939050947543042/15?= =?UTF-8?q?00817822023680?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/resourcecenter/ResourceMapper.xml | 84 +------------------ 1 file changed, 1 insertion(+), 83 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index 6c535b6d..268f3455 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -258,88 +258,6 @@ along with this program. If not, see .--> - - - AND a.`type_id` IN - - #{typeId} - - - - AND a.`state_id` IN - - #{stateId} - - - - AND a.`vendor_id` IN - - #{vendorId} - - - - AND a.`env_id` IN - - #{envId} - - - - AND a.`env_id` is null - - - AND a.`app_system_id` IN - - #{appSystemId} - - - - AND a.`app_module_id` IN - - #{appModuleId} - - - - AND a.`id` IN - - #{id} - - - - AND a.`id` IN - - #{id} - - - - AND a.`inspect_status` IN - - #{inspectStatus} - - - - AND c.`protocol_id` IN - - #{protocolId} - - - - AND d.`tag_id` IN - - #{tagId} - - - - AND ajpn.status in - - #{status} - - - @@ -540,9 +545,14 @@ along with this program. If not, see .--> AND (a.`name` LIKE CONCAT('%', #{keyword}, '%') OR a.`ip` LIKE CONCAT('%', #{keyword}, '%')) --> + + ${conditionWhereSql} + - ${preCondition.conditionWhereSql} + + ${preCondition.conditionWhereSql} + diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java index ba6d22fe..c37ca111 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java @@ -785,6 +785,11 @@ public class ResourceCenterResourceServiceImpl implements IResourceCenterResourc if (CollectionUtils.isNotEmpty(searchVo.getConditionGroupList())) { return false; } + if (searchVo.getPreCondition() != null) { + if (!noFilterCondition(searchVo.getPreCondition())) { + return false; + } + } return true; } } -- Gitee From e5b8e514e9e4f9f45f5363888c1747e6a801ef30 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Fri, 5 Sep 2025 16:49:15 +0800 Subject: [PATCH 11/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1500817822023680]自动化组合工具“全局“、“阶段组”和“阶段”都支持选择执行目标支持“前置过滤器” http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1500817822023680 --- .../ResourceCenterResourceServiceImpl.java | 26 +++++-------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java index c37ca111..ed86b01d 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java @@ -594,27 +594,13 @@ public class ResourceCenterResourceServiceImpl implements IResourceCenterResourc newRowNum = resourceMapper.getCountBySql(sql); } if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { - if (noFilterCondition(searchVo)) { - ResourceEntityVo resourceEntityVo = resourceEntityMapper.getResourceEntityByName("scence_ipobject_detail"); - if (resourceEntityVo != null) { - ResourceEntityConfigVo config = resourceEntityVo.getConfig(); - if (config != null) { - CiVo ciVo = ciMapper.getCiByName(config.getMainCi()); - if (ciVo != null) { - searchVo.setViewName(ciVo.getCiTableName(false)); - oldRowNum = resourceMapper.getAllResourceCount(searchVo); - } - } - } - } else { - //是否存在前置条件 - if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { - StringBuilder preSqlSb = new StringBuilder(); - searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); - searchVo.getPreCondition().setConditionWhereSql(preSqlSb.toString()); - } - oldRowNum = resourceMapper.getResourceCount(searchVo); + //是否存在前置条件 + if (searchVo.getPreCondition() != null && searchVo.getPreCondition().isCustomCondition()) { + StringBuilder preSqlSb = new StringBuilder(); + searchVo.getPreCondition().buildConditionWhereSql(preSqlSb, searchVo.getPreCondition()); + searchVo.getPreCondition().setConditionWhereSql(preSqlSb.toString()); } + oldRowNum = resourceMapper.getResourceCount(searchVo); } if (Objects.equals(enable, COMPARISON_ENABLED)) { if (oldRowNum != newRowNum) { -- Gitee From 53ad080ced2f3404ef42244247a0b404163fe7f7 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Fri, 5 Sep 2025 17:43:53 +0800 Subject: [PATCH 12/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1500817822023680]自动化组合工具“全局“、“阶段组”和“阶段”都支持选择执行目标支持“前置过滤器” http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1500817822023680 --- .../resource/ExportResourceApi.java | 2 +- .../mapper/resourcecenter/ResourceMapper.xml | 47 ++++++++++--------- .../ResourceCenterResourceServiceImpl.java | 6 +++ 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java index 16a84033..646092d4 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/ExportResourceApi.java @@ -153,7 +153,7 @@ public class ExportResourceApi extends PrivateBinaryStreamApiComponentBase { if (rowNum > 0) { searchVo.setPageSize(100); searchVo.setRowNum(rowNum); - resourceCenterResourceService.setIsIpFieldSortAndIsNameFieldSort(searchVo); +// resourceCenterResourceService.setIsIpFieldSortAndIsNameFieldSort(searchVo); for (int i = 1; i <= searchVo.getPageCount(); i++) { searchVo.setCurrentPage(i); List idList = resourceMapper.getResourceIdList(searchVo); diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index de4189ec..6a0ef9e4 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -183,19 +183,18 @@ along with this program. If not, see .--> #{tagId} - + + AND fw.word IN + + #{item} + + + + AND fw2.word IN + + #{item} + + AND ajpn.status in @@ -256,6 +255,18 @@ along with this program. If not, see .--> #{tagId} + + AND fw.word IN + + #{item} + + + + AND fw2.word IN + + #{item} + + @@ -362,11 +373,6 @@ along with this program. If not, see .--> JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field IN (#{nameFieldAttrId}, #{ipFieldAttrId}) JOIN fulltextindex_word fw ON ffc.word_id = fw.id - AND (fw.word IN - - #{item} - - ) JOIN fulltextindex_field_cmdb ffc2 ON ffc2.target_id = a.id @@ -379,11 +385,6 @@ along with this program. If not, see .--> JOIN fulltextindex_word fw2 ON ffc2.word_id = fw2.id - AND (fw2.word IN - - #{item} - - ) ) + + + ( + a.`ip` = #{item.ip} + + + AND a.`port` = #{item.port} + + + AND a.`port` is null + + + + and a.`name` = #{item.name} + + ) + + #{status} + + + ( + a.`ip` = #{item.ip} + + + AND a.`port` = #{item.port} + + + AND a.`port` is null + + + + and a.`name` = #{item.name} + + ) + + @@ -297,12 +315,6 @@ along with this program. If not, see .--> JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field = #{nameFieldAttrId} JOIN fulltextindex_word fw ON ffc.word_id = fw.id - AND (fw.word IN - - #{item} - - - ) @@ -336,12 +348,6 @@ along with this program. If not, see .--> JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field = #{ipFieldAttrId} JOIN fulltextindex_word fw ON ffc.word_id = fw.id - AND (fw.word IN - - #{item} - - - ) @@ -518,11 +524,6 @@ along with this program. If not, see .--> JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field IN (#{nameFieldAttrId}, #{ipFieldAttrId}) JOIN fulltextindex_word fw ON ffc.word_id = fw.id - AND (fw.word IN - - #{item} - - ) JOIN fulltextindex_field_cmdb ffc2 ON ffc2.target_id = a.id @@ -535,29 +536,6 @@ along with this program. If not, see .--> JOIN fulltextindex_word fw2 ON ffc2.word_id = fw2.id - AND (fw2.word IN - - #{item} - - ) - - - - ( - a.`ip` = #{item.ip} - - - AND a.`port` = #{item.port} - - - AND a.`port` is null - - - - and a.`name` = #{item.name} - - ) - + and ( a.`ip` = #{item.ip} -- Gitee From e613df1c4226e2c0c272366fd384ce148da7c45d Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Mon, 8 Sep 2025 14:37:45 +0800 Subject: [PATCH 24/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D=20#[1500817822023680]=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5?= =?UTF-8?q?=E7=BB=84=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D?= =?UTF-8?q?=E9=83=BD=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C?= =?UTF-8?q?=E7=9B=AE=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE?= =?UTF-8?q?=E8=BF=87=E6=BB=A4=E5=99=A8=E2=80=9D=20http://192.168.0.96:8090?= =?UTF-8?q?/demo/rdm.html#/story-detail/939050947543040/939050947543042/15?= =?UTF-8?q?00817822023680?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resourcecenter/resource/CheckResourceInputNodeListApi.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java index a3270b83..29284110 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java @@ -59,7 +59,7 @@ public class CheckResourceInputNodeListApi extends PrivateApiComponentBase { } @Input({ - @Param(name = "filter", type = ApiParamType.JSONOBJECT, desc = "过滤条件", help = "简单过滤条件和高级过滤条件都用这个字段"), + @Param(name = "preCondition", type = ApiParamType.JSONOBJECT, desc = "前置过滤器"), @Param(name = "cmdbGroupType", type = ApiParamType.STRING, desc = "通过团体过滤权限"), @Param(name = "inputNodeList", type = ApiParamType.JSONARRAY, isRequired = true, minSize = 1, desc = "输入节点列表"), }) -- Gitee From 995ac9bd350e0a3e4a1467d6c72cd8016cda7e0e Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 8 Sep 2025 14:41:53 +0800 Subject: [PATCH 25/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1500817822023680]自动化组合工具“全局“、“阶段组”和“阶段”都支持选择执行目标支持“前置过滤器” http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1500817822023680 --- .../CheckResourceInputNodeListApi.java | 7 ++++-- .../mapper/resourcecenter/ResourceMapper.xml | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java index 29284110..b7f555b6 100644 --- a/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java +++ b/src/main/java/neatlogic/module/cmdb/api/resourcecenter/resource/CheckResourceInputNodeListApi.java @@ -73,11 +73,14 @@ public class CheckResourceInputNodeListApi extends PrivateApiComponentBase { JSONArray existList = new JSONArray(); JSONArray nonExistList = new JSONArray(); JSONArray inputNodeList = paramObj.getJSONArray("inputNodeList"); - JSONObject filter = paramObj.getJSONObject("preCondition"); + JSONObject preCondition = paramObj.getJSONObject("preCondition"); String cmdbGroupType = paramObj.getString("cmdbGroupType"); List selectFieldNameList = Arrays.asList("id", "name", "ip", "port"); List nodeList = new ArrayList<>(); - ResourceSearchVo searchVo = resourceCenterResourceService.assembleResourceSearchVo(filter); + if (preCondition == null) { + preCondition = new JSONObject(); + } + ResourceSearchVo searchVo = resourceCenterResourceService.assembleResourceSearchVo(preCondition); searchVo.setCmdbGroupType(cmdbGroupType); for (int i = 0; i < inputNodeList.size(); i++) { JSONObject inputNodeObj = inputNodeList.getJSONObject(i); diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index a931ebd5..68a79f02 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -317,6 +317,18 @@ along with this program. If not, see .--> JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field = #{nameFieldAttrId} JOIN fulltextindex_word fw ON ffc.word_id = fw.id + + JOIN fulltextindex_field_cmdb ffc2 ON ffc2.target_id = a.id + + + AND ffc2.target_field = #{nameFieldAttrId} + + + AND ffc2.target_field = #{ipFieldAttrId} + + + JOIN fulltextindex_word fw2 ON ffc2.word_id = fw2.id + @@ -350,6 +362,18 @@ along with this program. If not, see .--> JOIN fulltextindex_field_cmdb ffc ON ffc.target_id = a.id AND ffc.target_field = #{ipFieldAttrId} JOIN fulltextindex_word fw ON ffc.word_id = fw.id + + JOIN fulltextindex_field_cmdb ffc2 ON ffc2.target_id = a.id + + + AND ffc2.target_field = #{nameFieldAttrId} + + + AND ffc2.target_field = #{ipFieldAttrId} + + + JOIN fulltextindex_word fw2 ON ffc2.word_id = fw2.id + -- Gitee From f0147bc9690e1cd57da90e9fa2a87c6d3fe4ea00 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 8 Sep 2025 17:13:58 +0800 Subject: [PATCH 26/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1500817822023680]自动化组合工具“全局“、“阶段组”和“阶段”都支持选择执行目标支持“前置过滤器” http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1500817822023680 --- .../mapper/resourcecenter/ResourceMapper.java | 17 - .../mapper/resourcecenter/ResourceMapper.xml | 403 +----------------- .../handler/ResourcesHandler.java | 22 +- .../IResourceCenterResourceService.java | 8 +- .../resource/ResourceBuildSqlServiceImpl.java | 4 - .../ResourceCenterResourceServiceImpl.java | 204 ++++----- 6 files changed, 127 insertions(+), 531 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java index f06c6119..7d061c19 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java @@ -55,14 +55,9 @@ public interface ResourceMapper extends IResourceCrossoverMapper { @Deprecated int getResourceCount(ResourceSearchVo searchVo); - int getAllResourceCount(ResourceSearchVo searchVo); - - int getResourceCountByDynamicCondition(ResourceSearchVo searchVo); - @Deprecated List getResourceIdList(ResourceSearchVo searchVo); - List getResourceIdListByDynamicCondition(ResourceSearchVo searchVo); @Deprecated List getResourceListByIdList(List idList); @@ -74,16 +69,6 @@ public interface ResourceMapper extends IResourceCrossoverMapper { List getAppInstanceResourceListByIdListSimple(List idList); - Long getResourceIdByIpAndPortAndName(ResourceSearchVo searchVo); - - List getResourceIdListByIpAndPortAndName(ResourceSearchVo searchVo); - - List getResourceListByIpAndPortAndName(ResourceSearchVo searchVo); - -// Long getResourceIdByIpAndPortAndNameWithFilter(ResourceSearchVo searchVo); - - List getResourceListByIpAndPortAndNameWithFilter(ResourceSearchVo searchVo); - List getResourceByIdList(List idList); List getAuthResourceList(ResourceSearchVo searchVo); @@ -112,8 +97,6 @@ public interface ResourceMapper extends IResourceCrossoverMapper { // 该SQL语句可以使用 getResourceListByIpAndPortAndName 代替 List getResourceListByResourceVoList(@Param("resourceList") List resourceList,@Param("searchVo") ResourceSearchVo searchVo); -// Set getResourceTypeIdListByAppSystemIdAndModuleIdAndEnvIdAndInspectStatusList(ResourceSearchVo searchVo); - List getResourceIdListByAppSystemIdAndModuleIdAndEnvId(ResourceVo resourceVo); /** diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index 68a79f02..a0ad717d 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -418,9 +418,6 @@ along with this program. If not, see .--> JOIN fulltextindex_word fw2 ON ffc2.word_id = fw2.id - ${conditionWhereSql} @@ -434,91 +431,6 @@ along with this program. If not, see .--> - - - @@ -881,122 +754,6 @@ along with this program. If not, see .--> - - - - - - - - - - - - - diff --git a/src/main/java/neatlogic/module/cmdb/formattribute/handler/ResourcesHandler.java b/src/main/java/neatlogic/module/cmdb/formattribute/handler/ResourcesHandler.java index 4a1cdceb..a8ae665f 100644 --- a/src/main/java/neatlogic/module/cmdb/formattribute/handler/ResourcesHandler.java +++ b/src/main/java/neatlogic/module/cmdb/formattribute/handler/ResourcesHandler.java @@ -33,18 +33,15 @@ import neatlogic.framework.form.exception.AttributeValidException; import neatlogic.module.cmdb.dao.mapper.ci.CiMapper; import neatlogic.module.cmdb.dao.mapper.cientity.CiEntityMapper; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceAccountMapper; -import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceMapper; import neatlogic.module.cmdb.dao.mapper.resourcecenter.ResourceTagMapper; +import neatlogic.module.cmdb.service.resourcecenter.resource.IResourceCenterResourceService; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; import java.util.stream.Collectors; /** @@ -55,7 +52,7 @@ import java.util.stream.Collectors; public class ResourcesHandler extends FormHandlerBase { @Resource - private ResourceMapper resourceMapper; + private IResourceCenterResourceService resourceCenterResourceService; @Resource private ResourceAccountMapper resourceAccountMapper; @Resource @@ -151,6 +148,7 @@ public class ResourcesHandler extends FormHandlerBase { if ("input".equals(type)) { JSONArray inputNodeArray = dataObj.getJSONArray("inputNodeList"); if (CollectionUtils.isNotEmpty(inputNodeArray)) { + List selectFieldNameList = Arrays.asList("id", "name", "ip", "port"); List resourceIsNotFoundList = new ArrayList<>(); ResourceSearchVo searchVo = new ResourceSearchVo(); searchVo.setIsHasAuth(true); @@ -161,7 +159,11 @@ public class ResourcesHandler extends FormHandlerBase { nodeList.add(node); if (nodeList.size() > 100) { searchVo.setInputNodeList(nodeList); - List resourceList = resourceMapper.getResourceListByIpAndPortAndName(searchVo); + List resourceList = new ArrayList<>(); + List idList = resourceCenterResourceService.getResourceIdList(searchVo); + if (CollectionUtils.isNotEmpty(idList)) { + resourceList = resourceCenterResourceService.getResourceListByIdList(idList, selectFieldNameList); + } List notExistsNodeList = notExistsNodeList(nodeList, resourceList); resourceIsNotFoundList.addAll(notExistsNodeList); nodeList.clear(); @@ -169,7 +171,11 @@ public class ResourcesHandler extends FormHandlerBase { } if (CollectionUtils.isNotEmpty(nodeList)) { searchVo.setInputNodeList(nodeList); - List resourceList = resourceMapper.getResourceListByIpAndPortAndName(searchVo); + List resourceList = new ArrayList<>(); + List idList = resourceCenterResourceService.getResourceIdList(searchVo); + if (CollectionUtils.isNotEmpty(idList)) { + resourceList = resourceCenterResourceService.getResourceListByIdList(idList, selectFieldNameList); + } List notExistsNodeList = notExistsNodeList(nodeList, resourceList); resourceIsNotFoundList.addAll(notExistsNodeList); nodeList.clear(); diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/IResourceCenterResourceService.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/IResourceCenterResourceService.java index 56ab8ab0..86e49964 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/IResourceCenterResourceService.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/IResourceCenterResourceService.java @@ -115,13 +115,13 @@ public interface IResourceCenterResourceService { List getAppResourceListByIdList(ResourceSearchVo searchVo); - Long getResourceIdByIpAndPortAndName(ResourceSearchVo searchVo); +// Long getResourceIdByIpAndPortAndName(ResourceSearchVo searchVo); - List getResourceIdListByIpAndPortAndName(ResourceSearchVo searchVo); +// List getResourceIdListByIpAndPortAndName(ResourceSearchVo searchVo); - List getResourceListByIpAndPortAndName(ResourceSearchVo searchVo); +// List getResourceListByIpAndPortAndName(ResourceSearchVo searchVo); - List getResourceListByIpAndPortAndNameWithFilter(ResourceSearchVo searchVo); +// List getResourceListByIpAndPortAndNameWithFilter(ResourceSearchVo searchVo); List getResourceByIdList(List idList); diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java index 94db358a..9db82250 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceBuildSqlServiceImpl.java @@ -296,8 +296,6 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe ResourceEntityConfigVo config = getResourceEntityConfigVo(resourceEntityVo); ResourceQueryCriteriaVo queryCriteriaVo = new ResourceQueryCriteriaVo(searchVo); queryCriteriaVo.setInspectJobPhaseNodeStatusList(null); - queryCriteriaVo.setBatchSearchList(null); - queryCriteriaVo.setIpFieldAttrId(null); List selectItemFieldNameList = new ArrayList<>(); selectItemFieldNameList.add("id"); List filterItemFieldNameList = getFilterItemFieldNameList(queryCriteriaVo); @@ -324,8 +322,6 @@ public class ResourceBuildSqlServiceImpl implements ResourceBuildSqlService, IRe ResourceEntityConfigVo config = getResourceEntityConfigVo(resourceEntityVo); ResourceQueryCriteriaVo queryCriteriaVo = new ResourceQueryCriteriaVo(searchVo); queryCriteriaVo.setInspectJobPhaseNodeStatusList(null); - queryCriteriaVo.setBatchSearchList(null); - queryCriteriaVo.setNameFieldAttrId(null); List selectItemFieldNameList = new ArrayList<>(); selectItemFieldNameList.add("id"); List filterItemFieldNameList = getFilterItemFieldNameList(queryCriteriaVo); diff --git a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java index 89f5d819..ad985a18 100644 --- a/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java +++ b/src/main/java/neatlogic/module/cmdb/service/resourcecenter/resource/ResourceCenterResourceServiceImpl.java @@ -864,111 +864,111 @@ public class ResourceCenterResourceServiceImpl implements IResourceCenterResourc return new ArrayList<>(); } - @Override - public Long getResourceIdByIpAndPortAndName(ResourceSearchVo searchVo) { - String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); - String mode = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_SQL_MODE); - Long newId = null; - Long oldId = null; - if (Objects.equals(mode, JSQLPARSER_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { - String sql = resourceBuildSqlService.buildGetResourceIdByIpAndPortAndNameSql(searchVo); - newId = resourceMapper.getIdBySql(sql); - } - if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { - oldId = resourceMapper.getResourceIdByIpAndPortAndName(searchVo); - } - if (Objects.equals(enable, COMPARISON_ENABLED)) { - if (!Objects.equals(newId, oldId)) { - JSONObject resultObj = new JSONObject(); - resultObj.put("newId", newId); - resultObj.put("oldId", oldId); - logger.error("资产清单新旧SQL获取结果不一致:{}", resultObj); - } - } - if (Objects.equals(mode, JSQLPARSER_MODE)) { - return newId; - } else if (Objects.equals(mode, MYBATIS_MODE)) { - return oldId; - } - return null; - } +// @Override +// public Long getResourceIdByIpAndPortAndName(ResourceSearchVo searchVo) { +// String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); +// String mode = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_SQL_MODE); +// Long newId = null; +// Long oldId = null; +// if (Objects.equals(mode, JSQLPARSER_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { +// String sql = resourceBuildSqlService.buildGetResourceIdByIpAndPortAndNameSql(searchVo); +// newId = resourceMapper.getIdBySql(sql); +// } +// if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { +// oldId = resourceMapper.getResourceIdByIpAndPortAndName(searchVo); +// } +// if (Objects.equals(enable, COMPARISON_ENABLED)) { +// if (!Objects.equals(newId, oldId)) { +// JSONObject resultObj = new JSONObject(); +// resultObj.put("newId", newId); +// resultObj.put("oldId", oldId); +// logger.error("资产清单新旧SQL获取结果不一致:{}", resultObj); +// } +// } +// if (Objects.equals(mode, JSQLPARSER_MODE)) { +// return newId; +// } else if (Objects.equals(mode, MYBATIS_MODE)) { +// return oldId; +// } +// return null; +// } - @Override - public List getResourceIdListByIpAndPortAndName(ResourceSearchVo searchVo) { - String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); - String mode = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_SQL_MODE); - List newIdList = new ArrayList<>(); - List oldIdList = new ArrayList<>(); - if (Objects.equals(mode, JSQLPARSER_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { - String sql = resourceBuildSqlService.buildGetResourceIdListByIpAndPortAndNameSql(searchVo); - newIdList = resourceMapper.getIdListBySql(sql); - } - if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { - oldIdList = resourceMapper.getResourceIdListByIpAndPortAndName(searchVo); - } - if (Objects.equals(enable, COMPARISON_ENABLED)) { - if (!Objects.equals(oldIdList, newIdList)) { - JSONObject resultObj = new JSONObject(); - resultObj.put("idList", newIdList); - resultObj.put("oldIdList", oldIdList); - logger.error("资产清单新旧SQL获取结果不一致:{}", resultObj); - } - } - if (Objects.equals(mode, JSQLPARSER_MODE)) { - return newIdList; - } else if (Objects.equals(mode, MYBATIS_MODE)) { - return oldIdList; - } - return new ArrayList<>(); - } +// @Override +// public List getResourceIdListByIpAndPortAndName(ResourceSearchVo searchVo) { +// String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); +// String mode = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_SQL_MODE); +// List newIdList = new ArrayList<>(); +// List oldIdList = new ArrayList<>(); +// if (Objects.equals(mode, JSQLPARSER_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { +// String sql = resourceBuildSqlService.buildGetResourceIdListByIpAndPortAndNameSql(searchVo); +// newIdList = resourceMapper.getIdListBySql(sql); +// } +// if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { +// oldIdList = resourceMapper.getResourceIdListByIpAndPortAndName(searchVo); +// } +// if (Objects.equals(enable, COMPARISON_ENABLED)) { +// if (!Objects.equals(oldIdList, newIdList)) { +// JSONObject resultObj = new JSONObject(); +// resultObj.put("idList", newIdList); +// resultObj.put("oldIdList", oldIdList); +// logger.error("资产清单新旧SQL获取结果不一致:{}", resultObj); +// } +// } +// if (Objects.equals(mode, JSQLPARSER_MODE)) { +// return newIdList; +// } else if (Objects.equals(mode, MYBATIS_MODE)) { +// return oldIdList; +// } +// return new ArrayList<>(); +// } - @Override - public List getResourceListByIpAndPortAndName(ResourceSearchVo searchVo) { - String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); - String mode = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_SQL_MODE); - List newResourceList = new ArrayList<>(); - List oldResourceList = new ArrayList<>(); - if (Objects.equals(mode, JSQLPARSER_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { - String sql = resourceBuildSqlService.buildGetResourceListByIpAndPortAndNameSql(searchVo); - newResourceList = resourceMapper.getResourceSimpleListBySql(sql); - } - if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { - oldResourceList = resourceMapper.getResourceListByIpAndPortAndName(searchVo); - } - if (Objects.equals(enable, COMPARISON_ENABLED)) { - checkResourceListIsEquals(newResourceList, oldResourceList); - } - if (Objects.equals(mode, JSQLPARSER_MODE)) { - return newResourceList; - } else if (Objects.equals(mode, MYBATIS_MODE)) { - return oldResourceList; - } - return new ArrayList<>(); - } +// @Override +// public List getResourceListByIpAndPortAndName(ResourceSearchVo searchVo) { +// String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); +// String mode = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_SQL_MODE); +// List newResourceList = new ArrayList<>(); +// List oldResourceList = new ArrayList<>(); +// if (Objects.equals(mode, JSQLPARSER_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { +// String sql = resourceBuildSqlService.buildGetResourceListByIpAndPortAndNameSql(searchVo); +// newResourceList = resourceMapper.getResourceSimpleListBySql(sql); +// } +// if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { +// oldResourceList = resourceMapper.getResourceListByIpAndPortAndName(searchVo); +// } +// if (Objects.equals(enable, COMPARISON_ENABLED)) { +// checkResourceListIsEquals(newResourceList, oldResourceList); +// } +// if (Objects.equals(mode, JSQLPARSER_MODE)) { +// return newResourceList; +// } else if (Objects.equals(mode, MYBATIS_MODE)) { +// return oldResourceList; +// } +// return new ArrayList<>(); +// } - @Override - public List getResourceListByIpAndPortAndNameWithFilter(ResourceSearchVo searchVo) { - String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); - String mode = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_SQL_MODE); - List newResourceList = new ArrayList<>(); - List oldResourceList = new ArrayList<>(); - if (Objects.equals(mode, JSQLPARSER_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { - String sql = resourceBuildSqlService.buildGetResourceListByIpAndPortAndNameWithFilterSql(searchVo); - newResourceList = resourceMapper.getResourceSimpleListBySql(sql); - } - if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { - oldResourceList = resourceMapper.getResourceListByIpAndPortAndNameWithFilter(searchVo); - } - if (Objects.equals(enable, COMPARISON_ENABLED)) { - checkResourceListIsEquals(newResourceList, oldResourceList); - } - if (Objects.equals(mode, JSQLPARSER_MODE)) { - return newResourceList; - } else if (Objects.equals(mode, MYBATIS_MODE)) { - return oldResourceList; - } - return new ArrayList<>(); - } +// @Override +// public List getResourceListByIpAndPortAndNameWithFilter(ResourceSearchVo searchVo) { +// String enable = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_DATA_COMPARISON_MODE_ENABLE); +// String mode = ConfigManager.getConfig(CmdbTenantConfig.RESOURCECENTER_SQL_MODE); +// List newResourceList = new ArrayList<>(); +// List oldResourceList = new ArrayList<>(); +// if (Objects.equals(mode, JSQLPARSER_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { +// String sql = resourceBuildSqlService.buildGetResourceListByIpAndPortAndNameWithFilterSql(searchVo); +// newResourceList = resourceMapper.getResourceSimpleListBySql(sql); +// } +// if (Objects.equals(mode, MYBATIS_MODE) || Objects.equals(enable, COMPARISON_ENABLED)) { +// oldResourceList = resourceMapper.getResourceListByIpAndPortAndNameWithFilter(searchVo); +// } +// if (Objects.equals(enable, COMPARISON_ENABLED)) { +// checkResourceListIsEquals(newResourceList, oldResourceList); +// } +// if (Objects.equals(mode, JSQLPARSER_MODE)) { +// return newResourceList; +// } else if (Objects.equals(mode, MYBATIS_MODE)) { +// return oldResourceList; +// } +// return new ArrayList<>(); +// } @Override public List getResourceByIdList(List idList) { -- Gitee From 8eb725ad88406c1b7047dd732c9d85f168553c7f Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 8 Sep 2025 17:23:16 +0800 Subject: [PATCH 27/33] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96=E7=BB=84=E5=90=88=E5=B7=A5=E5=85=B7=E2=80=9C=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E2=80=9C=E3=80=81=E2=80=9C=E9=98=B6=E6=AE=B5=E7=BB=84?= =?UTF-8?q?=E2=80=9D=E5=92=8C=E2=80=9C=E9=98=B6=E6=AE=B5=E2=80=9D=E9=83=BD?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=80=89=E6=8B=A9=E6=89=A7=E8=A1=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E6=94=AF=E6=8C=81=E2=80=9C=E5=89=8D=E7=BD=AE=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E5=99=A8=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1500817822023680]自动化组合工具“全局“、“阶段组”和“阶段”都支持选择执行目标支持“前置过滤器” http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1500817822023680 --- .../mapper/resourcecenter/ResourceMapper.java | 2 -- .../mapper/resourcecenter/ResourceMapper.xml | 30 ------------------- 2 files changed, 32 deletions(-) diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java index 7d061c19..5fcfd591 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.java @@ -94,8 +94,6 @@ public interface ResourceMapper extends IResourceCrossoverMapper { List getAppModuleListByAppSystemIdList(ResourceSearchVo searchVo); List getAppModuleListByIdListSimple(@Param("idList") List idList, @Param("needOrder") boolean needOrder); - // 该SQL语句可以使用 getResourceListByIpAndPortAndName 代替 - List getResourceListByResourceVoList(@Param("resourceList") List resourceList,@Param("searchVo") ResourceSearchVo searchVo); List getResourceIdListByAppSystemIdAndModuleIdAndEnvId(ResourceVo resourceVo); diff --git a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml index a0ad717d..0aeb53af 100644 --- a/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml +++ b/src/main/java/neatlogic/module/cmdb/dao/mapper/resourcecenter/ResourceMapper.xml @@ -937,36 +937,6 @@ along with this program. If not, see .--> order by CONVERT(a.abbr_name USING gbk) COLLATE gbk_chinese_ci ASC - -