Pārlūkot izejas kodu

节点模块功能操作、功能配置代码

oyq28 4 gadi atpakaļ
vecāks
revīzija
5c4ac45bad
21 mainītis faili ar 624 papildinājumiem un 388 dzēšanām
  1. 2 0
      imcs-admin-boot/imcs-authority-biz/src/main/java/com/github/zuihou/authority/service/auth/impl/ResourceServiceImpl.java
  2. 5 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/DemoLine/NodeConstant.java
  3. 2 2
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWork.java
  4. 169 345
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java
  5. 3 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/dao/TTaskMapper.java
  6. 2 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/dao/TaskNodeMapper.java
  7. 1 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/TaskNodeService.java
  8. 23 15
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java
  9. 8 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/dao/ResourceAutoCodeMapper.java
  10. 19 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/ResourceAutoCodeService.java
  11. 8 4
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/MachineNodeServiceImpl.java
  12. 179 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/OtherNodeServiceImpl.java
  13. 17 0
      imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/ResourceAutoCodeServiceImpl.java
  14. 48 0
      imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/ResourceAutoCodeMapper.xml
  15. 4 3
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/entity/TaskNode.java
  16. 3 2
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/ResourceAutoCodePageDTO.java
  17. 2 1
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/ResourceAutoCodeSaveDTO.java
  18. 2 1
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/ResourceAutoCodeUpdateDTO.java
  19. 2 2
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/ProductionresourcePosition.java
  20. 30 10
      imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/ResourceAutoCode.java
  21. 95 3
      imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/DictionaryKey.java

+ 2 - 0
imcs-admin-boot/imcs-authority-biz/src/main/java/com/github/zuihou/authority/service/auth/impl/ResourceServiceImpl.java

@@ -8,6 +8,7 @@ import com.github.zuihou.authority.service.auth.ResourceService;
 import com.github.zuihou.authority.service.auth.RoleAuthorityService;
 import com.github.zuihou.base.service.SuperCacheServiceImpl;
 import com.github.zuihou.common.constant.CacheKey;
+import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.exception.BizException;
 import com.github.zuihou.utils.CodeGenerate;
