From 7bdd9a370c18a33808d8ef03521d769e76922b15 Mon Sep 17 00:00:00 2001
From: lvzk <897706680@qq.com>
Date: Wed, 20 Nov 2024 19:39:47 +0800
Subject: [PATCH 1/3] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E5=8C=96=E4=BD=9C=E4=B8=9A=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5?=
=?UTF-8?q?=E8=8A=82=E7=82=B9=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96=20#[1293?=
=?UTF-8?q?323044618240]=E8=87=AA=E5=8A=A8=E5=8C=96=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5=E8=8A=82=E7=82=B9=E6=80=A7?=
=?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96=20http://192.168.0.96:8090/demo/rdm?=
=?UTF-8?q?.html#/story-detail/939050947543040/939050947543042/12933230446?=
=?UTF-8?q?18240?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../AutoexecJobPhaseNodeErrorType.java | 52 ++++
.../autoexec/constvalue/JobNodeStatus.java | 3 +-
.../dao/mapper/AutoexecJobMapper.java | 26 +-
.../autoexec/dao/mapper/AutoexecJobMapper.xml | 277 +++++++++---------
.../dto/job/AutoexecJobPhaseNodeVo.java | 27 ++
.../autoexec/dto/job/AutoexecJobVo.java | 12 +
6 files changed, 234 insertions(+), 163 deletions(-)
create mode 100644 src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecJobPhaseNodeErrorType.java
diff --git a/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecJobPhaseNodeErrorType.java b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecJobPhaseNodeErrorType.java
new file mode 100644
index 00000000..00dc14bc
--- /dev/null
+++ b/src/main/java/neatlogic/framework/autoexec/constvalue/AutoexecJobPhaseNodeErrorType.java
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2024 深圳极向量科技有限公司 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.constvalue;
+
+import neatlogic.framework.util.$;
+
+public enum AutoexecJobPhaseNodeErrorType{
+ IP_INVALID(1,"ip不合法"),
+ RUNNER_NOT_MATCH(2,"根据ip找不到匹配的runner,请核对runner组配置")
+ ;
+
+ private final int value;
+ private final String text;
+
+ AutoexecJobPhaseNodeErrorType(int value, String text) {
+ this.value = value;
+ this.text = text;
+ }
+
+
+ public Integer getValue() {
+ return value;
+ }
+
+ public static AutoexecJobPhaseNodeErrorType getErrorType(int value){
+ for (AutoexecJobPhaseNodeErrorType errorType : AutoexecJobPhaseNodeErrorType.values()){
+ if(errorType.getValue() == value){
+ return errorType;
+ }
+ }
+ return null;
+ }
+
+ public String getText() {
+ return $.t(text);
+ }
+}
diff --git a/src/main/java/neatlogic/framework/autoexec/constvalue/JobNodeStatus.java b/src/main/java/neatlogic/framework/autoexec/constvalue/JobNodeStatus.java
index 5c179d8a..26baea7a 100755
--- a/src/main/java/neatlogic/framework/autoexec/constvalue/JobNodeStatus.java
+++ b/src/main/java/neatlogic/framework/autoexec/constvalue/JobNodeStatus.java
@@ -17,7 +17,8 @@ public enum JobNodeStatus implements IEnum {
SUCCEED("succeed", "已成功"),
FAILED("failed", "已失败"),
IGNORED("ignored", "已忽略"),
- WAIT_INPUT("waitInput", "待输入");
+ WAIT_INPUT("waitInput", "待输入"),
+ INVALID("invalid", "非法节点");
private final String status;
private final String text;
diff --git a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java
index 3355463c..a6e80ff9 100644
--- a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java
+++ b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java
@@ -133,16 +133,12 @@ public interface AutoexecJobMapper {
List getJobPhaseNodeIdListByNodeVoAndStartNum(@Param("nodeVo") AutoexecJobPhaseNodeVo jobPhaseNodeVo, @Param("startNum") Integer startNum);
- int searchJobPhaseNodeCountWithResource(AutoexecJobPhaseNodeVo jobPhaseNodeVo);
-
int searchJobPhaseNodeCount(AutoexecJobPhaseNodeVo jobPhaseNodeVo);
int searchJobPhaseNodeByDistinctResourceIdCount(AutoexecJobPhaseNodeVo jobPhaseNodeVo);
List getJobPhaseNodeStatusCount(Long jobId);
- int checkIsJobPhaseNodeExist(AutoexecJobPhaseNodeVo nodeVo);
-
List getJobPhaseOperationCustomTemplateListByJobPhaseId(Long jobPhaseId);
List getJobPhaseOpertionIdListByJobPhaseId(Long jobPhaseId);
@@ -309,10 +305,6 @@ public interface AutoexecJobMapper {
int insertJobInvoke(AutoexecJobInvokeVo invokeVo);
- Integer insertIgnoreJobPhaseNodeRunner(AutoexecJobPhaseNodeRunnerVo nodeRunnerVo);
-
- Integer batchInsertJobPhaseNodeRunner(List nodeRunnerVo);
-
Integer insertJobPhaseRunner(@Param("jobId") Long jobId, @Param("jobGroupId") Long jobGroupId, @Param("jobPhaseId") Long jobPhaseId, @Param("runnerMapId") Long runnerMapId, @Param("lcd") Date lcd);
Integer insertJob(AutoexecJobVo jobVo);
@@ -325,6 +317,10 @@ public interface AutoexecJobMapper {
Integer batchInsertJobPhaseNode(List nodeList);
+ Integer batchInsertIgnoreJobPhaseNode(List nodeList);
+
+ Integer batchInsertDuplicateJobPhaseNode(List nodeList);
+
Integer insertJobPhaseOperation(AutoexecJobPhaseOperationVo operationVo);
Integer insertIgnoreJobContent(AutoexecJobContentVo contentVo);
@@ -357,8 +353,6 @@ public interface AutoexecJobMapper {
Integer updateJobPhaseNodeById(AutoexecJobPhaseNodeVo jobPhaseNodeVo);
- Integer updateJobPhaseNodeByJobIdAndPhaseIdAndResourceId(AutoexecJobPhaseNodeVo jobPhaseNodeVo);
-
Integer updateJobPhaseRunnerFireNextByPhaseIdAndRunnerId(@Param("phaseId") Long phaseId, @Param("isFireNext") int isFireNext, @Param("runnerMapId") Long runnerMapId);
Integer updateJobPhaseRunnerFireNextByJobIdAndGroupSortAndRunnerId(@Param("jobId") Long jobId, @Param("groupSort") Integer groupSort, @Param("isFireNext") int isFireNext, @Param("runnerMapId") Long runnerMapId);
@@ -367,7 +361,7 @@ public interface AutoexecJobMapper {
Integer updateJobPhaseLncdById(@Param("jobPhaseId") Long jobPhaseId, @Param("lcd") Date lcd);
- Integer updateJobPhaseNodeIsDeleteByJobPhaseIdAndLcd(@Param("jobPhaseId") Long jobPhaseId, @Param("lcd") Date lcd);
+ Integer updateJobPhaseNodeIsDeleteByJobPhaseIdAndUpdateTag(@Param("jobPhaseId") Long jobPhaseId, @Param("updateTag") Long updateTag);
Integer updateJobParamHashById(@Param("jobId") Long jobId, @Param("paramHash") String paramHash);
@@ -417,13 +411,7 @@ public interface AutoexecJobMapper {
void deleteJobPhaseRunnerByJobId(Long jobId);
- void deleteJobPhaseNodeRunnerByJobId(Long jobId);
-
- void deleteJobPhaseNodeByJobPhaseIdAndLcd(@Param("jobPhaseId") Long jobPhaseId, @Param("lcd") Date lcd);
-
- Integer deleteJobPhaseNodeByJobPhaseIdAndLcdAndStatus(@Param("jobPhaseId") Long jobPhaseId, @Param("lcd") Date lcd, @Param("status") String status);
-
- void deleteJobPhaseNodeRunnerByJobPhaseIdAndLcdAndStatus(@Param("jobPhaseId") Long jobPhaseId, @Param("lcd") Date lcd, @Param("status") String status);
+ Integer deleteJobPhaseNodeByJobPhaseIdAndUpdateTagAndStatus(@Param("jobPhaseId") Long jobPhaseId, @Param("updateTag") Long updateTag, @Param("status") String status);
void deleteJobEvnByJobId(Long jobId);
@@ -444,4 +432,6 @@ public interface AutoexecJobMapper {
void updateJobSqlStatusByJobIdAndPhaseId(@Param("jobId") Long jobId,@Param("phaseId") Long phaseId,@Param("status") String status);
void updateJobPhaseRunnerStatusByJobIdAndPhaseId(@Param("jobId") Long jobId,@Param("phaseId") Long phaseId,@Param("status") String status);
+
+ void updateJobPhaseNodeBatch(@Param("jobPhaseId") Long phaseId,@Param("resourceIdList") List resourceIdList,@Param("status") String value,@Param("updateTag") long time);
}
diff --git a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml
index 3bced62d..943c71f6 100644
--- a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml
+++ b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml
@@ -295,10 +295,11 @@ along with this program. If not, see .-->
ajpn.`start_time` AS startTime,
ajpn.`end_time` AS endTime,
ajpn.`status`,
+ ajpn.`error_type` as errorType,
ajpn.`protocol_id` as protocolId,
ajpn.`resource_id` AS resourceId,
ajpn.`warn_count` as warnCount,
- ri.`id` AS nodeId,
+ ajpn.`resource_id` AS nodeId,
ajpn.name AS nodeName,
ajpn.type AS nodeType,
ajpn.is_delete as isDelete,
@@ -312,9 +313,7 @@ along with this program. If not, see .-->
`autoexec_job_phase_node` ajpn
LEFT JOIN `autoexec_job_phase` ajp ON ajpn.`job_phase_id` = ajp.`id`
left join `autoexec_job_group` ajg on ajp.job_id = ajg.job_id and ajp.group_id = ajg.id
- LEFT JOIN @{DATA_SCHEMA}.`scence_ipobject_id` ri ON ajpn.resource_id = ri.`id`
- LEFT JOIN `autoexec_job_phase_node_runner` ajpnr ON ajpn.id = ajpnr.`node_id`
- LEFT JOIN `runner_map` arm ON ajpnr.`runner_map_id` = arm.`id`
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
LEFT JOIN `runner` ap ON arm.`runner_id` = ap.`id`
@@ -358,8 +357,7 @@ along with this program. If not, see .-->
`autoexec_job_phase_node` ajpn
LEFT JOIN `autoexec_job_phase` ajp ON ajpn.`job_phase_id` = ajp.`id`
left join `autoexec_job_group` ajg on ajp.job_id = ajg.job_id and ajp.group_id = ajg.id
- LEFT JOIN `autoexec_job_phase_node_runner` ajpnr ON ajpn.id = ajpnr.`node_id`
- LEFT JOIN `runner_map` arm ON ajpnr.`runner_map_id` = arm.`id`
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
LEFT JOIN `runner` ap ON arm.`runner_id` = ap.`id`
@@ -401,20 +399,6 @@ along with this program. If not, see .-->
limit #{startNum}, #{nodeVo.pageSize}
-
-
-
-
@@ -958,8 +931,7 @@ along with this program. If not, see .-->
ajpn.`status`,
arm.`runner_id` as runnerId
FROM `autoexec_job_phase_node` ajpn
- LEFT JOIN `autoexec_job_phase_node_runner` ajpnr on ajpn.id = ajpnr.`node_id`
- LEFT JOIN `runner_map` arm ON ajpnr.`runner_map_id` = arm.`id`
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
WHERE ajpn.`job_id` = #{jobId}
AND ajpn.`job_phase_id` = #{phaseId}
@@ -988,9 +960,8 @@ along with this program. If not, see .-->
arm.`runner_id` AS runnerId,
ajp.`name` AS jobPhaseName
FROM `autoexec_job_phase_node` ajpn
- LEFT JOIN `autoexec_job_phase_node_runner` ajpnr ON ajpn.id = ajpnr.`node_id`
LEFT JOIN `autoexec_job_phase` ajp ON ajpn.`job_phase_id` = ajp.`id`
- LEFT JOIN `runner_map` arm ON ajpnr.`runner_map_id` = arm.`id`
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
where ajpn.`job_id` = #{jobId} and ajp.`name` = #{phaseName} and arm.`runner_id` = #{runnerId} and
ajpn.`status` not in
@@ -1027,9 +998,8 @@ along with this program. If not, see .-->
ajpn.`end_time` AS endTime,
ajpn.`status`
FROM `autoexec_job_phase_node` ajpn
- left join autoexec_job_phase_node_runner ajpnr on ajpn.id = ajpnr.node_id
where ajpn.`job_id` = #{jobId} and ajpn.`job_phase_id` = #{phaseId}
- and ajpnr.runner_map_id = #{runnerMapId}
+ and ajpn.runner_map_id = #{runnerMapId}
and
ajpn.`status` not in
@@ -1065,10 +1035,9 @@ along with this program. If not, see .-->
ajpn.`end_time` AS endTime,
ajpn.`status`,
ajpn.`resource_id` as resourceId,
- ajpnr.runner_map_id as runnerMapId
+ ajpn.runner_map_id as runnerMapId
FROM `autoexec_job_phase_node` ajpn
- left join autoexec_job_phase_node_runner ajpnr on ajpn.id = ajpnr.node_id
- where ajpn.`job_id` = #{jobId}
+ where ajpn.`job_id` = #{jobId} and status not in ('error','ignored')
.-->
@@ -1280,11 +1248,10 @@ along with this program. If not, see .-->
ajpn.`type` as nodeType,
ajpn.`protocol_id` as protocolId,
ajpn.`status`,
- ajpnr.runner_map_id as runnerMapId,
+ ajpn.runner_map_id as runnerMapId,
r.url as runnerUrl
FROM `autoexec_job_phase_node` ajpn
- LEFT JOIN `autoexec_job_phase_node_runner` ajpnr ON ajpnr.`node_id` = ajpn.`id`
- LEFT JOIN `runner_map` arm ON ajpnr.`runner_map_id` = arm.`id`
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
LEFT JOIN `runner` r on arm.runner_id = r.id
where ajpn.`id` in
@@ -1307,11 +1274,10 @@ along with this program. If not, see .-->
ajpn.`type` as nodeType,
ajpn.`protocol_id` as protocolId,
ajpn.`status`,
- ajpnr.runner_map_id as runnerMapId,
+ ajpn.runner_map_id as runnerMapId,
r.url as runnerUrl
FROM `autoexec_job_phase_node` ajpn
- LEFT JOIN `autoexec_job_phase_node_runner` ajpnr ON ajpnr.`node_id` = ajpn.`id`
- LEFT JOIN `runner_map` arm ON ajpnr.`runner_map_id` = arm.`id`
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
LEFT JOIN `runner` r on arm.runner_id = r.id
where ajpn.`job_phase_id` = #{jobPhaseId} and ajpn.`is_delete` = 0 and ajpn.`status` not in
@@ -1390,8 +1356,7 @@ along with this program. If not, see .-->
ap.`url` AS runnerUrl
FROM `autoexec_job_phase_node` ajpn
LEFT JOIN `autoexec_job_phase` ajp ON ajpn.`job_phase_id` = ajp.`id`
- LEFT JOIN `autoexec_job_phase_node_runner` ajpnr ON ajpn.id = ajpnr.`node_id`
- LEFT JOIN `runner_map` arm ON ajpnr.`runner_map_id` = arm.`id`
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
LEFT JOIN `runner` ap ON arm.`runner_id` = ap.`id`
where ajpn.`job_phase_id` = #{jobPhaseId}
@@ -1422,8 +1387,7 @@ along with this program. If not, see .-->
ap.`url` AS runnerUrl
FROM `autoexec_job_phase_node` ajpn
LEFT JOIN `autoexec_job_phase` ajp ON ajpn.`job_phase_id` = ajp.`id`
- LEFT JOIN `autoexec_job_phase_node_runner` ajpnr ON ajpn.id = ajpnr.`node_id`
- LEFT JOIN `runner_map` arm ON ajpnr.`runner_map_id` = arm.`id`
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
LEFT JOIN `runner` ap ON arm.`runner_id` = ap.`id`
where ajpn.job_id = #{jobId} and ajp.`name` = #{jobPhaseName}
@@ -1548,8 +1512,7 @@ along with this program. If not, see .-->
ajpn.`resource_id` as resourceId
FROM `autoexec_job_phase_node` ajpn
LEFT JOIN `autoexec_job_phase` ajp ON ajpn.`job_phase_id` = ajp.`id`
- LEFT JOIN `autoexec_job_phase_node_runner` ajpnr ON ajpn.`id` = ajpnr.`node_id`
- WHERE ajpnr.`runner_map_id` = #{runnerId}
+ WHERE ajpn.`runner_map_id` = #{runnerId}
AND ajpn.`job_phase_id` IN
#{jobPhaseId}
@@ -1663,12 +1626,12 @@ along with this program. If not, see .-->
ar.`url`,
ar.`host`,
ar.`port`,
- ajpr.runner_map_id as runnerMapId
- FROM `autoexec_job_phase_node_runner` ajpr
- LEFT JOIN `runner_map` arm ON ajpr.`runner_map_id` = arm.`id`
+ ajpn.runner_map_id as runnerMapId
+ FROM `autoexec_job_phase_node` ajpn
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
LEFT JOIN `runner` ar ON arm.`runner_id` = ar.`id`
- WHERE ajpr.`job_id` = #{jobId}
- and ajpr.node_id in
+ WHERE ajpn.`job_id` = #{jobId}
+ and ajpn.node_id in
#{nodeId}
@@ -1676,9 +1639,9 @@ along with this program. If not, see .-->
.-->
ar.`url`,
ar.`host`,
ar.`port`,
- ajpnr.runner_map_id as runnerMapId
- FROM `autoexec_job_phase_node_runner` ajpnr
- LEFT JOIN `runner_map` arm ON ajpnr.`runner_map_id` = arm.`id`
+ ajpn.runner_map_id as runnerMapId
+ FROM `autoexec_job_phase_node` ajpn
+ LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
LEFT JOIN `runner` ar ON arm.`runner_id` = ar.`id`
- WHERE ajpnr.`job_phase_id` = #{value}
+ WHERE ajpn.`job_phase_id` = #{value}
WHERE `job_id` = #{jobId} and `job_phase_id` = #{phaseId}
+
+ UPDATE
+ `autoexec_job_phase_node`
+ SET `update_tag` = #{updateTag},
+ `status` = #{status},
+ `start_time` = null,
+ `end_time` = null
+ WHERE
+ `job_phase_id` = #{jobPhaseId}
+ and `resource_id` in
+
+ #{resourceId}
+
+ and `status` not in ('invalid')
+
DELETE
@@ -3169,38 +3180,16 @@ along with this program. If not, see .-->
FROM `autoexec_job_phase_runner`
WHERE `job_id` = #{value}
-
- DELETE ajpnr
- FROM `autoexec_job_phase_node_runner` ajpnr
- LEFT JOIN `autoexec_job_phase_node` ajpn ON ajpnr.`node_id` = ajpn.`id`
- WHERE ajpn.`job_id` = #{value}
- and ajpn.`is_executed` = 0
-
-
- DELETE
- FROM `autoexec_job_phase_node`
- where `job_phase_id` = #{jobPhaseId}
- and (`lcd` != #{lcd} OR `lcd` IS NULL)
- and `is_executed` = 0
-
-
+
+
DELETE
FROM `autoexec_job_phase_node`
where `job_phase_id` = #{jobPhaseId}
- and (`lcd` != #{lcd} OR `lcd` IS NULL)
+ and `update_tag` != #{updateTag}
and `status` = #{status}
and `is_delete` = 0
and `is_executed` = 0
-
- DELETE ajpnr
- FROM `autoexec_job_phase_node_runner` ajpnr
- LEFT JOIN `autoexec_job_phase_node` ajpn ON ajpnr.`node_id` = ajpn.`id`
- WHERE ajpn.`job_phase_id` = #{jobPhaseId}
- and (ajpn.`lcd` != #{lcd} OR ajpn.`lcd` IS NULL)
- and ajpn.`status` = #{status}
- and ajpn.`is_executed` = 0
-
DELETE
FROM `autoexec_job_env`
diff --git a/src/main/java/neatlogic/framework/autoexec/dto/job/AutoexecJobPhaseNodeVo.java b/src/main/java/neatlogic/framework/autoexec/dto/job/AutoexecJobPhaseNodeVo.java
index e4089047..f68f9b42 100644
--- a/src/main/java/neatlogic/framework/autoexec/dto/job/AutoexecJobPhaseNodeVo.java
+++ b/src/main/java/neatlogic/framework/autoexec/dto/job/AutoexecJobPhaseNodeVo.java
@@ -17,6 +17,7 @@ package neatlogic.framework.autoexec.dto.job;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField;
+import neatlogic.framework.autoexec.constvalue.AutoexecJobPhaseNodeErrorType;
import neatlogic.framework.autoexec.constvalue.JobNodeStatus;
import neatlogic.framework.autoexec.dto.INodeDetail;
import neatlogic.framework.autoexec.dto.combop.AutoexecCombopParamVo;
@@ -105,6 +106,8 @@ public class AutoexecJobPhaseNodeVo extends AutoexecJobNodeVo implements INodeDe
private Integer isExecuted;//是否执行过,用于标识执行过的节点不能删除
@JSONField(serialize = false)
private Integer isDownloadGroup;//是否下载组节点,用于下载节点接口
+ @EntityField(name = "初始化节点异常类型", type = ApiParamType.STRING)
+ private Integer errorType;
public AutoexecJobPhaseNodeVo() {
}
@@ -466,4 +469,28 @@ public class AutoexecJobPhaseNodeVo extends AutoexecJobNodeVo implements INodeDe
this.isDownloadGroup = isDownloadGroup;
}
+ public Long getUpdateTag(){
+ if(this.getLcd() != null){
+ return this.getLcd().getTime();
+ }
+ return null;
+ }
+
+ public Integer getErrorType() {
+ return errorType;
+ }
+
+ public void setErrorType(Integer errorType) {
+ this.errorType = errorType;
+ }
+
+ public String getErrorMsg() {
+ if(errorType != null){
+ AutoexecJobPhaseNodeErrorType errorTypeEnum = AutoexecJobPhaseNodeErrorType.getErrorType(errorType);
+ if(errorTypeEnum != null){
+ return errorTypeEnum.getText();
+ }
+ }
+ return StringUtils.EMPTY;
+ }
}
diff --git a/src/main/java/neatlogic/framework/autoexec/dto/job/AutoexecJobVo.java b/src/main/java/neatlogic/framework/autoexec/dto/job/AutoexecJobVo.java
index 3f49f0fc..19248bb6 100644
--- a/src/main/java/neatlogic/framework/autoexec/dto/job/AutoexecJobVo.java
+++ b/src/main/java/neatlogic/framework/autoexec/dto/job/AutoexecJobVo.java
@@ -257,6 +257,10 @@ public class AutoexecJobVo extends BaseEditorVo implements Serializable {
@EntityField(name = "runner执行组标签", type = ApiParamType.JSONOBJECT)
private ParamMappingVo runnerGroupTag;
+ @JSONField(serialize = false)
+ @EntityField(name = "是否第一次初始化", type = ApiParamType.JSONOBJECT)
+ private int isFirstInit = 0;
+
public AutoexecJobVo() {
}
@@ -1083,4 +1087,12 @@ public class AutoexecJobVo extends BaseEditorVo implements Serializable {
public void setRunnerGroupTag(ParamMappingVo runnerGroupTag) {
this.runnerGroupTag = runnerGroupTag;
}
+
+ public int getIsFirstInit() {
+ return isFirstInit;
+ }
+
+ public void setIsFirstInit(int isFirstInit) {
+ this.isFirstInit = isFirstInit;
+ }
}
--
Gitee
From 9be90685f08b0eb8c9a5be3a0a3416cd16b487a8 Mon Sep 17 00:00:00 2001
From: lvzk <897706680@qq.com>
Date: Thu, 21 Nov 2024 17:25:45 +0800
Subject: [PATCH 2/3] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E5=8C=96=E4=BD=9C=E4=B8=9A=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5?=
=?UTF-8?q?=E8=8A=82=E7=82=B9=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96=20#[1293?=
=?UTF-8?q?323044618240]=E8=87=AA=E5=8A=A8=E5=8C=96=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5=E8=8A=82=E7=82=B9=E6=80=A7?=
=?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96=20http://192.168.0.96:8090/demo/rdm?=
=?UTF-8?q?.html#/story-detail/939050947543040/939050947543042/12933230446?=
=?UTF-8?q?18240?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../dao/mapper/AutoexecJobMapper.java | 8 ++-
.../autoexec/dao/mapper/AutoexecJobMapper.xml | 64 +++++++++++--------
2 files changed, 41 insertions(+), 31 deletions(-)
diff --git a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java
index a6e80ff9..4a504738 100644
--- a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java
+++ b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java
@@ -150,8 +150,6 @@ public interface AutoexecJobMapper {
int updateJobPhaseNodeStatus(AutoexecJobPhaseNodeVo nodeVo);
- int updateJobPhaseNodeStatusByJobIdAndJobPhaseIdListAndRunnerId(@Param("jobId") Long jobId, @Param("jobPhaseIdList") List jobPhaseIdList, @Param("nodeStatusList") List jobNodeStatusList, @Param("runnerId") Long runnerId);
-
int searchJobPhaseSqlCount(AutoexecJobPhaseNodeVo jobPhaseNodeVo);
AutoexecJobPhaseNodeVo getJobPhaseNodeInfoByJobNodeId(@Param("nodeId") Long nodeId);
@@ -164,7 +162,7 @@ public interface AutoexecJobMapper {
List getJobPhaseNodeListByJobIdAndPhaseNameAndExceptStatusAndRunnerId(@Param("jobId") Long jobId, @Param("phaseName") String phaseName, @Param("exceptStatus") List exceptStatus, @Param("runnerId") Long runnerId);
- List getJobPhaseNodeListByJobIdAndPhaseIdAndExceptStatus(@Param("jobId") Long jobId, @Param("phaseId") Long phaseId, @Param("exceptStatus") List exceptStatus);
+ List getJobPhaseNodeListByJobIdAndPhaseIdAndExceptStatus(@Param("phaseId") Long phaseId, @Param("exceptStatus") List exceptStatus);
List getJobPhaseNodeListByJobIdAndPhaseIdAndExceptStatusAndRunnerMapId(@Param("jobId") Long jobId, @Param("phaseId") Long phaseId, @Param("exceptStatus") List exceptStatus, @Param("runnerMapId") Long runnerMapId);
@@ -434,4 +432,8 @@ public interface AutoexecJobMapper {
void updateJobPhaseRunnerStatusByJobIdAndPhaseId(@Param("jobId") Long jobId,@Param("phaseId") Long phaseId,@Param("status") String status);
void updateJobPhaseNodeBatch(@Param("jobPhaseId") Long phaseId,@Param("resourceIdList") List resourceIdList,@Param("status") String value,@Param("updateTag") long time);
+
+ void updateJobPhaseNodeListStatusByPhaseIdAndExceptStatus(@Param("phaseId") Long phaseId, @Param("exceptStatus") List exceptStatus,@Param("status") String status);
+
+ Integer isHasPendingNode(Long jobPhaseId);
}
diff --git a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml
index 943c71f6..a8548a98 100644
--- a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml
+++ b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml
@@ -972,15 +972,10 @@ along with this program. If not, see .-->
.-->
LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
LEFT JOIN `runner` ar ON arm.`runner_id` = ar.`id`
WHERE ajpn.`job_id` = #{jobId}
- and ajpn.node_id in
+ and ajpn.id in
#{nodeId}
@@ -1653,8 +1648,8 @@ along with this program. If not, see .-->
ar.`port`,
ajpn.runner_map_id as runnerMapId
FROM `autoexec_job_phase_node` ajpn
- LEFT JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
- LEFT JOIN `runner` ar ON arm.`runner_id` = ar.`id`
+ JOIN `runner_map` arm ON ajpn.`runner_map_id` = arm.`id`
+ JOIN `runner` ar ON arm.`runner_id` = ar.`id`
WHERE ajpn.`job_phase_id` = #{value}
.-->
WHERE aj.`parent_id` = #{value} for
update
+
INSERT INTO `autoexec_job` (`id`,
@@ -2835,6 +2836,7 @@ along with this program. If not, see .-->
, `end_time` = NULL
WHERE `job_id` = #{jobId}
and `is_delete` = #{isDelete}
+ and `status` not in ('invalid')
UPDATE `autoexec_job_phase_node`
@@ -2843,6 +2845,7 @@ along with this program. If not, see .-->
, `end_time` = NULL
WHERE `job_phase_id` = #{jobPhaseId}
and `is_delete` = #{isDelete}
+ and `status` not in ('invalid')
UPDATE
@@ -2900,6 +2903,7 @@ along with this program. If not, see .-->
#{nodeId}
+ and `status` != 'invalid'
and `is_delete` = 0
@@ -2921,22 +2925,6 @@ along with this program. If not, see .-->
WHERE `id` = #{id}
-
- UPDATE
- `autoexec_job_phase_node`
- SET
- `end_time` = NOW(3),
- `status` = #{status}
- WHERE `job_id` = #{jobId}
- AND `job_phase_id` in
-
- #{jobPhaseId}
-
- and `status` in
-
- #{nodeStatus}
-
-
update `autoexec_job_phase_runner`
set is_fire_next = #{isFireNext}
@@ -3043,6 +3031,7 @@ along with this program. If not, see .-->
set `is_delete` = 1
where `job_phase_id` = #{jobPhaseId}
and `update_tag` != #{updateTag}
+ and `status` not in ('invalid','ignored')
and `is_delete` != 1
@@ -3132,7 +3121,26 @@ along with this program. If not, see .-->
#{resourceId}
- and `status` not in ('invalid')
+ and `status` not in ('invalid',#{status})
+
+
+ UPDATE
+ `autoexec_job_phase_node`
+ SET
+ `status` = #{status},
+
+ `start_time` = null,
+
+
+ `end_time` = null
+
+ WHERE `job_phase_id` = #{phaseId} and
+ `status` not in
+
+ #{status}
+
+ and `status` != 'invalid'
+ and `is_delete` = 0
--
Gitee
From d26557d4183cf33bc11b1cf80be71ee11441dc42 Mon Sep 17 00:00:00 2001
From: lvzk <897706680@qq.com>
Date: Thu, 21 Nov 2024 19:58:11 +0800
Subject: [PATCH 3/3] =?UTF-8?q?[=E5=8A=9F=E8=83=BD]=E8=87=AA=E5=8A=A8?=
=?UTF-8?q?=E5=8C=96=E4=BD=9C=E4=B8=9A=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5?=
=?UTF-8?q?=E8=8A=82=E7=82=B9=E6=80=A7=E8=83=BD=E4=BC=98=E5=8C=96=20#[1293?=
=?UTF-8?q?323044618240]=E8=87=AA=E5=8A=A8=E5=8C=96=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=89=B9=E9=87=8F=E6=8F=92=E5=85=A5=E8=8A=82=E7=82=B9=E6=80=A7?=
=?UTF-8?q?=E8=83=BD=E4=BC=98=E5=8C=96=20http://192.168.0.96:8090/demo/rdm?=
=?UTF-8?q?.html#/story-detail/939050947543040/939050947543042/12933230446?=
=?UTF-8?q?18240?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../autoexec/dao/mapper/AutoexecJobMapper.java | 2 --
.../autoexec/dao/mapper/AutoexecJobMapper.xml | 11 +----------
2 files changed, 1 insertion(+), 12 deletions(-)
diff --git a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java
index 4a504738..5baf7dbd 100644
--- a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java
+++ b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.java
@@ -331,8 +331,6 @@ public interface AutoexecJobMapper {
Integer updateJobPhaseStatusByJobIdAndPhaseStatus(@Param("jobId") Long jobId, @Param("whereStatus") String whereStatus, @Param("status") String status);
- Integer updateJobPhaseNodeStatusByJobIdAndIsDelete(@Param("jobId") Long id, @Param("status") String status, @Param("isDelete") Integer isDelete);
-
Integer updateJobPhaseNodeStatusByJobPhaseIdAndIsDelete(@Param("jobPhaseId") Long id, @Param("status") String status, @Param("isDelete") Integer isDelete);
Integer updateJobPhaseRunnerStatusBatch(@Param("phaseIdList") List phaseIdList, @Param("status") String phaseStatus, @Param("runnerId") Long runnerId);
diff --git a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml
index a8548a98..a6a3edd8 100644
--- a/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml
+++ b/src/main/java/neatlogic/framework/autoexec/dao/mapper/AutoexecJobMapper.xml
@@ -2828,16 +2828,7 @@ along with this program. If not, see .-->
, `end_time` = NULL
WHERE `job_id` = #{jobId}
-
- UPDATE `autoexec_job_phase_node`
- SET `status` = #{status}
- , `start_time` = NULL
- , `end_time` = NULL
- WHERE `job_id` = #{jobId}
- and `is_delete` = #{isDelete}
- and `status` not in ('invalid')
-
UPDATE `autoexec_job_phase_node`
SET `status` = #{status}
@@ -3121,7 +3112,7 @@ along with this program. If not, see .-->
#{resourceId}
- and `status` not in ('invalid',#{status})
+ and `status` != 'invalid'
UPDATE
--
Gitee