From a472e70198e0dfbf93cd3928f70e736499146721 Mon Sep 17 00:00:00 2001 From: lvzk <897706680@qq.com> Date: Mon, 7 Apr 2025 12:29:40 +0800 Subject: [PATCH 1/3] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E5=8F=91=E5=99=A8=E5=BA=94=E7=94=A8=E5=B7=A1?= =?UTF-8?q?=E6=A3=80=E4=BD=9C=E4=B8=9A=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E9=9C=80=E9=80=82=E9=85=8D=E5=8A=A8=E6=80=81=E8=A7=86=E5=9B=BE?= =?UTF-8?q?=20#[1394049406173184]=E5=BA=94=E7=94=A8=E6=B8=85=E5=8D=95?= =?UTF-8?q?=E5=8F=91=E5=99=A8=E5=BA=94=E7=94=A8=E5=B7=A1=E6=A3=80=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=8C=96=E9=9C=80=E9=80=82?= =?UTF-8?q?=E9=85=8D=E5=8A=A8=E6=80=81=E8=A7=86=E5=9B=BE=20http://192.168.?= =?UTF-8?q?0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947?= =?UTF-8?q?543042/1394049406173184?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../autoexec/job/node/IUpdateNodes.java | 32 +++++++++ .../autoexec/job/node/UpdateNodesFactory.java | 68 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 src/main/java/neatlogic/framework/autoexec/job/node/IUpdateNodes.java create mode 100644 src/main/java/neatlogic/framework/autoexec/job/node/UpdateNodesFactory.java diff --git a/src/main/java/neatlogic/framework/autoexec/job/node/IUpdateNodes.java b/src/main/java/neatlogic/framework/autoexec/job/node/IUpdateNodes.java new file mode 100644 index 00000000..1f01a9e9 --- /dev/null +++ b/src/main/java/neatlogic/framework/autoexec/job/node/IUpdateNodes.java @@ -0,0 +1,32 @@ +/*Copyright (C) $today.year 深圳极向量科技有限公司 All Rights Reserved. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +package neatlogic.framework.autoexec.job.node; + +import neatlogic.framework.autoexec.dto.combop.AutoexecCombopExecuteNodeConfigVo; +import neatlogic.framework.autoexec.dto.job.AutoexecJobVo; + +public interface IUpdateNodes { + + /** + * 更新自动化执行目标 + * @param executeNodeConfigVo 执行目标配置 + * @param jobVo 作业 + * @param userName 执行用户 + * @param protocolId 协议id + */ + boolean update(AutoexecCombopExecuteNodeConfigVo executeNodeConfigVo, AutoexecJobVo jobVo, String userName, Long protocolId); + +} diff --git a/src/main/java/neatlogic/framework/autoexec/job/node/UpdateNodesFactory.java b/src/main/java/neatlogic/framework/autoexec/job/node/UpdateNodesFactory.java new file mode 100644 index 00000000..6d7c993f --- /dev/null +++ b/src/main/java/neatlogic/framework/autoexec/job/node/UpdateNodesFactory.java @@ -0,0 +1,68 @@ +/*Copyright (C) $today.year 深圳极向量科技有限公司 All Rights Reserved. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU Affero General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU Affero General Public License for more details. + +You should have received a copy of the GNU Affero General Public License +along with this program. If not, see .*/ + +package neatlogic.framework.autoexec.job.node; + +import neatlogic.framework.applicationlistener.core.ModuleInitializedListenerBase; +import neatlogic.framework.autoexec.dto.combop.AutoexecCombopExecuteNodeConfigVo; +import neatlogic.framework.autoexec.dto.job.AutoexecJobVo; +import neatlogic.framework.bootstrap.NeatLogicWebApplicationContext; +import neatlogic.framework.common.RootComponent; +import org.apache.commons.collections4.CollectionUtils; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +@RootComponent +public class UpdateNodesFactory extends ModuleInitializedListenerBase { + + private static final List updateNodeList = new ArrayList<>(); + + + @Override + protected void onInitialized(NeatLogicWebApplicationContext context) { + Map beansOfTypeMap = context.getBeansOfType(IUpdateNodes.class); + if (beansOfTypeMap.size() == 0) { + return; + } + if(CollectionUtils.isNotEmpty(beansOfTypeMap.values())) { + updateNodeList.addAll(beansOfTypeMap.values()); + } + } + + @Override + protected void myInit() { + //ignored + } + + /** + * 遍历所有获取目标的方式,获取到就退出 + * @param jobVo 作业 + * @param executeNodeConfigVo 执行目标配置 + * @param userName 执行用户 + * @param protocolId 协议id + */ + public static boolean updateNodes(AutoexecCombopExecuteNodeConfigVo executeNodeConfigVo, AutoexecJobVo jobVo,String userName,Long protocolId){ + boolean isHasNode = false; + for (IUpdateNodes updateNode : updateNodeList){ + isHasNode = updateNode.update(executeNodeConfigVo,jobVo,userName,protocolId); + if(isHasNode){ + break; + } + } + return isHasNode; + } +} -- Gitee From 848ae69848ef03f401baae1c034a9cedfbcb6ecb Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 7 Apr 2025 19:02:21 +0800 Subject: [PATCH 2/3] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=B8=85=E5=8D=95=E5=8F=91=E5=99=A8=E5=BA=94=E7=94=A8=E5=B7=A1?= =?UTF-8?q?=E6=A3=80=E4=BD=9C=E4=B8=9A=EF=BC=8C=E8=87=AA=E5=8A=A8=E5=8C=96?= =?UTF-8?q?=E9=9C=80=E9=80=82=E9=85=8D=E5=8A=A8=E6=80=81=E8=A7=86=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1394049406173184]应用清单发器应用巡检作业,自动化需适配动态视图 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1394049406173184 --- .../combop/AutoexecCombopExecuteNodeConfigVo.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopExecuteNodeConfigVo.java b/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopExecuteNodeConfigVo.java index ad59f06c..352f5db3 100644 --- a/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopExecuteNodeConfigVo.java +++ b/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopExecuteNodeConfigVo.java @@ -40,6 +40,8 @@ public class AutoexecCombopExecuteNodeConfigVo implements Serializable { private List inputNodeList; @EntityField(name = "过滤器选择条件", type = ApiParamType.JSONOBJECT) private JSONObject filter; // 过滤器 + @EntityField(name = "巡检过滤器", type = ApiParamType.JSONOBJECT) + private JSONObject inspectFilter; @EntityField(name = "上游出参列表", type = ApiParamType.JSONARRAY) private List preOutputList; @@ -75,6 +77,14 @@ public class AutoexecCombopExecuteNodeConfigVo implements Serializable { this.filter = filter; } + public JSONObject getInspectFilter() { + return inspectFilter; + } + + public void setInspectFilter(JSONObject inspectFilter) { + this.inspectFilter = inspectFilter; + } + public List getPreOutputList() { return preOutputList; } @@ -85,6 +95,6 @@ public class AutoexecCombopExecuteNodeConfigVo implements Serializable { @JSONField(serialize = false) public boolean isNull(){ - return CollectionUtils.isEmpty(paramList) && CollectionUtils.isEmpty(selectNodeList) && CollectionUtils.isEmpty(inputNodeList) && MapUtils.isEmpty(filter) && CollectionUtils.isEmpty(preOutputList); + return CollectionUtils.isEmpty(paramList) && CollectionUtils.isEmpty(selectNodeList) && CollectionUtils.isEmpty(inputNodeList) && MapUtils.isEmpty(filter) && MapUtils.isEmpty(inspectFilter) && CollectionUtils.isEmpty(preOutputList); } } -- Gitee From dba123daa7619063a21e4ffd38264e051dd04423 Mon Sep 17 00:00:00 2001 From: "1437892690@qq.com" <1437892690@qq.com> Date: Mon, 7 Apr 2025 23:31:07 +0800 Subject: [PATCH 3/3] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E4=B8=8B=E8=BD=BD=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=96=87=E4=BB=B6=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 关联 #[1394326381232128]增加一个下载服务器日志文件接口 http://192.168.0.96:8090/demo/rdm.html#/story-detail/939050947543040/939050947543042/1394326381232128 --- .../crossover/IAutoexecJobCrossoverService.java | 11 +++++++++++ .../combop/AutoexecCombopExecuteNodeConfigVo.java | 14 +++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/main/java/neatlogic/framework/autoexec/crossover/IAutoexecJobCrossoverService.java b/src/main/java/neatlogic/framework/autoexec/crossover/IAutoexecJobCrossoverService.java index e5b53e23..cd0bff51 100644 --- a/src/main/java/neatlogic/framework/autoexec/crossover/IAutoexecJobCrossoverService.java +++ b/src/main/java/neatlogic/framework/autoexec/crossover/IAutoexecJobCrossoverService.java @@ -16,6 +16,7 @@ along with this program. If not, see .*/ package neatlogic.framework.autoexec.crossover; import neatlogic.framework.autoexec.dto.job.AutoexecJobVo; +import neatlogic.framework.cmdb.dto.resourcecenter.ResourceVo; import neatlogic.framework.crossover.ICrossoverService; import java.util.List; @@ -29,4 +30,14 @@ public interface IAutoexecJobCrossoverService extends ICrossoverService { List searchJob(AutoexecJobVo jobVo); void saveAutoexecCombopJob(AutoexecJobVo jobVo); + + + /** + * 获取目标节点并入库 + * @param jobVo 作业 + * @param resourceVoList 资产列表 + * @param userName 执行用户 + * @param protocolId 协议id + */ + void updateJobPhaseNode(AutoexecJobVo jobVo, List resourceVoList, String userName, Long protocolId); } diff --git a/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopExecuteNodeConfigVo.java b/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopExecuteNodeConfigVo.java index 352f5db3..c20b015f 100644 --- a/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopExecuteNodeConfigVo.java +++ b/src/main/java/neatlogic/framework/autoexec/dto/combop/AutoexecCombopExecuteNodeConfigVo.java @@ -40,8 +40,8 @@ public class AutoexecCombopExecuteNodeConfigVo implements Serializable { private List inputNodeList; @EntityField(name = "过滤器选择条件", type = ApiParamType.JSONOBJECT) private JSONObject filter; // 过滤器 - @EntityField(name = "巡检过滤器", type = ApiParamType.JSONOBJECT) - private JSONObject inspectFilter; + @EntityField(name = "其他场景过滤器", type = ApiParamType.JSONOBJECT) + private JSONObject otherFilter; @EntityField(name = "上游出参列表", type = ApiParamType.JSONARRAY) private List preOutputList; @@ -77,12 +77,12 @@ public class AutoexecCombopExecuteNodeConfigVo implements Serializable { this.filter = filter; } - public JSONObject getInspectFilter() { - return inspectFilter; + public JSONObject getOtherFilter() { + return otherFilter; } - public void setInspectFilter(JSONObject inspectFilter) { - this.inspectFilter = inspectFilter; + public void setOtherFilter(JSONObject otherFilter) { + this.otherFilter = otherFilter; } public List getPreOutputList() { @@ -95,6 +95,6 @@ public class AutoexecCombopExecuteNodeConfigVo implements Serializable { @JSONField(serialize = false) public boolean isNull(){ - return CollectionUtils.isEmpty(paramList) && CollectionUtils.isEmpty(selectNodeList) && CollectionUtils.isEmpty(inputNodeList) && MapUtils.isEmpty(filter) && MapUtils.isEmpty(inspectFilter) && CollectionUtils.isEmpty(preOutputList); + return CollectionUtils.isEmpty(paramList) && CollectionUtils.isEmpty(selectNodeList) && CollectionUtils.isEmpty(inputNodeList) && MapUtils.isEmpty(filter) && MapUtils.isEmpty(otherFilter) && CollectionUtils.isEmpty(preOutputList); } } -- Gitee