diff --git a/src/main/java/neatlogic/module/deploy/job/source/handler/BatchDeployJobSourceHandler.java b/src/main/java/neatlogic/module/deploy/job/source/handler/BatchDeployJobSourceHandler.java new file mode 100644 index 0000000000000000000000000000000000000000..245295014ec98071bbcc1d4d6c387c0f7416d887 --- /dev/null +++ b/src/main/java/neatlogic/module/deploy/job/source/handler/BatchDeployJobSourceHandler.java @@ -0,0 +1,53 @@ +/*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.module.deploy.job.source.handler; + +import com.alibaba.fastjson.JSONObject; +import neatlogic.framework.autoexec.dto.job.AutoexecJobRouteVo; +import neatlogic.framework.autoexec.source.IAutoexecJobSource; +import neatlogic.framework.deploy.constvalue.JobSource; +import org.apache.commons.collections4.CollectionUtils; +import org.springframework.stereotype.Component; + +import java.util.ArrayList; +import java.util.List; + +@Component +public class BatchDeployJobSourceHandler implements IAutoexecJobSource { + + @Override + public String getValue() { + return JobSource.BATCHDEPLOY.getValue(); + } + + @Override + public String getText() { + return JobSource.BATCHDEPLOY.getText(); + } + + @Override + public List getListByUniqueKeyList(List uniqueKeyList) { + if (CollectionUtils.isEmpty(uniqueKeyList)) { + return null; + } + List resultList = new ArrayList<>(); + for (String str : uniqueKeyList) { + String label = "一键发布"; + resultList.add(new AutoexecJobRouteVo(str, label, new JSONObject())); + } + return resultList; + } +} diff --git a/src/main/java/neatlogic/module/deploy/service/DeployBatchJobServiceImpl.java b/src/main/java/neatlogic/module/deploy/service/DeployBatchJobServiceImpl.java index 43d051af601c969bf8791838d9720f5793bacc58..276401c9a2785b66721af0dd493180bb003fa6fc 100644 --- a/src/main/java/neatlogic/module/deploy/service/DeployBatchJobServiceImpl.java +++ b/src/main/java/neatlogic/module/deploy/service/DeployBatchJobServiceImpl.java @@ -117,6 +117,7 @@ public class DeployBatchJobServiceImpl implements DeployBatchJobService, IDeploy jobVo.setParentId(deployJobVo.getId()); jobVo.setInvokeId(deployJobVo.getId()); jobVo.setRouteId(deployJobVo.getInvokeId().toString()); + jobVo.setSource(deployJobVo.getSource()); DeployJobModuleVo deployJobModuleVo = new DeployJobModuleVo(); if (jobTemplateVo.getConfig() != null) { JSONArray selectNodeList = jobTemplateVo.getConfig().getJSONArray("selectNodeList");