Commit ca9264b1 by huangfusuper

修正追加日志

parent 9079b758
......@@ -84,6 +84,7 @@ public class ApiNodeServiceImpl implements ApiNodeService {
String runParam = runNode.getRunParam();
RunParamWrapped runParamWrapped = new RunParamWrapped();
runParamWrapped.setPrivateParam(runParam);
runParamWrapped.setPublicParamMap(runNode.getPublicParam());
schedule.setNodeId(Integer.valueOf(runNode.getNodeId()));
schedule.setRunId(runId);
......@@ -91,6 +92,7 @@ public class ApiNodeServiceImpl implements ApiNodeService {
schedule.setIsVirtual(NodePropertyEnum.ISNOT_VIRTUAL.getCode());
schedule.setRunParam(JSON.toJSONString(runParamWrapped));
schedule.setRunCommand(runNode.getRunCmd());
schedule.setNodeDesc(runNode.getHasAddLogToFlow());
schedule.setRunSource(runNode.getRunSource());
schedule.setScriptUrls(runNode.getScriptUrl());
schedule.setJobType(runNode.getJobType());
......
......@@ -41,6 +41,8 @@ public class JavaNodeExecutorTask implements TimerTask {
public static final String HTTP_PRE = "http://";
public static final String HTTP_SUFFIX = "/myth-job-admin/api/callback/callbackRes";
public static final String HTTP_SUFFIX_FLOW = "/myth-job-admin/api/callback/flowFreeNodeCallbackRes";
private final JobTaskSchedule mythJobTaskSchedule;
public JavaNodeExecutorTask(JobTaskSchedule mythJobTaskSchedule) {
......@@ -69,6 +71,7 @@ public class JavaNodeExecutorTask implements TimerTask {
}
private void runJob(JobTaskSchedule mythJobTaskSchedule) {
String hasRelatedFlow = mythJobTaskSchedule.getNodeDesc();
RunJavaServiceImpl service = SpringUtil.getBean(RunJavaServiceImpl.class);
JobTaskRunLogServiceImpl jobTaskRunLogService = SpringUtil.getBean(JobTaskRunLogServiceImpl.class);
JobTaskRunLogWithBLOBs jobTaskRunLogById = null;
......@@ -85,7 +88,13 @@ public class JavaNodeExecutorTask implements TimerTask {
PluginRpcRequestPacket request = new PluginRpcRequestPacket();
GetRegConfig getRegConfig = SpringUtil.getBean(GetRegConfig.class);
TreeSet<String> gatewayConf = getRegConfig.getGatewayConf();
List<String> callUrlList = gatewayConf.stream().map(callbackIp -> String.format("%s%s%s", HTTP_PRE, callbackIp, HTTP_SUFFIX)).collect(Collectors.toList());
List<String> callUrlList = gatewayConf.stream().map(callbackIp -> {
if("2".equals(hasRelatedFlow)){
return String.format("%s%s%s", HTTP_PRE, callbackIp, HTTP_SUFFIX);
}else{
return String.format("%s%s%s", HTTP_PRE, callbackIp, HTTP_SUFFIX_FLOW);
}
}).collect(Collectors.toList());
request.setCallbackUrl(JSON.toJSONString(callUrlList));
CommunicationParam communicationParam = new CommunicationParam();
......
......@@ -3,6 +3,7 @@ package com.byit.dto.plugin;
import lombok.Data;
import java.io.Serializable;
import java.util.Map;
/**
* @Description 运行节点信息
......@@ -50,5 +51,15 @@ public class RunNode implements Serializable {
*/
private String jobType;
/**
* 是否进行日志追加 1 不用追加 2 追加
*/
private String hasAddLogToFlow = "1";
/**
* 公共参数
*/
private Map<String,String> publicParam;
private static final long serialVersionUID = 2L;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment