|
|
@@ -6,8 +6,13 @@ import cn.hutool.core.io.watch.WatchMonitor;
|
|
|
import cn.hutool.core.io.watch.Watcher;
|
|
|
import cn.hutool.core.lang.Console;
|
|
|
import cn.hutool.core.io.FileUtil;
|
|
|
+import cn.hutool.core.io.watch.WatchMonitor;
|
|
|
+import cn.hutool.core.io.watch.Watcher;
|
|
|
+import cn.hutool.core.lang.Console;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.fdkankan.common.constant.ModelingBuildStatus;
|
|
|
@@ -50,6 +55,9 @@ import java.nio.charset.StandardCharsets;
|
|
|
import java.util.*;
|
|
|
import java.nio.file.Path;
|
|
|
import java.nio.file.WatchEvent;
|
|
|
+import java.nio.file.Path;
|
|
|
+import java.nio.file.WatchEvent;
|
|
|
+import java.util.*;
|
|
|
import java.util.concurrent.Future;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
import java.util.concurrent.TimeoutException;
|
|
|
@@ -255,13 +263,20 @@ public class RabbitMqListener {
|
|
|
buildSceneResult.setNum(num);
|
|
|
buildSceneResult.setPath(path);
|
|
|
|
|
|
+ Map<String, Object> ext = message.getExt();
|
|
|
+ String shPath = null;
|
|
|
+ if(CollUtil.isNotEmpty(ext)){
|
|
|
+ shPath = (String) ext.get("shPath");
|
|
|
+ }
|
|
|
+
|
|
|
//调用算法
|
|
|
- //todo 算法部调试用,完善后去掉
|
|
|
if(num.startsWith("SX-")){
|
|
|
- this.computer(num, path);
|
|
|
- }else{
|
|
|
- ComputerUtil.computer(num, path, buildType);
|
|
|
+ shPath = "/home/ubuntu/bin_sx/Launcher.sh";
|
|
|
+ }
|
|
|
+ if("V2".equalsIgnoreCase(buildType)){
|
|
|
+ shPath = "/home/ubuntu/bin_old/Launcher.sh";
|
|
|
}
|
|
|
+ this.computer(num, path, shPath);
|
|
|
|
|
|
// 检测计算结果文件是否有生成
|
|
|
String resultsPath = path + File.separator + "results" + File.separator;
|
|
|
@@ -302,11 +317,15 @@ public class RabbitMqListener {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
- public void computer(String projectNum, String path) throws Exception {
|
|
|
+ public void computer(String projectNum, String path, String cmdPath) throws Exception {
|
|
|
new HashMap();
|
|
|
path = path.replace("//", "/");
|
|
|
log.info("开始建模:" + projectNum);
|
|
|
- String command = "sudo bash /home/ubuntu/bin_sx/Launcher.sh " + path;
|
|
|
+ String command = "/home/ubuntu/bin/Launcher.sh " + path;
|
|
|
+ if(StrUtil.isNotEmpty(cmdPath)){
|
|
|
+ command = cmdPath + " " + path;
|
|
|
+ }
|
|
|
+ command = "sudo bash " + command;
|
|
|
CreateObjUtil.callshell(command);
|
|
|
log.info("计算完毕:" + command);
|
|
|
String uploadJsonPath = path + File.separator + "results" + File.separator + "upload.json";
|