Commit c5c64824 by guo_minglei@163.com

修改脚本运行时的获取方式

parent da51635b
...@@ -5,6 +5,7 @@ import com.byit.dto.executor.DispatchResponseDto; ...@@ -5,6 +5,7 @@ import com.byit.dto.executor.DispatchResponseDto;
import com.byit.dto.executor.JobRunResultDto; import com.byit.dto.executor.JobRunResultDto;
import com.byit.dto.executor.ScriptDto; import com.byit.dto.executor.ScriptDto;
import com.byit.dto.executor.ScriptParamAndPlaceholderDto; import com.byit.dto.executor.ScriptParamAndPlaceholderDto;
import com.byit.enums.PlaceholderEnum;
import com.byit.executor.api.ScriptExecutorService; import com.byit.executor.api.ScriptExecutorService;
import com.byit.process.MythJobProcess; import com.byit.process.MythJobProcess;
import com.byit.process.ProcessFailureException; import com.byit.process.ProcessFailureException;
...@@ -95,11 +96,12 @@ public class ScriptExecutorServiceImpl implements ScriptExecutorService { ...@@ -95,11 +96,12 @@ public class ScriptExecutorServiceImpl implements ScriptExecutorService {
if(null != param){ if(null != param){
scriptParamAndPlaceholderDto = JSON.parseObject(param, ScriptParamAndPlaceholderDto.class); scriptParamAndPlaceholderDto = JSON.parseObject(param, ScriptParamAndPlaceholderDto.class);
} }
if (null != command && command.contains(PlaceholderEnum.BIZ_SCRIPT_FILE.getName())){
String scriptPath = byteArrayToFile(remotePath,scriptParamAndPlaceholderDto); String scriptPath = byteArrayToFile(remotePath,scriptParamAndPlaceholderDto);
log.info("-------------脚本所在路径为:{}-------------",scriptPath); log.info("-------------脚本所在路径为:{}-------------",scriptPath);
//初始化命令信息 //初始化命令信息
command = PlaceholderUtils.initCommand(command,scriptPath); command = PlaceholderUtils.initCommand(command,scriptPath);
}
//开始执行脚本 //开始执行脚本
if(scriptParamAndPlaceholderDto != null){ if(scriptParamAndPlaceholderDto != null){
command = PlaceholderUtils.commandReplace(command,scriptParamAndPlaceholderDto.getParam()); command = PlaceholderUtils.commandReplace(command,scriptParamAndPlaceholderDto.getParam());
...@@ -147,7 +149,7 @@ public class ScriptExecutorServiceImpl implements ScriptExecutorService { ...@@ -147,7 +149,7 @@ public class ScriptExecutorServiceImpl implements ScriptExecutorService {
jobRunResultDto.setReturnResult(ReturnResult.FAIL); jobRunResultDto.setReturnResult(ReturnResult.FAIL);
e.printStackTrace(); e.printStackTrace();
} }
log.info("-----------执行命令,{},{}-----------",command,scriptPath); log.info("-----------执行命令,{}-----------",command);
//设置结束时间 //设置结束时间
jobRunResultDto.setEndTime(new Date()); jobRunResultDto.setEndTime(new Date());
jobRunResultDto.setLogId(scriptDto.getLogId()); jobRunResultDto.setLogId(scriptDto.getLogId());
......
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