Explorar el Código

Merge remote-tracking branch 'origin/master' into master

姚云青 hace 3 años
padre
commit
42c8252028

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

@@ -166,7 +166,7 @@ public class TaskWorkNode {
         BaseContextHandler.setTenant("0000");
 
         TaskNode taskNode = taskNodeService.getById(taskNodeId);
-        TaskNode beforTaskNode = taskNodeService.getNextNTaskNode(taskNode,-1);
+//
         if (taskNode == null || taskNode.getTaskId()== null) {
             throw new InterruptedException("当前任务节点为空");
         }
@@ -236,6 +236,7 @@ public class TaskWorkNode {
                 Map conMap = checkCon(taskNode, tTask, queryMap);
 
                 if("03".equals(taskNode.getInterfaceType())){
+                    TaskNode beforTaskNode = taskNodeService.getNextNTaskNode(taskNode,-1);
                     // agv搬运
                     Map agvData = new HashMap();
                     agvData.put("start",beforTaskNode.getTargetResourceId());

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

@@ -302,6 +302,10 @@ 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<BomProcedure> bomProcedureList = bomProcedureService.list(Wraps.<BomProcedure>lbQ().in(BomProcedure::getId, procedureList));
+
+        Map<Long,BomProcedure> bpMap = bomProcedureList.stream().collect(Collectors.toMap(BomProcedure::getId, t->t));
+
         //List<AutoNode>autoList = autoNodeService.list(Wraps.<AutoNode>lbQ().in(AutoNode::getProcedureId,procedureList));
         //执行任务对应的自动化程序
 //        AutoNode model = new AutoNode();
@@ -319,15 +323,18 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
         for (String key : taskMap.keySet()) {
             int i = 1;
             for (TTask t : taskList) {
+
                 //取出resrouceId
                 Long resourceBusinessId = t.getResourceBusinessId();
                 List<ResourceAutoCode> autoCodeList = resourceAutoCodeMap.get(resourceBusinessId);
 
                 //查询所有的父节点
-                List<ResourceAutoCode>parentResourceAutoCodeList = autoCodeList.stream().filter(a->a.getParentId().longValue()==0L).collect(Collectors.toList());
-                for (ResourceAutoCode pautoCode : parentResourceAutoCodeList) {//父节点
+                List<ResourceAutoCode> parentResourceAutoCodeList = autoCodeList.stream().filter(a->a.getParentId().longValue()==0L).collect(Collectors.toList());
+//                for (ResourceAutoCode pautoCode : parentResourceAutoCodeList) {//父节点
+                for (int parentCount = 0; parentCount< parentResourceAutoCodeList.size(); parentCount++) { //父节点
+                    ResourceAutoCode pautoCode =parentResourceAutoCodeList.get(parentCount);
                     List<ResourceAutoCode>childResourceAutoCodeList = autoCodeList.stream().filter(a->pautoCode.getId().toString().equals(a.getParentId().toString())).collect(Collectors.toList());
-                    for (int count = 0; count < childResourceAutoCodeList.size(); count++) {//子节点
+                    for (int count = 0; count < childResourceAutoCodeList.size(); count++) { //子节点
                         ResourceAutoCode autoCode = childResourceAutoCodeList.get(count);
                         ResourceAutoCode nextAutoCode = null;
                         if(count < childResourceAutoCodeList.size() -1){
@@ -377,10 +384,24 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
                             taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_WMS);
                         }
                         taskNode.setCompleteBatchSort(i);
+
+                        if(parentCount == parentResourceAutoCodeList.size() - 1
+                                && count == childResourceAutoCodeList.size() - 1){
+                            String taskType = bpMap.get(t.getProcedureId()).getType();
+                            if("上料".equals(taskType)){
+                                taskNode.setNodeType("1");
+                            }else if("下料".equals(taskType)){
+                                taskNode.setNodeType("2");
+                            }else if("翻面".equals(taskType)){
+                                taskNode.setNodeType("4");
+                            }else{
+                                taskNode.setNodeType("0");
+                            }
+                        }
+
                         taskNodeList.add(taskNode);
                         i++;
                     }
-
                 }