Commit f1fed922 by huangfusuper

。。

parent 52922e57
...@@ -47,23 +47,24 @@ public class CommandAndScriptProcessingMachine implements ProcessingMachine { ...@@ -47,23 +47,24 @@ public class CommandAndScriptProcessingMachine implements ProcessingMachine {
String command = scriptDto.getCommand(); String command = scriptDto.getCommand();
log.debug("-----初始命令为{}------------",command); log.debug("-----初始命令为{}------------",command);
String param = scriptDto.getParam(); String param = scriptDto.getParam();
ScriptParamAndPlaceholderDto paramAndPlaceholderDto = null;
if (StringUtils.isNotBlank(param)) { if (StringUtils.isNotBlank(param)) {
ScriptParamAndPlaceholderDto paramAndPlaceholderDto = JSON.parseObject(param, ScriptParamAndPlaceholderDto.class); paramAndPlaceholderDto = JSON.parseObject(param, ScriptParamAndPlaceholderDto.class);
}
//判断是否需要拉取文件服务器的文件,包含biz_file的条件下会对这个字段进行替换 //判断是否需要拉取文件服务器的文件,包含biz_file的条件下会对这个字段进行替换
if (command.contains(PlaceholderEnum.BIZ_SCRIPT_FILE.getName())) { if (command.contains(PlaceholderEnum.BIZ_SCRIPT_FILE.getName())) {
String scriptPath = byteArrayToFile(scriptDto.getRemotePath(),paramAndPlaceholderDto); String scriptPath = byteArrayToFile(scriptDto.getRemotePath(),paramAndPlaceholderDto);
log.debug("-----远程地址的文件被拉取到:[{}]------------",scriptPath); log.debug("-----远程地址的文件被拉取到:[{}]------------",scriptPath);
//初始化命令信息 //初始化命令信息
command = PlaceholderUtils.initCommand(command,scriptPath); command = PlaceholderUtils.initCommand(command,scriptPath);
log.debug("-----执行命令初始化完成,命令为:[{}]------------",command); log.debug("-----执行命令初始化完成,命令为:[{}]------------",command);
scriptDto.setCommand(command);
}
//执行命令参数的替换
command = PlaceholderUtils.commandReplace(command,paramAndPlaceholderDto.getParam());
log.debug("-----命令参数替换完成,命令为:[{}]------------",command);
scriptDto.setCommand(command); scriptDto.setCommand(command);
} }
//执行命令参数的替换
command = PlaceholderUtils.commandReplace(command,paramAndPlaceholderDto.getParam());
log.debug("-----命令参数替换完成,命令为:[{}]------------",command);
scriptDto.setCommand(command);
//将脚本的携带的参数 拼接在命令后方 python test.py -sex 男 -name 张三 -age 14 //将脚本的携带的参数 拼接在命令后方 python test.py -sex 男 -name 张三 -age 14
log.info("---------命令及脚本参数处理完成,此节点处理数据为:[{}]-----------",scriptDto); log.info("---------命令及脚本参数处理完成,此节点处理数据为:[{}]-----------",scriptDto);
processingNodeChain.doProcessing(scriptDto,processingNodeChain); processingNodeChain.doProcessing(scriptDto,processingNodeChain);
......
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