feat: 2.6.0

1. 优化工作流批次默认状态
This commit is contained in:
byteblogs168 2024-01-12 14:43:36 +08:00
parent 795ab547d9
commit e3a989c1f4
8 changed files with 50 additions and 47 deletions

View File

@ -35,11 +35,6 @@
<scope>provided</scope>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.aizuda</groupId>
<artifactId>easy-retry-client-common</artifactId>
<version>2.5.0</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-tx</artifactId>

View File

@ -31,7 +31,7 @@ public class WorkflowBatchController {
return workflowBatchService.listPage(queryVO);
}
// @LoginRequired
@LoginRequired
@GetMapping("{id}")
public WorkflowDetailResponseVO getWorkflowBatchDetail(@PathVariable("id") Long id) {
return workflowBatchService.getWorkflowBatchDetail(id);

View File

@ -3,6 +3,7 @@ package com.aizuda.easy.retry.server.web.service.impl;
import cn.hutool.core.util.StrUtil;
import com.aizuda.easy.retry.common.core.constant.SystemConstants;
import com.aizuda.easy.retry.common.core.enums.JobOperationReasonEnum;
import com.aizuda.easy.retry.common.core.enums.JobTaskBatchStatusEnum;
import com.aizuda.easy.retry.common.core.enums.StatusEnum;
import com.aizuda.easy.retry.server.common.dto.JobTaskConfig;
import com.aizuda.easy.retry.server.common.exception.EasyRetryServerException;
@ -128,11 +129,9 @@ public class WorkflowBatchServiceImpl implements WorkflowBatchService {
nodeInfo.setJobBatchList(JobBatchResponseVOConverter.INSTANCE.jobTaskBatchToJobBatchResponseVOs(jobTaskBatchList));
// 取第最新的一条状态
nodeInfo.setTaskBatchStatus(jobTaskBatchList.get(0).getTaskBatchStatus());
if (jobTaskBatchList.stream()
.map(JobTaskBatch::getOperationReason)
.filter(Objects::nonNull)
.anyMatch(i -> i == JobOperationReasonEnum.WORKFLOW_NODE_NO_OPERATION_REQUIRED.getReason())) {
.anyMatch(WorkflowBatchServiceImpl::isNoOperation)) {
// 当前节点下面的所有节点都是无需处理的节点
Set<Long> allDescendants = MutableGraphCache.getAllDescendants(graph, nodeInfo.getId());
allNoOperationNode.addAll(allDescendants);
@ -140,6 +139,10 @@ public class WorkflowBatchServiceImpl implements WorkflowBatchService {
// 删除被误添加的节点
allNoOperationNode.remove(nodeInfo.getId());
}
} else {
if (JobTaskBatchStatusEnum.NOT_SUCCESS.contains(workflowTaskBatch.getTaskBatchStatus())) {
allNoOperationNode.add(nodeInfo.getId());
}
}
})
.collect(Collectors.toMap(WorkflowDetailResponseVO.NodeInfo::getId, i -> i));
@ -169,4 +172,9 @@ public class WorkflowBatchServiceImpl implements WorkflowBatchService {
return responseVO;
}
private static boolean isNoOperation(JobTaskBatch i) {
return i.getOperationReason() == JobOperationReasonEnum.WORKFLOW_NODE_NO_OPERATION_REQUIRED.getReason()
|| i.getTaskBatchStatus() == JobTaskBatchStatusEnum.STOP.getStatus();
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,16 +1,16 @@
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Easy Retry</title>
<script type="module" crossorigin src="./assets/JMm1tHoX.js"></script>
<link rel="stylesheet" crossorigin href="./assets/7BncgBnW.css">
</head>
<body>
<div id="app"></div>
</body>
</html>
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Easy Retry</title>
<script type="module" crossorigin src="./assets/gO-EUyiN.js"></script>
<link rel="stylesheet" crossorigin href="./assets/ToN2otMp.css">
</head>
<body>
<div id="app"></div>
</body>
</html>