dengsixing hai 2 semanas
pai
achega
3726981949

+ 17 - 6
src/main/java/com/fdkankan/modeling/receiver/RabbitMqListener.java

@@ -247,13 +247,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;
@@ -271,11 +278,15 @@ public class RabbitMqListener {
         return ModelingBuildStatus.SUCCESS;
     }
 
-    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";