From db1593c981278f94cccae3db64ad6b9506d22200 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Fri, 18 Apr 2025 15:49:38 +0800 Subject: [PATCH] =?UTF-8?q?[=E4=BF=AE=E5=A4=8D]=20=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E5=B7=A1=E6=A3=80=E5=AD=98=E5=9C=A8=E7=9B=B8=E5=90=8C=E7=9B=AE?= =?UTF-8?q?=E6=A0=87=E8=8A=82=E7=82=B9=E6=97=B6=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1401577410101248]应用巡检存在相同目标节点时异常 http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947543040/939050947543057/1401577410101248 --- .../inspect/api/job/CreateInspectAppJobApi.java | 6 +++++- .../schedule/plugin/InspectAppSystemScheduleJob.java | 12 +++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/main/java/neatlogic/module/inspect/api/job/CreateInspectAppJobApi.java b/src/main/java/neatlogic/module/inspect/api/job/CreateInspectAppJobApi.java index cccd03c..9647267 100644 --- a/src/main/java/neatlogic/module/inspect/api/job/CreateInspectAppJobApi.java +++ b/src/main/java/neatlogic/module/inspect/api/job/CreateInspectAppJobApi.java @@ -303,13 +303,17 @@ public class CreateInspectAppJobApi extends PrivateApiComponentBase { IResourceCenterDataSource resourceCenterDataSource = ResourceCenterDataSourceFactory.getResourceCenterDataSource(); List appViewList = resourceCenterDataSource.getAppViewList(); if (CollectionUtils.isNotEmpty(appViewList)) { + Set resourceIdSet = new HashSet<>(); for (ResourceEntityVo resourceEntityVo : appViewList) { searchVo.setViewName(resourceEntityVo.getName()); searchVo.setCurrentPage(1); searchVo.setPageSize(100); List resourceList = resourceCenterDataSource.getAppResourceList(searchVo, false); for (ResourceVo resourceVo : resourceList) { - resultList.add(new AutoexecNodeVo(resourceVo)); + if (!resourceIdSet.contains(resourceVo.getId())) { + resourceIdSet.add(resourceVo.getId()); + resultList.add(new AutoexecNodeVo(resourceVo)); + } } } } diff --git a/src/main/java/neatlogic/module/inspect/schedule/plugin/InspectAppSystemScheduleJob.java b/src/main/java/neatlogic/module/inspect/schedule/plugin/InspectAppSystemScheduleJob.java index e583590..65d76e8 100644 --- a/src/main/java/neatlogic/module/inspect/schedule/plugin/InspectAppSystemScheduleJob.java +++ b/src/main/java/neatlogic/module/inspect/schedule/plugin/InspectAppSystemScheduleJob.java @@ -155,7 +155,17 @@ public class InspectAppSystemScheduleJob extends JobBase { searchVo.setTypeId(typeId); List resourceList = resourceCenterDataSource.getAppResourceList(searchVo, false); for (ResourceVo resourceVo : resourceList) { - typeId2NodeListMap.computeIfAbsent(typeId, key -> new ArrayList<>()).add(new AutoexecNodeVo(resourceVo)); + boolean flag = false; + List autoexecNodeList = typeId2NodeListMap.computeIfAbsent(typeId, key -> new ArrayList<>()); + for (AutoexecNodeVo autoexecNodeVo : autoexecNodeList) { + if (Objects.equals(autoexecNodeVo.getId(), resourceVo.getId())) { + flag = true; + break; + } + } + if (!flag) { + autoexecNodeList.add(new AutoexecNodeVo(resourceVo)); + } } } } -- Gitee