|
@@ -326,7 +326,12 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
List<ResourceAutoCode>parentResourceAutoCodeList = autoCodeList.stream().filter(a->a.getParentId().longValue()==0L).collect(Collectors.toList());
|
|
|
for (ResourceAutoCode pautoCode : parentResourceAutoCodeList) {//父节点
|
|
|
List<ResourceAutoCode>childResourceAutoCodeList = autoCodeList.stream().filter(a->pautoCode.getId().toString().equals(a.getParentId().toString())).collect(Collectors.toList());
|
|
|
- for (ResourceAutoCode autoCode : childResourceAutoCodeList) {//子节点
|
|
|
+ for (int count = 0; count < childResourceAutoCodeList.size(); count++) {//子节点
|
|
|
+ ResourceAutoCode autoCode = childResourceAutoCodeList.get(count);
|
|
|
+ ResourceAutoCode nextAutoCode = null;
|
|
|
+ if(count < childResourceAutoCodeList.size() -1){
|
|
|
+ nextAutoCode = childResourceAutoCodeList.get(count + 1);
|
|
|
+ }
|
|
|
TaskNode taskNode = new TaskNode();
|
|
|
// taskNode.setAutoNode(autoNode).setAutoNodeCode(autoNode.getCode()).setCompleteBatchNo(t.getCompleteBatchNo())
|
|
|
// .setNodeNo(autoNode.getNodeNo()).setExeStatus("1").setPrority(autoCode.getWeight());
|
|
@@ -342,13 +347,28 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
|
|
|
taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_PLC);
|
|
|
//加工设备的设备ID来源于加工任务设备
|
|
|
taskNode.setResourceId(taskNode.getTaskId());
|
|
|
+ taskNode.setTargetResourceId(t.getResourceId());
|
|
|
}else if("3".equals(taskNode.getAutoNode().getCategory())){
|
|
|
+ String command = autoCode.getCommand();
|
|
|
taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_PLC);
|
|
|
//根据配置确定操作设备ID
|
|
|
//String resourceType = autoCode.getResourceId()!=null? autoCode.getResourceId().toString() : null;
|
|
|
+ // 放,判断后一个动作节点是否是agv搬运,如果是,这个targetResourceId设置成空
|
|
|
+ if("2".equals(command)){
|
|
|
+ // 最后一个节点
|
|
|
+ if(count == childResourceAutoCodeList.size() - 1){
|
|
|
+ taskNode.setTargetResourceId(t.getResourceId());
|
|
|
+ }else{
|
|
|
+ if(null == nextAutoCode.getResourceId()){
|
|
|
+ taskNode.setTargetResourceId(null);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if(null!= autoCode.getResourceId()) {
|
|
|
taskNode.setResourceId(getResourceIdByAutoCode(autoCode.getResourceId().toString()));
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
else if("2".equals(taskNode.getAutoNode().getCategory())){
|
|
|
taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_AGV);
|