@@ -63,6 +64,7 @@ public class ResourceServiceImpl extends SuperCacheServiceImpl<ResourceMapper, R
     public List<Resource> findVisibleResource(ResourceQueryDTO resource) {
         //1, 先查 cache,cache中没有就执行回调查询DB,并设置到缓存
         String userResourceKey = key(resource.getUserId());
+        BaseContextHandler.setTenant("0000");
 
         List<Resource> visibleResource = new ArrayList<>();
         CacheObject cacheObject = cacheChannel.get(CacheKey.USER_RESOURCE, userResourceKey, (key) -> {

+ 5 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/DemoLine/NodeConstant.java

@@ -0,0 +1,5 @@
+package com.github.zuihou.business.DemoLine;
+
+public class NodeConstant {
+
+}

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

@@ -12,7 +12,7 @@
 //import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 //import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
 //import com.github.zuihou.business.operationManagementCenter.service.TaskService;
-//import com.github.zuihou.business.productionReadyCenter.dao.AutoNodeLogMapper;
+//import com.github.zuihou.business.productionReadyCenter.dao.AAutoNodeLogMapper;
 //import com.github.zuihou.business.productionReadyCenter.entity.AAutoNodeLog;
 //import com.github.zuihou.business.productionReadyCenter.service.AutoNodeService;
 //import com.github.zuihou.business.util.DynamicRabbitMq;
@@ -49,7 +49,7 @@
 //    @Autowired
 //    private TTaskMapper taskMapper;
 //    @Autowired
-//    private AutoNodeLogMapper autoNodeLogMapper;
+//    private AAutoNodeLogMapper autoNodeLogMapper;
 ////    @Autowired
 ////    private BomProcedureProgramGroupMapper bomProcedureProgramGroupMapper;
 //    @Autowired

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

@@ -2,6 +2,7 @@ package com.github.zuihou.business.mq;
 
 import cn.hutool.core.collection.CollectionUtil;
 import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.github.zuihou.business.DemoLine.DemoCacheKey;
 import com.github.zuihou.business.DemoLine.DemoLineConstant;
 import com.github.zuihou.business.edgeLibrary.entity.Storge;
@@ -15,11 +16,20 @@ import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import com.github.zuihou.business.operationManagementCenter.service.TaskNodeService;
 import com.github.zuihou.business.productionReadyCenter.dao.AAutoNodeLogMapper;
 import com.github.zuihou.business.productionReadyCenter.entity.AAutoNodeLog;
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureProductionresource;
+import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureTray;
+import com.github.zuihou.business.productionReadyCenter.service.BomProcedureProductionresourceService;
+import com.github.zuihou.business.productionReadyCenter.service.BomProcedureVersionService;
 import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
+import com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode;
+import com.github.zuihou.business.productionResourceCenter.entity.ResourceBusiness;
 import com.github.zuihou.business.productionResourceCenter.service.NodeOperationService;
 import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
+import com.github.zuihou.business.productionResourceCenter.service.ResourceAutoCodeService;
+import com.github.zuihou.business.productionResourceCenter.service.ResourceBusinessService;
 import com.github.zuihou.business.productionResourceCenter.service.impl.AGVNodeServiceImpl;
 import com.github.zuihou.business.productionResourceCenter.service.impl.MachineNodeServiceImpl;
+import com.github.zuihou.business.productionResourceCenter.service.impl.OtherNodeServiceImpl;
 import com.github.zuihou.business.productionResourceCenter.service.impl.RobotNodeServiceImpl;
 import com.github.zuihou.business.util.MsgUtil;
 import com.github.zuihou.common.constant.BizConstant;
@@ -29,9 +39,12 @@ import com.github.zuihou.common.constant.UrlConfConstant;
 import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import com.github.zuihou.tenant.entity.Module;
+import com.github.zuihou.tenant.entity.ModuleInstruction;
 import com.github.zuihou.tenant.entity.Productionresource;
+import com.github.zuihou.tenant.service.ModuleInstructionService;
 import com.github.zuihou.tenant.service.ModuleService;
 import com.github.zuihou.tenant.service.ProductionresourceService;
 import com.google.common.collect.Maps;
@@ -86,8 +99,23 @@ public class TaskWorkNode {
     @Autowired
     private ModuleService moduleService;
 
+    @Autowired
+    private ModuleInstructionService  moduleInstructionService;
+
     private NodeOperationService nodeOperationService;
 
+    @Autowired
+    private ResourceBusinessService  resourceBusinessService;
+
+    @Autowired
+    private ResourceAutoCodeService  resourceAutoCodeService;
+
+    @Autowired
+    private BomProcedureVersionService bomProcedureVersionService;
+
+    @Autowired
+    private BomProcedureProductionresourceService bomProcedureProductionresourceService;
+
 //    private String url = "http://127.0.0.1:8764/task/testTask";
 //
 //    private String plcURL = "http://192.168.170.202:8089";
@@ -101,115 +129,125 @@ public class TaskWorkNode {
 //    private String ZK_ip_zndy = "192.168.170.81";
 
     //总控端口
-    private String ZK_port = "120";
-
+    private final String ZK_port = "120";
 
     private static Logger logger = LoggerFactory.getLogger(TaskWorkNode.class);
 
-    public void updateTaskStatusJob(String data) {
-        JSONObject j = JSONObject.parseObject(data);
-        String taskNodeId = j.getString("taskNodeId");
+    private boolean isFinal = false;
+
+    private final String fileName = "";
+
+    public void updateTaskStatusJob(String data) throws InterruptedException {
+        JSONObject jsonObject = JSONObject.parseObject(data);
+        String taskNodeId = jsonObject.getString("taskNodeId");
         //业务类型-1、是普通的节点类型,2-是线边库轮询
-        String bizType = j.getString("bizType");
+        String bizType = jsonObject.getString("bizType");
 
         //多产品搬运类型
-        String carryType = j.getString("carryType");
-
+        String carryType = jsonObject.getString("carryType");
+        if(StringUtil.isEmpty(taskNodeId) || StringUtil.isEmpty(bizType)){
+            throw new InterruptedException("数据传输有误");
+        }
         logger.info("=======================" + taskNodeId);
         BaseContextHandler.setTenant("0000");
-        Map map = new HashMap();
-        map.put("id", taskNodeId);
-        List<TaskNode> taskNodeList = taskNodeService.getTaskNodeList(map);
-        if (taskNodeList == null || taskNodeList.size() == 0) {
-            return;
+
+        TaskNode taskNode = taskNodeService.getById(taskNodeId);
+        if (taskNode == null || taskNode.getTaskId()== null) {
+            throw new InterruptedException("当前任务节点为空");
+        }
+        TTask tTask = taskMapper.selectById(taskNode.getTaskId());
+        if (tTask == null || tTask.getStatus() == "3") {
+            throw new InterruptedException("当前任务为空");
+        }
+//        //获取配置序数据
+//        BomProcedureProductionresource bomProcedureProductionresource = bomProcedureProductionresourceService.getOne(new QueryWrapper<BomProcedureProductionresource>().eq("resourceId",tTask.getResourceId()).eq("procedureId", tTask.getProcedureId()));
+//        if(bomProcedureProductionresource == null || bomProcedureProductionresource.getResourceBusinessId() == null){
+//            throw new InterruptedException("自动化节点配置为空");
+//        }
+//        ResourceBusiness resourceBusiness = resourceBusinessService.getById(bomProcedureProductionresource.getResourceBusinessId());
+//        if(resourceBusiness == null || resourceBusiness.getIsFinal() == null){
+//            throw new InterruptedException("自动化节点配置有误");
+//        }
+//
+//        List<ResourceAutoCode> resourceAutoCodeList = resourceAutoCodeService.getTree(new LbqWrapper<ResourceAutoCode>().eq(ResourceAutoCode::getParentId, bomProcedureProductionresource.getResourceBusinessId()).eq(ResourceAutoCode::getStatus, "1").ne(ResourceAutoCode::getParentId, "0").orderByAsc(ResourceAutoCode::getWeight,ResourceAutoCode::getCreateTime));
+//        if(resourceAutoCodeList == null || resourceAutoCodeList.size() == 0){
+//            throw new InterruptedException("动作节点配置为空");
+//        }
+        //任务初始化判断
+        if ("1".equals(tTask.getStatus())) {
+            //下发的数据才更新状态
+            tTask.setStatus("2").setStartTime(new Date());
+            taskMapper.updateById(tTask);
+            planMapper.updateproduceStatusBegin();
+            orderMapper.updateproduceStatusBegin();
+
+            msgUtil.redis_set(CacheKey.PRESOURCE_CURRENT_TASK + "_" + tTask.getResourceId(), tTask.getId());
+            msgUtil.redis_set(CacheKey.PRESOURCE_CURRENT_TASK_OBJECT + "_" + tTask.getResourceId(), tTask);
+        }
+        //获取配置节点
+        String autoProgrameUrl = getInterfaceUrl(taskNode);
+        ResourceAutoCode resourceAutoCode = taskNode.getAutoNode();
+        isFinal = resourceAutoCode.isFinal()? true : false;
+        msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE + "_" + taskNode.getResourceId(), resourceAutoCode);
+
+        List<AAutoNodeLog> autoNodeLogList = autoNodeLogMapper.selectList(Wraps.<AAutoNodeLog>lbQ().eq(AAutoNodeLog::getTaskNodeId, taskNode.getId()));
+        //插入执行日志
+        AAutoNodeLog log = new AAutoNodeLog();
+        if (autoNodeLogList == null || autoNodeLogList.size() == 0) {
+            log.setTaskNodeId(taskNode.getId()).setAutoNodeId(taskNode.getTaskId()).setOrderId(tTask.getOrderId())
+                    .setTaskId(tTask.getId()).setExeStatus("2").setStartTime(new Date()).setFeedbackFile(fileName);
+        } else {
+            log = autoNodeLogList.get(0);
+            log.setFeedbackFile(fileName);
         }
-        TaskNode taskNode = taskNodeList.get(0);
-
-        Map qMap = new HashMap();
-        //qMap.put("mulstatus",StringUtil.changeIdsArrToSubQueryStr("1,2"));
-        qMap.put("id", taskNode.getTaskId());
-        List<TTask> taskList = taskMapper.getPrepareTask(qMap);
-
-        if (taskList != null && taskList.size() > 0) {
-            for (TTask task : taskList) {
-                try {
-                    //把本次待执行任务全部改成进行中
-                    if ("1".equals(task.getStatus())) {
-                        //下发的数据才更新状态
-                        task.setStatus("2");
-                        task.setStartTime(new Date());
-                        taskMapper.updateById(task);
-                        planMapper.updateproduceStatusBegin();
-                        orderMapper.updateproduceStatusBegin();
-
-                        msgUtil.redis_set(CacheKey.PRESOURCE_CURRENT_TASK + "_" + task.getResourceId(), task.getId());
-                        msgUtil.redis_set(CacheKey.PRESOURCE_CURRENT_TASK_OBJECT + "_" + task.getResourceId(), task);
-                    }
-                    //获取每个节点对应的执行地址
-                    String autoProgrameUrl = getInterfaceUrl(taskNode);
-
-                    //把当前节点存放缓存
-                    msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE + "_" + task.getResourceId(), taskNode.getAutoNode().getId());
-
-                    String fileName = "";
-//                    if (bomProcedureProgramGroupList != null && bomProcedureProgramGroupList.size() > 0) {
-//                        fileName = bomProcedureProgramGroupList.get(0).getSubmittedFileName();
-//                        //autoProgrameUrl+="&fileName="+fileName;
-//                    }
-                    List<AAutoNodeLog> autoNodeLogList = autoNodeLogMapper.selectList(Wraps.<AAutoNodeLog>lbQ().eq(AAutoNodeLog::getTaskNodeId, taskNode.getId()));
-                    //插入执行日志
-                    AAutoNodeLog log = new AAutoNodeLog();
-                    if (autoNodeLogList == null || autoNodeLogList.size() == 0) {
-                        log.setTaskNodeId(taskNode.getId()).setAutoNodeId(taskNode.getAutoNode().getTaskId()).setOrderId(task.getOrderId())
-                                .setTaskId(task.getId()).setExeStatus("2").setStartTime(new Date()).setFeedbackFile(fileName);
-                        autoNodeLogMapper.insert(log);
-                    } else {
-                        log = autoNodeLogList.get(0);
-                        log.setFeedbackFile(fileName);
-                    }
 
-                    //更新节点任务
-                    taskNode.setExeStatus("2").setStartTime(new Date());
-                    taskNodeMapper.updateAllById(taskNode);
-
-                    logger.info("===============================请求地址" + autoProgrameUrl);
-                    String returnData = "";
-                    try {
-                        if (!"0".equals(taskNode.getNodeType())) {//人工上下料或质检
-                            //不用调接口,直接返回成功
-                            msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE_STATUS + "_" + taskNode.getId(), "0");
-                        } else {
-                            Map queryMap = Maps.newHashMap();
-                            queryMap.put("bizType", bizType);
-                            queryMap.put("carryType", carryType);
-                            if (j.containsKey(taskNode.getId() + "count")) {
-                                queryMap.put(taskNode.getId() + "count", j.getString(taskNode.getId() + "count"));
-                            }
-
-                            //运行条件验证
-                            Map conMap = checkCon(taskNode, task, queryMap);
-                            //组装接口参数
-                            HttpHeaders headers = new HttpHeaders();
-                            headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
-                            String jsonParam = getRequestParam(conMap);
-                            HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
-                            //调用接口
-                            returnData = restTemplate.postForObject(autoProgrameUrl, formEntity, String.class);
-                        }
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                        JSONObject errJsonObject = new JSONObject();
-                        errJsonObject.put("msg", e.getMessage());
-                        returnData = errJsonObject.toJSONString();
-                        logger.error("调用接口发生异常" + e.getMessage());
-                    }
-                    logger.info("===============================接口返回" + returnData);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    logger.info("===============================接口返回", e);
+        //更新节点任务
+        taskNode.setExeStatus("2").setStartTime(new Date());
+        taskNodeMapper.updateAllById(taskNode);
+
+        logger.info("===============================请求地址" + autoProgrameUrl);
+        String returnData = "";
+
+        try {
+            if (!"0".equals(taskNode.getNodeType())) {
+                //人工上下料或质检
+                //不用调接口,直接返回成功
+                msgUtil.redis_set(CacheKey.TASK_CURRENT_NODE_STATUS + "_" + taskNode.getId(), "0");
+            }
+            else {
+                Map queryMap = Maps.newHashMap();
+                queryMap.put("bizType", bizType);
+                queryMap.put("carryType", carryType);
+                if (jsonObject.containsKey(taskNode.getId() + "count")) {
+                    queryMap.put(taskNode.getId() + "count", jsonObject.getString(taskNode.getId() + "count"));
                 }
+
+                //运行条件验证
+                Map conMap = checkCon(taskNode, tTask, queryMap);
+                //组装接口参数
+                HttpHeaders headers = new HttpHeaders();
+                headers.setContentType(MediaType.parseMediaType("application/json;charset=UTF-8"));
+                String jsonParam = getRequestParam(conMap);
+                HttpEntity<String> formEntity = new HttpEntity<String>(jsonParam, headers);
+                //调用接口
+                returnData = restTemplate.postForObject(autoProgrameUrl, formEntity, String.class);
             }
+        } catch (Exception e) {
+            e.printStackTrace();
+            JSONObject errJsonObject = new JSONObject();
+            errJsonObject.put("msg", e.getMessage());
+            returnData = errJsonObject.toJSONString();
+            logger.error("调用接口发生异常" + e.getMessage());
+            log.setExeResult("0").setFeedback(e.getMessage());
         }
+        logger.info("===============================接口返回" + returnData);
+        JSONObject retJson = JSONObject.parseObject(returnData);
+        if(jsonObject.getString("Code").trim() == "1") {
+            log.setExeStatus("3").setEndTime(new Date()).setExeResult("1");
+        }else{
+            log.setExeResult("0").setFeedback(jsonObject.getString("Msg"));
+        }
+        autoNodeLogMapper.insert(log);
     }
 
 
@@ -229,7 +267,6 @@ public class TaskWorkNode {
         } else if (DictionaryKey.INTERFACETYPE_AGV.equals(taskNode.getInterfaceType())) {
 //            autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
             autoProgrameUrl = UrlConfConstant.agvURL;
-            //           autoProgrameUrl = url;
         } else if (DictionaryKey.INTERFACETYPE_WMS.equals(taskNode.getInterfaceType())) {
 //            autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
             // autoProgrameUrl = agvURL;
@@ -241,10 +278,10 @@ public class TaskWorkNode {
     }
 
 
-    private String[] getResourceCategory(String resourceId) {
+    private Module getModuleInfo(String resourceId) {
         Productionresource productionresource = productionresourceService.getOne(new QueryWrap<Productionresource>().eq("id", resourceId));
         Module module = moduleService.getById(new QueryWrap<Module>().eq("id", productionresource.getModuleId()));
-        return new String[]{productionresource.getResourcesCategory(), module.getName()};
+        return module;
     }
 
     /**
@@ -260,7 +297,7 @@ public class TaskWorkNode {
         String bizType = conMap.get("bizType").toString();
         //出入库类型
         String stockType = conMap.get(DemoLineConstant.DEMOLINE_STOCK_TYPE) == null ? "" : conMap.get(DemoLineConstant.DEMOLINE_STOCK_TYPE).toString();
-
+        ResourceAutoCode resourceAutoCode = taskNode.getAutoNode();
 
         JSONObject jsonObject = new JSONObject();
         //jsonObject.put("businessType", taskNode.getAutoNodeCode());
@@ -364,7 +401,6 @@ public class TaskWorkNode {
             //WMS分出库和入库
             //通过自动化程序的CODE区分是上料还是下料
             conMap.put("NO_WMS", false);
-            nodeOperationService = new MachineNodeServiceImpl();
             Map map = nodeOperationService.operation(jsonObject, bizJsonObject, conMap);
             jsonObject = (JSONObject) map.get("jsonObject");
             bizJsonObject = (JSONObject) map.get("bizJsonObject");
@@ -420,7 +456,6 @@ public class TaskWorkNode {
              }else{
                  throw new RuntimeException(ex);
              }
-
          });
          return future.join();
      }
@@ -440,21 +475,38 @@ public class TaskWorkNode {
         String carryType = dataMap.get("carryType") == null ? "" : dataMap.get("carryType").toString();
 
         //判断节点设备类型
-        String[] category = getResourceCategory(taskNode.getResourceId().toString());
-        if ("1" == category[0]) {
-            nodeOperationService = new MachineNodeServiceImpl();
-        } else if ("2" == category[0]) {
-            nodeOperationService = new AGVNodeServiceImpl();
-        } else if ("3" == category[0]) {
-            nodeOperationService = new RobotNodeServiceImpl();
-        }
+        ResourceAutoCode resourceAutoCode = taskNode.getAutoNode();
+        String category = resourceAutoCode.getCategory();
+        String robotType = resourceAutoCode.getResourceId().toString();
+
+        //获取节点指令集
+        Module module  = getModuleInfo(task.getResourceId().toString());
+        List<ModuleInstruction> moduleInstructions = moduleInstructionService.list(new QueryWrap<ModuleInstruction>().eq("module_id", module.getId()));
+
+
+        //判断夹具资源
+        List<BomProcedureTray> bomProcedureTrayList = bomProcedureVersionService.getPreProcedureTray(new HashMap());
 
         Map<String, Object> map = Maps.newHashMap();
         map.put("taskNode", taskNode);
         map.put("task", task);
         map.put("bizType", bizType);
-        map.put("categoryName", category[1]);
+        map.put("categoryName", DictionaryKey.RESOURCE_CATEGORY.get(category));
+        map.put("instructions", moduleInstructions);
+        map.put("moduleName", module.getName());
 
+        if ("1" == category) {
+            nodeOperationService = new MachineNodeServiceImpl();
+        } else if ("2" == category) {
+            nodeOperationService = new AGVNodeServiceImpl();
+        } else if ("3" == category) {
+            //默认示范线设备
+            map.put("robotType", DictionaryKey.LINE_ROBOT_NODES.get(robotType));
+            //map.put("robotType", DictionaryKey.YJ_ROBOT_NODES.get(robotType));
+            nodeOperationService = new RobotNodeServiceImpl();
+        } else if("4" == category){
+            nodeOperationService  = new OtherNodeServiceImpl();
+        }
 
         //线边库轮询两个机械手和接驳位资源。如果两个都有空则从线边库搬运到接驳位
         if (BizConstant.MQ_TASK_NODE_TYPE_STORAGE_WAIT_ZLZX.equals(bizType)) {
@@ -616,241 +668,13 @@ public class TaskWorkNode {
 
         }
         else {//正常节点类型
-            switch(task.getProcedureNo()){
-                case "OP10":
-                    //上料任务
-                    if (DemoLineConstant.DEMOLINE_OP01_01.equals(taskNode.getNodeNo())) {
-                        //WMS出货
-                        //(质量中心)线边库空位是否大于1,n>1并且接驳位b和c至少有一个空位
-                        //质量中心线边库
-                        map.put("functionName", "WMS_OUT");
-                        nodeOperationService.initResource(taskNode,task,map);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP01_02.equals(taskNode.getNodeNo())) {
-                        //agv从wms接驳口A取料运到质量中心的接驳位B或C
-                        //节点2的任务都在节点1被锁定过了,只要从缓存拿出来对应的值即可
-                        map = nodeOperationService.checkCondition(taskNode, task, map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP01_03.equals(taskNode.getNodeNo())) {
-                        //机器人放子盘夹具到上下料站(从子盘到机械手)。可能进行换手操作
-                        //执行步骤
-                        map.put("robotType", DemoLineConstant.JQR1);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP01_04.equals(taskNode.getNodeNo())) {
-                        //机器人放子盘夹具到上下料站(从机械手到上下料站)
-                        //节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
-                        //map.put("functionName", "QSTATION_IN");
-                        //nodeOperationService.initResource(taskNode,task,map);
-                        map.put("robotType", DemoLineConstant.JQR1);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP01_06.equals(taskNode.getNodeNo())) {
-                        //机器人取料(机器人从人工上料站取料放到机械手)
-                        map.put("robotType", DemoLineConstant.JQR1);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP01_07.equals(taskNode.getNodeNo())) {
-                        //机器人取料(机器人从人工上料站取料放到机械手)
-                        map.put("robotType", DemoLineConstant.JQR1);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP01_08.equals(taskNode.getNodeNo())) {
-                        //agv运输到产线接驳位
-                        //根据工件获取所在的生产单元(产线)
-                        //nodeOperationService.initResource(taskNode, task, queryMap);
-                        map = nodeOperationService.checkCondition(taskNode, task, map);
-                    }
-
-                     break;
-                case "OP20":
-                    //生产加工
-                    if (DemoLineConstant.DEMOLINE_OP02_01.equals(taskNode.getNodeNo())) {
-                        //从接驳位D、E到机械手臂
-                        //根据工件获取所在的生产单元(产线)
-                        String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
-                                : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
-
-                        //当前毛坯所在的库位
-                        if (DemoLineConstant.DEMOLINE_WORK_SPACE1.equals(zoneNo)) {
-                            map.put("robotType", DemoLineConstant.JQR2);
-                            map = nodeOperationService.checkCondition(taskNode,task,map);
-                        }
-                        else if (DemoLineConstant.DEMOLINE_WORK_SPACE2.equals(zoneNo)) {
-                            map.put("robotType", DemoLineConstant.JQR3);
-                            map = nodeOperationService.checkCondition(taskNode,task,map);
-                        }
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP02_02.equals(taskNode.getNodeNo())) {
-                        //直接搬运到设备或线边库上
-                        //根据工件获取所在的生产单元(产线)
-                        String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
-                                : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
-
-                        //记录产品流转到的库位
-                        Storge jqrFromStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
-                        map.put("fromStorge", jqrFromStorge);
-                        if (DemoLineConstant.DEMOLINE_WORK_SPACE1.equals(zoneNo)) {
-                            //map.put("functionName", "SMU50_IN");
-                            //nodeOperationService.initResource(taskNode,task,map);
-                            map.put("robotType", DemoLineConstant.JQR2);
-                            map = nodeOperationService.checkCondition(taskNode,task,map);
-                        }
-                        else if (DemoLineConstant.DEMOLINE_WORK_SPACE2.equals(zoneNo)) {
-                            map.put("robotType", DemoLineConstant.JQR3);
-                            map = nodeOperationService.checkCondition(taskNode,task,map);
-                        }
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP02_03.equals(taskNode.getNodeNo())) {
-                        //分发文件
-                        map.put("functionName", "SMU50_FILE");
-                        nodeOperationService.initResource(taskNode,task,map);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP02_04.equals(taskNode.getNodeNo())) {
-                        //执行程序,分多次执行
-                        map.put("functionName", "SMU50_EXEC");
-                        nodeOperationService.initResource(taskNode,task,map);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
+            BomProcedureProductionresource bomProcedureProductionresource = bomProcedureProductionresourceService.getOne(new QueryWrapper<BomProcedureProductionresource>().eq("resourceId",task.getResourceId()).eq("procedureId", task.getProcedureId()));
+            //List<ResourceAutoCode>  resourceAutoCodeList = resourceAutoCodeService.getNodeList(resourceAutoCode);
+            //业务序列节点
+            //ResourceAutoCode parentAutoCode = resourceAutoCodeService.getById(resourceAutoCode.getParentId());
+            logger.info("=============进入自动化节点条件检测==============" + resourceAutoCode.getName() );
+            map = nodeOperationService.checkCondition(taskNode, task, map);
 
-                     break;
-                case "OP30":
-                    //清洗
-                    if (DemoLineConstant.DEMOLINE_OP03_01.equals(taskNode.getNodeNo())) {
-                        map.put("robotType", DemoLineConstant.JQR3);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP03_02.equals(taskNode.getNodeNo())) {
-                        //直接搬运到设备或线边库上
-                        //当前步骤。骤有的节点会生产多步执行
-                        map.put("robotType", DemoLineConstant.JQR3);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP03_03.equals(taskNode.getNodeNo())) {
-                        //柔性线清洗机,PLC接口
-                        map.put("functionName", "RX_CLEAN");
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-
-                    break;
-                case "OP40":
-                    //打标
-                    if (DemoLineConstant.DEMOLINE_OP04_01.equals(taskNode.getNodeNo())) {
-                        //打标
-                        //当前步骤。骤有的节点会生产多步执行
-                        map.put("robotType", DemoLineConstant.JQR3);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP04_02.equals(taskNode.getNodeNo())) {
-                        //直接搬运到设备或线边库上
-                        //当前步骤。骤有的节点会生产多步执行
-                        map.put("robotType", DemoLineConstant.JQR3);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP04_03.equals(taskNode.getNodeNo())) {
-                        //打标
-                        map.put("functionName", "DBJ_PRINT");
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP04_09.equals(taskNode.getNodeNo())) {
-                        //设备到接驳位,1、设备到机械人手臂
-                        //根据工件获取所在的生产单元(产线)
-                        String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
-                                : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
-
-                        if (DemoLineConstant.DEMOLINE_WORK_SPACE1.equals(zoneNo)) {
-                            map.put("robotType", DemoLineConstant.JQR2);
-                            map = nodeOperationService.checkCondition(taskNode,task,map);
-
-                        }
-                        else if (DemoLineConstant.DEMOLINE_WORK_SPACE2.equals(zoneNo)) {
-                            //当前步骤。骤有的节点会生产多步执行
-                            map.put("robotType", DemoLineConstant.JQR3);
-                            map = nodeOperationService.checkCondition(taskNode,task,map);
-                        }
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP04_10.equals(taskNode.getNodeNo())) {
-                        //设备到接驳位,2、机械手臂到接驳位
-                        //根据工件获取所在的生产单元(产线)
-                        String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
-                                : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
-
-                        //根据产线编号,匹配出产线类型。
-
-                        if (DemoLineConstant.DEMOLINE_WORK_SPACE1.equals(zoneNo)) {
-                            map.put("robotType", DemoLineConstant.JQR2);
-                            map = nodeOperationService.checkCondition(taskNode,task,map);
-                        }
-                        else if (DemoLineConstant.DEMOLINE_WORK_SPACE2.equals(zoneNo)) {
-                            map.put("robotType", DemoLineConstant.JQR3);
-                            map = nodeOperationService.checkCondition(taskNode,task,map);
-                        }
-                    }
-                    break;
-                case "OP50":
-                    //质检
-                    if (DemoLineConstant.DEMOLINE_OP05_01.equals(taskNode.getNodeNo())) {
-                        //AGV运回
-                        map = nodeOperationService.checkCondition(taskNode, task, dataMap);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP05_02.equals(taskNode.getNodeNo())) {
-                        //取放到三坐标
-                        map.put("robotType", DemoLineConstant.JQR1);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP05_03.equals(taskNode.getNodeNo())) {
-                        map.put("robotType", DemoLineConstant.JQR2);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP05_04.equals(taskNode.getNodeNo())) {
-                        //执行三坐标测量
-                        //节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
-                        //1、取出机器人
-                        map.put("functionName", "SZB_PRINT");
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP05_05.equals(taskNode.getNodeNo())) {
-                        //机械手从三坐标取出
-                        map.put("robotType", DemoLineConstant.JQR1);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP05_06.equals(taskNode.getNodeNo())) {
-                        //机器人放子盘夹具到上下料站(从机械手到上下料站)
-                        //节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
-                        //1、取出机器人
-                        map.put("robotType", DemoLineConstant.JQR1);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    break;
-                case "OP60":
-                    //下料
-                    if (DemoLineConstant.DEMOLINE_OP06_02.equals(taskNode.getNodeNo())) {
-                        //子盘,夹具,归还线边库
-                        map.put("robotType", DemoLineConstant.JQR1);
-                        map = nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP06_03.equals(taskNode.getNodeNo())) {
-                        //机器人放子盘夹具到上下料站(从机械手到上下料站)
-                        //节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
-                        //1、取出机器人
-                        map.put("robotType", DemoLineConstant.JQR1);
-                        map = nodeOperationService.checkCondition(taskNode, task, dataMap);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP06_04.equals(taskNode.getNodeNo())) {
-                        //AGV
-                       map = nodeOperationService.checkCondition(taskNode, task, dataMap);
-                    }
-                    else if (DemoLineConstant.DEMOLINE_OP06_05.equals(taskNode.getNodeNo())) {
-                        map.put("functionName", "WMS_IN");
-                        nodeOperationService.initResource(taskNode,task,map);
-                        nodeOperationService.checkCondition(taskNode,task,map);
-                    }
-                    break;
-            }
         }
         return map;
     }

+ 3 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/dao/TTaskMapper.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.github.zuihou.base.mapper.SuperMapper;
 import com.github.zuihou.business.operationManagementCenter.entity.Plan;
 import com.github.zuihou.business.operationManagementCenter.entity.TTask;
+import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
@@ -51,4 +52,6 @@ public interface TTaskMapper extends SuperMapper<TTask> {
 
 
     public List<Map> getTaskCountStatistics(Map<String, String> map);
+
+    public List<TaskNode> getInstructions(TaskNode taskNode);
 }

+ 2 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/dao/TaskNodeMapper.java

@@ -29,4 +29,6 @@ public interface TaskNodeMapper extends SuperMapper<TaskNode> {
 
     List<TaskNode> getTaskNodeList(Map map);
 
+    List<TaskNode> getInstructions(TaskNode taskNode);
+
 }

+ 1 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/TaskNodeService.java

@@ -9,6 +9,7 @@ import com.github.zuihou.business.operationManagementCenter.dto.TaskNodeCallBack
 import com.github.zuihou.business.operationManagementCenter.entity.TTask;
 import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import com.github.zuihou.business.productionReadyCenter.entity.*;
+import com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.security.model.SysUser;
 

+ 23 - 15
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -192,7 +192,7 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
 
     //获取子二级节点
     public List<TaskNode> getChildren(String parent_id) {
-        List autoNodeList = autoNodeMapper.selectList(new QueryWrapper<AutoNode>().eq("parent_id", parent_id));
+        List autoNodeList = resourceAutoCodeService.list(new QueryWrapper<ResourceAutoCode>().eq("parent_id", parent_id));
         return (List<TaskNode>) autoNodeList;
     }
 
@@ -213,39 +213,45 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         Map<String, List<TTask>> taskMap = taskList.stream().collect(groupingBy(TTask::getCompleteBatchNo));
 
         List<Long> procedureList = taskList.stream().map(p -> p.getProcedureId()).collect(Collectors.toList());
-        //List<AutoNode>autoList = autoNodeService.list(Wraps.<AutoNode>lbQ().in(AutoNode::getProcedureId,procedureList));
+        //List<ResourceAutoCode> autoList = resourceAutoCodeService.list(Wraps.<ResourceAutoCode>lbQ().in(ResourceAutoCode::getNo, procedureList));
         //执行任务对应的自动化程序
-        AutoNode model = new AutoNode();
+        ResourceAutoCode model = new ResourceAutoCode();
         model.setProcedureIds(StringUtil.changeIdsListToSubQueryStr(procedureList));
-        List<AutoNode> autoList = autoNodeMapper.getNodeList(model);
-        Map<Long, List<AutoNode>> autoNodeMap = autoList.stream().collect(groupingBy(AutoNode::getProcedureId));
+        model.setType("1");
+        List<ResourceAutoCode> autoList = resourceAutoCodeService.getNodeList(model);
+        Map<Long, List<ResourceAutoCode>> autoNodeMap = autoList.stream().collect(groupingBy(ResourceAutoCode::getProcedureId));
 
         List<TaskNode> taskNodeList = new ArrayList<TaskNode>();
         for (String key : taskMap.keySet()) {
             int i = 1;
             for (TTask t : taskList) {
-                List<AutoNode> autoNodeList = autoNodeMap.get(t.getProcedureId());
-                for (AutoNode autoNode : autoNodeList) {
+                List<ResourceAutoCode> autoNodeList = autoNodeMap.get(t.getProcedureId());
+                for (ResourceAutoCode autoNode : autoNodeList) {
                     TaskNode taskNode = new TaskNode();
-                    taskNode.setAutoNode(autoNode).setAutoNodeCode(autoNode.getCode()).setCompleteBatchNo(t.getCompleteBatchNo())
-                            .setNodeNo(autoNode.getNodeNo()).setExeStatus("1").setPrority(autoNode.getPrority());
-                    if (autoNode.getInterfaceType() != null) {
-                        taskNode.setInterfaceType(autoNode.getInterfaceType().getKey());
-                    }
+                    taskNode.setAutoNode(autoNode).setAutoNodeCode(autoNode.getNo()).setCompleteBatchNo(t.getCompleteBatchNo())
+                            //.setNodeNo(autoNode.getNodeNo())
+                            .setExeStatus("1").setPrority(autoNode.getWeight());
+                    //if (autoNode.getInterfaceType() != null) {
+                      //  taskNode.setInterfaceType(autoNode.getInterfaceType().getKey());
+                    //}
                     //是否延迟
-                    taskNode.setDelayFlag(autoNode.getDelayFlag()).setTaskId(t.getId()).setOrderId(t.getOrderId()).setResourceId(autoNode.getResourceId())
+                    taskNode
+                            //.setDelayFlag(autoNode.getDelayFlag())
+                            .setTaskId(t.getId()).setOrderId(t.getOrderId())
+                            //.setResourceId(autoNode.getResourceId())
                             .setTaskNodeNo(codeRuleService.getBillCode(CodeRuleModule.CODE_RULE_TASK_NODE));
                     //添加二级子节点
                     if (null != autoNode.getParentId()) {
-                        taskNode.setChildrenNode(autoNode.getChildrenNode());
+                        taskNode.setChildrenNode(autoNode.getChildren());
                     }
+                    /*
                     if (BizConstant.TASK_NODE_MANUALNODE_LOADING.equals(autoNode.getCode())) {//如果是人工的。则分配给人
                         taskNode.setLoadingUserId(getLoadingUserId("1", sysUser)).setNodeType("1");//上料
                     } else if (BizConstant.TASK_NODE_MANUALNODE_CUTTING.equals(autoNode.getCode())) {//如果是人工的。则分配给人
                         taskNode.setLoadingUserId(getLoadingUserId("2", sysUser)).setNodeType("2");//下料
                     } else if (BizConstant.TASK_NODE_MANUALNODE_TEST.equals(autoNode.getCode())) {//质检
                         taskNode.setLoadingUserId(getLoadingUserId("3", sysUser)).setNodeType("3");//质检
-                    }
+                    } */
                     taskNode.setCompleteBatchSort(i);
                     taskNodeList.add(taskNode);
                     i++;
@@ -1615,4 +1621,6 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
 //        }
         return result;
     }
+
+
 }

+ 8 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/dao/ResourceAutoCodeMapper.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.Wrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.github.zuihou.base.mapper.SuperMapper;
+import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode;
 import com.github.zuihou.business.productionResourceCenter.entity.ResourceBusiness;
 import com.github.zuihou.business.productionResourceCenter.entity.ZZone;
@@ -20,4 +21,11 @@ public interface ResourceAutoCodeMapper extends SuperMapper<ResourceAutoCode> {
     List<ResourceAutoCode> getTree(@Param(Constants.WRAPPER) Wrapper<ResourceAutoCode> wrapper, DataScope dataScope);
 
     Boolean delCode(Long id);
+
+    List<ResourceAutoCode> getNodeList(ResourceAutoCode resourceAutoCode);
+
+    ResourceAutoCode getInstruction(TaskNode taskNode);
+
+    ResourceAutoCode getNextCode(ResourceAutoCode resourceAutoCode);
+
 }

+ 19 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/ResourceAutoCodeService.java

@@ -2,6 +2,7 @@ package com.github.zuihou.business.productionResourceCenter.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.base.service.SuperService;
+import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import com.github.zuihou.business.productionResourceCenter.dto.ResourceAutoCodeSaveDTO;
 import com.github.zuihou.business.productionResourceCenter.dto.ResourceAutoCodeUpdateDTO;
 import com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode;
@@ -35,4 +36,22 @@ public interface ResourceAutoCodeService extends SuperService<ResourceAutoCode>
      */
     Boolean delCode(Long id);
 
+    /**
+     *  获取序列流程节点
+     *
+     * @param resourceAutoCode
+     * @return
+     */
+    List<ResourceAutoCode> getNodeList(ResourceAutoCode resourceAutoCode);
+
+    /**
+     *  获取节点执行指令
+     *
+     * @param taskNode
+     * @return
+     */
+    ResourceAutoCode getInstruction(TaskNode taskNode);
+
+    ResourceAutoCode getNextCode(ResourceAutoCode resourceAutoCode);
+
 }

+ 8 - 4
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/MachineNodeServiceImpl.java

@@ -19,13 +19,16 @@ import com.github.zuihou.business.productionReadyCenter.entity.BomProcedureProgr
 import com.github.zuihou.business.productionReadyCenter.service.BomProcedureService;
 import com.github.zuihou.business.productionResourceCenter.dao.ProductionresourcePositionMapper;
 import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
+import com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode;
 import com.github.zuihou.business.productionResourceCenter.service.NodeOperationService;
 import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
 import com.github.zuihou.business.util.MsgUtil;
 import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
+import com.github.zuihou.tenant.entity.ModuleInstruction;
 import com.google.common.collect.Maps;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.compress.utils.Lists;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -82,7 +85,6 @@ public class MachineNodeServiceImpl implements NodeOperationService {
 
     private String ZK_ip_rxx = "192.168.170.71";
 
-
     @Override
     public void initResource(TaskNode taskNode, TTask task, Map dataMap) {
 
@@ -99,10 +101,12 @@ public class MachineNodeServiceImpl implements NodeOperationService {
         map.put("task", task);
         map.put("bizType", bizType);
 
-        String categoryName = dataMap.get("categoryName").toString();
-        String functionName = dataMap.get("functionName").toString();
+        String moduleName = dataMap.get("moduleName").toString();
+        List<ModuleInstruction> instructions = dataMap.get("instructions") == null ? Lists.newArrayList() : (List<ModuleInstruction>)dataMap.get("instructions");
+        ResourceAutoCode resourceAutoCode = taskNode.getAutoNode();
+        String functionName = resourceAutoCode.getCommand();
 
-        switch (categoryName) {
+        switch (moduleName) {
             case "WMS":
                 //WMS出库
                 if ("WMS_OUT".equals(functionName)) {

+ 179 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/OtherNodeServiceImpl.java

@@ -0,0 +1,179 @@
+package com.github.zuihou.business.productionResourceCenter.service.impl;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.fastjson.JSONObject;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.github.zuihou.business.DemoLine.DemoLineConstant;
+import com.github.zuihou.business.edgeLibrary.entity.Storge;
+import com.github.zuihou.business.operationManagementCenter.entity.TTask;
+import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
+import com.github.zuihou.business.productionResourceCenter.dao.ResourceAutoCodeMapper;
+import com.github.zuihou.business.productionResourceCenter.entity.ProductionresourcePosition;
+import com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode;
+import com.github.zuihou.business.productionResourceCenter.service.NodeOperationService;
+import com.github.zuihou.business.productionResourceCenter.service.ProductionresourcePositionService;
+import com.github.zuihou.business.productionResourceCenter.service.ResourceAutoCodeService;
+import com.github.zuihou.common.constant.DictionaryKey;
+import com.github.zuihou.common.util.StringUtil;
+import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
+import com.github.zuihou.tenant.entity.Module;
+import com.github.zuihou.tenant.entity.ModuleInstruction;
+import com.github.zuihou.tenant.service.ModuleService;
+import com.google.common.collect.Maps;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.compress.utils.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+
+@Slf4j
+@Service
+public class OtherNodeServiceImpl implements NodeOperationService {
+
+    private Map<String, Object> map = Maps.newHashMap();
+
+    @Autowired
+    private ModuleService moduleService;
+
+    @Autowired
+    private ProductionresourcePositionService productionresourcePositionService;
+
+    @Autowired
+    private ResourceAutoCodeMapper resourceAutoCodeMapper;
+
+    private String[] jbwArr;
+
+    private String[] xbkArr;
+
+    private List<ProductionresourcePosition> xbkList;
+
+    private List<ProductionresourcePosition> jbwList;
+
+
+    @Override
+    public void initResource(TaskNode taskNode, TTask task, Map dataMap) {
+        String moduleName = dataMap.get("moduleName") == null ? "" : dataMap.get("moduleName").toString();
+        if(StringUtil.isNotEmpty(moduleName)) {
+            List<Module> modules = moduleService.list(new QueryWrapper<Module>().like("name", moduleName));
+            if(modules.size()>0){
+                jbwArr = modules.stream().map(Module::getNo).toArray(String[]::new);
+                jbwList = productionresourcePositionService.getFreeProductionresourcePositionByNos(jbwArr);
+            }
+        }
+        //初始化默认设定(后期动态获取)
+        xbkArr = new String[]{DemoLineConstant.NODE_RESOURCE_ZLZX_XBK};
+        xbkList = productionresourcePositionService.getFreeProductionresourcePositionByNos(xbkArr);
+    }
+
+    @Override
+    public Map checkCondition(TaskNode taskNode, TTask task, Map<String, Object> dataMap) {
+        //判断
+        ResourceAutoCode resourceAutoCode = taskNode.getAutoNode();
+        String command = resourceAutoCode.getCommand();
+        String moduleName = dataMap.get("moduleName") == null ? "" : dataMap.get("moduleName").toString();
+        boolean bool = true;
+        //List<ModuleInstruction> instructions = dataMap.get("instructions") == null ? Lists.newArrayList() : (List<ModuleInstruction>)dataMap.get("instructions");
+        switch(moduleName){
+            case "WMS":
+                //当前设备状态判断
+                if(!runStatus(taskNode.getResourceId())){
+                    map.put("result", false);
+                    map.put("msg", DictionaryKey.NodeException.RUNNING_FALSE);
+                    return map;
+                }
+                if ("WMS_OUT".equals(command)) {
+                    ProductionresourcePosition productionresourcePosition = this.logical(jbwList, false);
+                    bool =  productionresourcePosition!=null ? true : false;
+                    //更新后续节点设备ID
+                    if(bool){
+                        ResourceAutoCode autoCode = new ResourceAutoCode();
+                        autoCode.setWeight(resourceAutoCode.getWeight()+ 1);
+                        autoCode.setBusinessId(autoCode.getBusinessId());
+                        ResourceAutoCode nextAutoCode = resourceAutoCodeMapper.getNextCode(autoCode);
+                        if(nextAutoCode!=null && !nextAutoCode.isFinal()){
+                            nextAutoCode.setResourceId(productionresourcePosition.getResourceId());
+                            resourceAutoCodeMapper.updateById(nextAutoCode);
+                        }
+                    }
+                }
+                else if("WMS_IN".equals(command)){
+                    //获取当前节点设备ID
+                    String resourceId = resourceAutoCode.getResourceId().toString();
+                    ProductionresourcePosition resourcePosition = productionresourcePositionService.getOne(new LbqWrapper<ProductionresourcePosition>().eq(ProductionresourcePosition::getResourceId, resourceId));
+                    bool = resourcePosition.getLockStatus() == "1" && resourcePosition.getStatus() == "1";
+                    //判断是否存有产品 待定
+
+                    if(!bool){
+                        map.put("msg", DictionaryKey.NodeException.NO_RESROURCE);
+                    }
+                }
+                map.put("result", bool);
+                break;
+        }
+        map.put("moduleName", moduleName);
+        return map;
+    }
+
+    @Override
+    public Map operation(JSONObject jsonObject, JSONObject bizJsonObject, Map<String, Object> map) {
+
+
+
+        return null;
+    }
+
+    @Override
+    public boolean confirmStatus(TaskNode taskNode) {
+        return false;
+    }
+
+    @Override
+    public void move(Storge fromStorge, Storge toStorage) {
+
+    }
+
+    /**
+     *  设备动态逻辑判断处理
+     *
+     * @param deviceList
+     * @param useXbk
+     * @return
+     */
+    private ProductionresourcePosition logical(List<ProductionresourcePosition> deviceList, boolean useXbk){
+        boolean bool = true;
+        //设备不存在
+        if(deviceList == null || deviceList.size() == 0){
+            map.put("msg", DictionaryKey.NodeException.NO_RESROURCE);
+            return null;
+        }
+        deviceList = deviceList.stream().filter(position->position.getStatus() =="1" && position.getLockStatus()=="0").collect(Collectors.toList());
+        //设备被锁定
+        if(deviceList == null || deviceList.size() == 0){
+            map.put("msg", DictionaryKey.NodeException.RESOURCE_LOCK);
+            return null;
+        }
+        //线边库判断处理
+        if(useXbk){
+
+        }
+        return deviceList.get(0);
+    }
+
+    /**
+     * 实时获取当前设备状态
+     *
+     * @param resourceId
+     * @return
+     */
+    private boolean runStatus(Long resourceId){
+       //读取缓存
+       //读取数据库
+       //读取采集接口
+      return true;
+    }
+
+}

+ 17 - 0
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/ResourceAutoCodeServiceImpl.java

@@ -2,6 +2,7 @@ package com.github.zuihou.business.productionResourceCenter.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
 import com.github.zuihou.base.service.SuperServiceImpl;
+import com.github.zuihou.business.operationManagementCenter.entity.TaskNode;
 import com.github.zuihou.business.productionResourceCenter.dao.ResourceAutoCodeMapper;
 import com.github.zuihou.business.productionResourceCenter.dto.ResourceAutoCodeSaveDTO;
 import com.github.zuihou.business.productionResourceCenter.dto.ResourceAutoCodeUpdateDTO;
@@ -45,4 +46,20 @@ public class ResourceAutoCodeServiceImpl extends SuperServiceImpl<ResourceAutoCo
     public Boolean delCode(Long id) {
         return baseMapper.delCode(id);
     }
+
+    @Override
+    public List<ResourceAutoCode> getNodeList(ResourceAutoCode resourceAutoCode) {
+        return baseMapper.getNodeList(resourceAutoCode);
+    }
+
+    @Override
+    public ResourceAutoCode getInstruction(TaskNode taskNode) {
+        return baseMapper.getInstruction(taskNode);
+    }
+
+    @Override
+    public ResourceAutoCode getNextCode(ResourceAutoCode resourceAutoCode) {
+        return baseMapper.getNextCode(resourceAutoCode);
+    }
+
 }

+ 48 - 0
imcs-admin-boot/imcs-business-biz/src/main/resources/mapper_business/base/productionResourceCenter/ResourceAutoCodeMapper.xml

@@ -50,4 +50,52 @@
         WHERE id = #{id} or parent_id = #{id}
     </delete>
 
+    <select id="getNodeList" resultMap="BaseResultMap" parameterType="com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode">
+        select
+        <include refid="Base_Column_List"/>, businessName, isFinal,procedureId, no
+        from (
+        select a.*,b.name as businessName, b.is_final as isFinal,c.procedure_id as procedureId,p.no
+        from imcs_resource_autocode a
+        left join imcs_resource_business b on a.business_id= b.id
+        left join imcs_b_bom_procedure_productionresource c on c.resource_business_id= b.id
+        left join imcs_b_bom_procedure p on p.id= c.procedure_id where 1=1
+        )s
+        where 1=1
+        <if test="procedureId != null and procedureId != ''">
+            and s.procedure_id = #{procedureId}
+        </if>
+        <if test="procedureIds != null and procedureIds != ''">
+            and s.procedure_id  in (${procedureIds})
+        </if>
+        <if test="parentId != null and parentId != ''">
+            and s.parent_id  =  #{parentId}
+        </if>
+        <if test="type != null and type != ''">
+            and s.type  =  #{type}
+        </if>
+        order by s.weight asc, s.create_time asc
+    </select>
+
+    <select id="getInstruction" parameterType="com.github.zuihou.business.operationManagementCenter.entity.TaskNode">
+        select
+        <include refid="Base_Column_List"/>, i.name as instructionName,i.code as instructionCode,p.name as resourceName
+        from imcs_resource_autocode a
+        left join imcs_resource_business b on a.business_id = b.id
+        left join view_productionresource p on b.resource_id= p.id
+        left join view_module_instruction i on i.module_id= p.module_id
+        where a.command= c.code and a.resource_id= #{resourceId}
+    </select>
+
+    <select id="getNextCode" parameterType="com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode">
+        select
+        <include refid="Base_Column_List"/> from imcs_resource_autocode a
+        where 1=1
+        <if test="weight != null and weight != ''">
+            and a.weight = #{weight}
+        </if>
+        <if test="businessId != null and businessId != ''">
+            and a.businessId = #{businessId}
+        </if>
+         order by a.weight asc, a.create_time asc
+    </select>
 </mapper>

+ 4 - 3
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/operationManagementCenter/entity/TaskNode.java

@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.github.zuihou.base.entity.Entity;
 import com.github.zuihou.business.productionReadyCenter.entity.*;
+import com.github.zuihou.business.productionResourceCenter.entity.ResourceAutoCode;
 import com.github.zuihou.common.constant.BizConstant;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -83,7 +84,7 @@ public class TaskNode extends Entity<Long> {
     @ApiModelProperty(value = "自动化节点ID")
     @TableField("auto_node_id")
     @Excel(name = "自动化节点ID")
-    private AutoNode autoNode;
+    private ResourceAutoCode autoNode;
 
     /**
      * 资源ID
@@ -357,7 +358,7 @@ public class TaskNode extends Entity<Long> {
 
     @Builder(builderMethodName = "TaskNodeBuilder")
     public TaskNode(Long id, Long createUser, LocalDateTime createTime, LocalDateTime updateTime, Long updateUser,
-                    Long taskId, String taskNodeNo, AutoNode autoNode, Date startTime, Date endTime,
+                    Long taskId, String taskNodeNo, ResourceAutoCode autoNode, Date startTime, Date endTime,
                     Integer prority, Long loadingUserId, String feedback, String feedbackFile, String exeStatus, String exeResult) {
         this.id = id;
         this.createUser = createUser;
@@ -383,7 +384,7 @@ public class TaskNode extends Entity<Long> {
 
     @ApiModelProperty(value = "子节点")
     @TableField(exist = false)
-    private List<AutoNode> childrenNode;
+    private List<ResourceAutoCode> childrenNode;
 
     /**
      * 产线id

+ 3 - 2
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/ResourceAutoCodePageDTO.java

@@ -72,7 +72,7 @@ public class ResourceAutoCodePageDTO implements Serializable {
      * 操作设备类型(1-机械节点 2-AGV 3-机械手臂)
      */
     @ApiModelProperty(value = "操作设备类型(1-机械节点 2-AGV 3-机械手臂)")
-    @Length(max = 4, message = "操作设备类型(1-机械节点 2-AGV 3-机械手臂)")
+    @Length(max = 4, message = "操作设备类型(1-机械节点 2-AGV 3-机械手臂)长度不能超过4")
     private String category;
 
 
@@ -80,7 +80,8 @@ public class ResourceAutoCodePageDTO implements Serializable {
      * 动作指令
      */
     @ApiModelProperty(value = "动作指令")
-    private Integer command;
+    @Length(max = 32, message = "动作指令长度不能超过32")
+    private String command;
 
 
     /**

+ 2 - 1
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/ResourceAutoCodeSaveDTO.java

@@ -79,7 +79,8 @@ public class ResourceAutoCodeSaveDTO implements Serializable {
      * 动作指令
      */
     @ApiModelProperty(value = "动作指令")
-    private Integer command;
+    @Length(max = 32, message = "动作指令长度不能超过32")
+    private String command;
 
     /**
      * 业务ID

+ 2 - 1
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/dto/ResourceAutoCodeUpdateDTO.java

@@ -80,7 +80,8 @@ public class ResourceAutoCodeUpdateDTO implements Serializable {
      * 动作指令
      */
     @ApiModelProperty(value = "动作指令")
-    private Integer command;
+    @Length(max = 32, message = "动作指令长度不能超过32")
+    private String command;
 
 
     /**

+ 2 - 2
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/ProductionresourcePosition.java

@@ -67,10 +67,10 @@ public class ProductionresourcePosition extends Entity<Long> {
     @Excel(name = "名称")
     private String name;
 
-    @ApiModelProperty(value = "")
+    @ApiModelProperty(value = "编号")
     @Length(max = 64, message = "长度不能超过64")
     @TableField(value = "no", condition = LIKE)
-    @Excel(name = "")
+    @Excel(name = "编号")
     private String no;
 
     /**

+ 30 - 10
imcs-admin-boot/imcs-business-entity/src/main/java/com/github/zuihou/business/productionResourceCenter/entity/ResourceAutoCode.java

@@ -29,14 +29,6 @@ public class ResourceAutoCode extends Entity<Long> {
 
     private static final long serialVersionUID = 1L;
 
-    /**
-     * 设备业务名
-     */
-    @ApiModelProperty(value = "节点编码")
-    @Length(max = 256, message = "节点编码长度不能超过256")
-    @TableField(value = "no", condition = LIKE)
-    @Excel(name = "编码")
-    private String no;
 
     /**
      * 设备业务名
@@ -72,9 +64,10 @@ public class ResourceAutoCode extends Entity<Long> {
      * 动作指令
      */
     @ApiModelProperty(value = "动作指令")
+    @Length(max = 32, message = "动作指令长度不能超过4")
     @TableField(value = "command", condition = LIKE)
     @Excel(name = "动作指令")
-    private Integer command;
+    private String command;
 
 
     /**
@@ -168,8 +161,35 @@ public class ResourceAutoCode extends Entity<Long> {
     @TableField(exist=false)
     private String targetName;
 
+    /**
+     * 目标设备名
+     */
+    @TableField(exist=false)
+    private boolean isFinal;
+
+    /**
+     * 业务序列名
+     */
+    @TableField(exist=false)
+    private String businessName;
+
+    /**
+     * 目标设备名
+     */
+    @TableField(exist=false)
+    private Long procedureId;
+
+    /**
+     * 目标设备名
+     */
+    @TableField(exist=false)
+    private String procedureIds;
+
+    @TableField(exist=false)
+    private String no;
+
     @Builder
-    public ResourceAutoCode(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, String name, String type, int command, Integer weight, String status, String remark, Long parentId, Long businessId, Long resourceId, Long startId, Long targetId, String resourceName, String startName, String targetName) {
+    public ResourceAutoCode(Long id, LocalDateTime createTime, Long createUser, LocalDateTime updateTime, Long updateUser, String name, String type, String command, Integer weight, String status, String remark, Long parentId, Long businessId, Long resourceId, Long startId, Long targetId, String resourceName, String startName, String targetName) {
         super(id, createTime, createUser, updateTime, updateUser);
         this.name = name;
         this.type = type;

+ 95 - 3
imcs-admin-boot/imcs-common/src/main/java/com/github/zuihou/common/constant/DictionaryKey.java

@@ -1,5 +1,9 @@
 package com.github.zuihou.common.constant;
 
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * 全局参数表(c_common_parameter)的key
  *
@@ -8,14 +12,102 @@ package com.github.zuihou.common.constant;
  */
 public interface DictionaryKey {
 
-
-
     //PLC
     String INTERFACETYPE_PLC = "01";
     //生产加工接口
     String INTERFACETYPE_PRO = "02";
     //AGV相关接口
     String INTERFACETYPE_AGV = "03";
-    //AGV相关接口
+    //WMS相关接口
     String INTERFACETYPE_WMS = "04";
+
+    //节点枚举异常
+    enum NodeException {
+       TIME_OUT("超时", 1), RUNNING_FALSE("设备运行不正常", 2),
+       NO_RESROURCE("无可运行资源", 3), RESOURCE_LOCK("设备已锁定", 4);
+       private String name;
+       private int index;
+       private NodeException(String name, int index){
+           this.name = name;
+           this.index = index;
+       }
+       public String getName(){
+           return name;
+       }
+       public void setName(){
+           this.name = name;
+       }
+       public int getIndex(){
+           return index;
+       }
+       public void setIndex(){
+           this.index = index;
+       }
+       public static String getName(int index){
+          return Arrays.stream(NodeException.values()).filter(node->node.getIndex() == index).map(node->node.name).findAny().orElse(null);
+       }
+    }
+
+    //设备分类
+    Map<String, String> RESOURCE_CATEGORY = new HashMap<String, String>(){
+        {
+            put("1", "生产设备");
+            put("2", "AGV");
+            put("3", "机器手");
+            put("4", "其他");
+        }
+    };
+
+    //设备机器操作
+    Map<String, String> MACHINE_NODES = new HashMap<String, String>(){
+        {
+            put("1", "上传程序");
+            put("2", "执行程序");
+            put("3", "刀具校验");
+        }
+    };
+
+    //AGV相关设备
+    Map<String, String> AGV_NODES = new HashMap<String, String>(){
+        {
+            put("1", "舱体线接驳位");
+            put("2", "框体线接驳位");
+            put("3", "保障中心线接驳位");
+        }
+    };
+
+    //云箭机器人
+    Map<String, String> YJ_ROBOT_NODES = new HashMap<String, String>(){
+        {
+            put("1", "舱体线机器人");
+            put("2", "伺服舵机");
+            put("3", "框体线机器人");
+        }
+    };
+
+    //示范线机器人
+    Map<String, String> LINE_ROBOT_NODES = new HashMap<String, String>(){
+        {
+            put("1", "质量中心机器人");
+            put("2", "柔性线机器人");
+            put("3", "智能单元机器人");
+        }
+    };
+
+    //机器手操作
+    Map<String, String> ROBOT_ACTION = new HashMap<String, String>(){
+        {
+            put("1", "取");
+            put("2", "放");
+        }
+    };
+
+    //设备操作目标
+    Map<String, String> ACTION_TARGET = new HashMap<String, String>(){
+        {
+            put("1", "本设备");
+            put("2", "接驳位");
+        }
+    };
+
 }