style: cs-fix

This commit is contained in:
dhb52 2024-05-10 11:44:56 +08:00
parent 45b2122941
commit e48a53698c

View File

@ -133,8 +133,8 @@ public class WorkflowServiceImpl implements WorkflowService {
workflowRequestVO.getGroupName(), workflowRequestVO.getGroupName(),
workflow.getId(), nodeConfig, graph, workflow.getId(), nodeConfig, graph,
workflow.getVersion()); workflow.getVersion());
log.info("图构建完成. graph:[{}]", graph); log.info("图构建完成. graph:[{}]", graph);
// 保存图信息 // 保存图信息
workflow.setVersion(null); workflow.setVersion(null);
workflow.setFlowInfo(JsonUtil.toJsonString(GraphUtils.serializeGraphToJson(graph))); workflow.setFlowInfo(JsonUtil.toJsonString(GraphUtils.serializeGraphToJson(graph)));
@ -250,10 +250,12 @@ public class WorkflowServiceImpl implements WorkflowService {
workflow.setVersion(version); workflow.setVersion(version);
workflow.setNextTriggerAt(calculateNextTriggerAt(workflowRequestVO, DateUtils.toNowMilli())); workflow.setNextTriggerAt(calculateNextTriggerAt(workflowRequestVO, DateUtils.toNowMilli()));
workflow.setFlowInfo(JsonUtil.toJsonString(GraphUtils.serializeGraphToJson(graph))); workflow.setFlowInfo(JsonUtil.toJsonString(GraphUtils.serializeGraphToJson(graph)));
Assert.isTrue(workflowMapper.update(workflow, new LambdaQueryWrapper<Workflow>() Assert.isTrue(
workflowMapper.update(workflow,
new LambdaQueryWrapper<Workflow>()
.eq(Workflow::getId, workflow.getId()) .eq(Workflow::getId, workflow.getId())
.eq(Workflow::getVersion, version) .eq(Workflow::getVersion, version)) > 0,
) > 0, () -> new SnailJobServerException("更新失败")); () -> new SnailJobServerException("更新失败"));
return Boolean.TRUE; return Boolean.TRUE;
} }
@ -288,7 +290,8 @@ public class WorkflowServiceImpl implements WorkflowService {
Workflow workflow = workflowMapper.selectById(id); Workflow workflow = workflowMapper.selectById(id);
Assert.notNull(workflow, () -> new SnailJobServerException("workflow can not be null.")); Assert.notNull(workflow, () -> new SnailJobServerException("workflow can not be null."));
long count = accessTemplate.getGroupConfigAccess().count(new LambdaQueryWrapper<GroupConfig>() long count = accessTemplate.getGroupConfigAccess().count(
new LambdaQueryWrapper<GroupConfig>()
.eq(GroupConfig::getGroupName, workflow.getGroupName()) .eq(GroupConfig::getGroupName, workflow.getGroupName())
.eq(GroupConfig::getNamespaceId, workflow.getNamespaceId()) .eq(GroupConfig::getNamespaceId, workflow.getNamespaceId())
.eq(GroupConfig::getGroupStatus, StatusEnum.YES.getStatus()) .eq(GroupConfig::getGroupStatus, StatusEnum.YES.getStatus())