瀏覽代碼

临时测试

姚云青 3 年之前
父節點
當前提交
3088991b9c

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

@@ -255,15 +255,15 @@ public class TaskWorkNode {
         }
         logger.info("===============================接口返回" + returnData);
         JSONObject retJson = JSONObject.parseObject(returnData);
-        if(jsonObject.getString("Code").trim() == "1") {
+//        if(jsonObject.getString("Code").trim() == "1") {
             //回调处理
 
             taskNode.setExeStatus("3").setEndTime(new Date()).setExeResult("1");
             taskNodeService.updateAllById(taskNode);
             log.setExeStatus("3").setEndTime(new Date()).setExeResult("1");
-        }else{
-            log.setExeResult("0").setFeedback(jsonObject.getString("Msg"));
-        }
+//        }else{
+//            log.setExeResult("0").setFeedback(jsonObject.getString("Msg"));
+//        }
         autoNodeLogMapper.insert(log);
     }
 
@@ -508,12 +508,12 @@ public class TaskWorkNode {
 
                     //满足条件--机器人空闲,设备或线边库有一个空闲
                     dataMap.put("Data", startStore);
-                    dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "moveMaterial");
+                    dataMap.put("method", "MoveRobotPosition");
                 }
                 dataMap.put("result", logical(robotList,targetStorge,zone));
             } else if (count == 1) {
                 jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
-                dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "fetchMaterial");
+                dataMap.put("method", "GetServoStacker");
                 Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getId(), false);
                 dataMap.put("fromStorge", currentStore);
                 dataMap.put("Data", currentStore);
@@ -524,7 +524,7 @@ public class TaskWorkNode {
                 dataMap.put("result", true);
             } else if (count == 2) {
                 Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getId(), false);
-                dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
+                dataMap.put("method", "SendServoStacker");
                 dataMap.put("fromStorge", currentStore);
                 //出入库类型
                 dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
@@ -535,9 +535,9 @@ public class TaskWorkNode {
                 dataMap.put("result", true);
             }if(count==3) {
                 dataMap.put("Data", targetStorge);
-                dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "moveMaterial");
+                dataMap.put("method", "MoveRobotPosition");
             }else if(count == 4){//从缓存位拿出来
-                dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE,"fetchMaterial");
+                dataMap.put("method", "GetServoStacker");
                 Storge hcwStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + taskNode.getId());
                 dataMap.put("Data", hcwStorge);
                 dataMap.put("fromStorge", hcwStorge);
@@ -546,7 +546,7 @@ public class TaskWorkNode {
                 //出入库类型
                 dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
             }else if(count == 5){
-                dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE,"putMaterial");
+                dataMap.put("method", "SendServoStacker");
                 //出入库类型
                 dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
                 dataMap.put("Data", targetStorge);
@@ -564,7 +564,7 @@ public class TaskWorkNode {
                 //目标地址和类型
                 jqrStorge = storgeService.getById(robotList.get(0).getStorgeId());
 
-                dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "fetchMaterial");
+                dataMap.put("method", "GetServoStacker");
                 if (logical(robotList,targetStorge,zone)!=null) {
                     Storge startStore = workpieceService.getWorkPieceStock(taskNode.getId(), false);
 
@@ -589,7 +589,7 @@ public class TaskWorkNode {
                 }
             }else if(count==1){
                 targetStorge = msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + taskNode.getId())==null?null:(Storge) msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + taskNode.getId());
-                dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE,"putMaterial");
+                dataMap.put("method", "SendServoStacker");
                 dataMap.put("toStorge", targetStorge);
                 dataMap.put("Data", targetStorge);
             }

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

@@ -401,12 +401,12 @@ public class RobotNodeServiceImpl implements NodeOperationService {
 
                         //满足条件--机器人空闲,设备或线边库有一个空闲
                         dataMap.put("Data", startStore);
-                        dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "moveMaterial");
+                        dataMap.put("method", "MoveRobotPosition");
                     }
                     dataMap.put("result", logical(robotList,targetStorge));
                 } else if (count == 1) {
                     jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
-                    dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "fetchMaterial");
+                    dataMap.put("method", "GetServoStacker");
                     Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getId(), false);
                     dataMap.put("fromStorge", currentStore);
                     dataMap.put("Data", currentStore);
@@ -417,7 +417,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     dataMap.put("result", true);
                 } else if (count == 2) {
                     Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getId(), false);
-                    dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
+                    dataMap.put("method", "SendServoStacker");
                     dataMap.put("fromStorge", currentStore);
                     //出入库类型
                     dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
@@ -435,8 +435,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 Storge targetStorge = returnMap.get("store")==null?null:(Storge)returnMap.get("store");
                 String targetxbk = returnMap.get("targetxbk")==null?null:(String)returnMap.get("targetxbk");
 
-                dataMap.put("zkIp", ZK_ip_zndy);
-                dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "fetchMaterial");
+                dataMap.put("method", "GetServoStacker");
                 if (logical(robotList,targetStorge)!=null) {
                     dataMap.put("fromStorge", startStore);
                     dataMap.put("Data", startStore);
@@ -464,19 +463,19 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_XBK_FLAG + nextTaskNode.getId(), targetxbk, 1, TimeUnit.DAYS);
                     dataMap.put("result", true);
                 }
+                dataMap.put("result", logical(robotList,targetStorge));
             }
         }else if ("放".equals(functionName)) {
             Object targetStorge = msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + taskNode.getId());
             //执行到第几步
             dataMap.put(taskNode.getId().toString()+"count",count);
-            dataMap.put("zkIp",ZK_ip_rxx);
             if(BizConstant.ROBOT_TYPE_CACHE.equals(zoneService.getRobotTypebyZone(zoneName))){
                 dataMap.put(YunjianConstant.YUNJIAN_XBK_CACHE_FLAG, "1");
                 if(count==0) {
                     dataMap.put("Data", targetStorge);
-                    dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "moveMaterial");
+                    dataMap.put("method", "MoveRobotPosition");
                 }else if(count == 1){//从缓存位拿出来
-                    dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE,"fetchMaterial");
+                    dataMap.put("method", "GetServoStacker");
                     Storge hcwStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + taskNode.getId());
                     dataMap.put("Data", hcwStorge);
                     dataMap.put("fromStorge", hcwStorge);
@@ -485,7 +484,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                     //出入库类型
                     dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
                 }else if(count == 2){
-                    dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE,"putMaterial");
+                    dataMap.put("method", "SendServoStacker");
                     //出入库类型
                     dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
                     dataMap.put("Data", targetStorge);
@@ -501,7 +500,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                 }
             }else if (BizConstant.ROBOT_TYPE_NOCACHE.equals(zoneService.getRobotTypebyZone(zoneName))) {
                 dataMap.put("zkIp",ZK_ip_zndy);
-                dataMap.put(DemoLineConstant.DEMOLINE_BIZ_TYPE,"putMaterial");
+                dataMap.put("method", "SendServoStacker");
                 dataMap.put("toStorge", targetStorge);
                 dataMap.put("Data", targetStorge);
                 dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
@@ -582,7 +581,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
      */
     public ProductionresourcePosition logical(List<ProductionresourcePosition> robotList,Storge targetStorge){
         //设备不存在
-        if(checkRobot()){
+        if(!checkRobot()){
 //            map.put("msg", DictionaryKey.NodeException.NO_RESOURCE);
             return null;
         }