Explorar o código

debug节点问题修改

yejian %!s(int64=3) %!d(string=hai) anos
pai
achega
11ca271d50

+ 39 - 39
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -382,46 +382,46 @@ public class TaskWorkNode {
      * @throws Exception
      */
      public Map checkCon(TaskNode taskNode, TTask task, Map<String, Object> dataMap) throws Exception {
-//        Map map = getCheckCon(taskNode, task, dataMap);
-//        boolean b = (boolean) map.get("result");
-//        if (!b) {
-//            Thread.sleep(10000);
-//            return checkCon(taskNode, task, dataMap);
-//        } else {
-//            return map;
-//        }
-        logger.info("异步消息获取执行状态:");
-        ExecutorService pool = Executors.newCachedThreadPool();
-        CompletableFuture<Map> future = CompletableFuture.supplyAsync(()->{
-            Map map = Maps.newHashMap();
-            try {
-                TimeUnit.SECONDS.sleep(2);
-                map = getCheckCon(taskNode, task, dataMap);
-            }
-            catch(InterruptedException e){
-                throw new RuntimeException(e);
-            }
+        Map map = getCheckCon(taskNode, task, dataMap);
+        boolean b = (boolean) map.get("result");
+        if (!b) {
+            Thread.sleep(10000);
+            return checkCon(taskNode, task, dataMap);
+        } else {
             return map;
-        }, pool);
-         future.whenCompleteAsync((v, ex) ->{
-             if(ex == null){
-                 Map map = future.join();
-                 boolean bool = (boolean) map.get("result");
-                 if(bool){
-                     logger.info("条件判断成功,关闭线程池");
-                     pool.shutdown();
-                 }else{
-                     try {
-                         checkCon(taskNode, task, dataMap);
-                     } catch (Exception e) {
-                         e.printStackTrace();
-                     }
-                 }
-             }else{
-                 throw new RuntimeException(ex);
-             }
-         });
-         return future.join();
+        }
+//        logger.info("异步消息获取执行状态:");
+//        ExecutorService pool = Executors.newCachedThreadPool();
+//        CompletableFuture<Map> future = CompletableFuture.supplyAsync(()->{
+//            Map map = Maps.newHashMap();
+//            try {
+//                TimeUnit.SECONDS.sleep(2);
+//                map = getCheckCon(taskNode, task, dataMap);
+//            }
+//            catch(InterruptedException e){
+//                throw new RuntimeException(e);
+//            }
+//            return map;
+//        }, pool);
+//         future.whenCompleteAsync((v, ex) ->{
+//             if(ex == null){
+//                 Map map = future.join();
+//                 boolean bool = (boolean) map.get("result");
+//                 if(bool){
+//                     logger.info("条件判断成功,关闭线程池");
+//                     pool.shutdown();
+//                 }else{
+//                     try {
+//                         checkCon(taskNode, task, dataMap);
+//                     } catch (Exception e) {
+//                         e.printStackTrace();
+//                     }
+//                 }
+//             }else{
+//                 throw new RuntimeException(ex);
+//             }
+//         });
+//         return future.join();
      }
 
     /**

+ 7 - 7
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java

@@ -471,7 +471,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     Map locationMap = new HashMap();
                     locationMap.put("location",startStore);
                     dataMap.put("Data", locationMap);
-
+                    // TODO 有问题,需要区分是否是第一步上料
                     //出入库类型
                     dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
                     //目的地为机器人手臂
@@ -590,14 +590,14 @@ public class RobotNodeServiceImpl implements NodeOperationService {
         String xbkFlag = "";
 
         //
-        if(taskNode.getCompleteBatchSort()==1){
+//        if(taskNode.getCompleteBatchSort()==1){
             if(CollectionUtil.isNotEmpty(flikustockInfos)){
-                targetStorge = storgeMapper.selectById(flikustockInfos.get(0));
+                targetStorge = storgeMapper.selectById(flikustockInfos.get(0).getStorgeId());
+                returnMap.put("store",targetStorge);
+                returnMap.put("targetxbk","0");
+                return returnMap;
             }
-            returnMap.put("store",targetStorge);
-            returnMap.put("targetxbk","0");
-            return returnMap;
-        }
+//        }
 
         //目标设备
         if(resourceId!=null){