|
@@ -359,7 +359,8 @@ public class TaskWorkNode {
|
|
|
String count = conMap.get(taskNode.getId().toString() + "count") == null ? "" : conMap.get(taskNode.getId().toString() + "count").toString();
|
|
|
jsonObject.put("BusinessType", carryRequest);
|
|
|
//传参数--起始终点位置
|
|
|
- if ("testwork".equals(carryRequest) || "print".equals(carryRequest)) {//三坐标的Data参数比较特殊
|
|
|
+ if ("testwork".equals(carryRequest) || "print".equals(carryRequest)) {
|
|
|
+ //三坐标的Data参数比较特殊
|
|
|
String data = conMap.get("Data") == null ? null : conMap.get("Data").toString();
|
|
|
jsonObject.put("Data", data);
|
|
|
} else {
|
|
@@ -399,7 +400,6 @@ public class TaskWorkNode {
|
|
|
bizJsonObject.put(DemoLineConstant.DEMOLINE_XBK_TYPE, xbkType);
|
|
|
bizJsonObject.put(DemoLineConstant.DEMOLINE_XBK_CARRY_TYPE, carryType);
|
|
|
}
|
|
|
-// }
|
|
|
} else if (DictionaryKey.INTERFACETYPE_PRO.equals(taskNode.getInterfaceType())) {
|
|
|
jsonObject.put("url", task.getIp());
|
|
|
jsonObject.put("port", task.getPort());
|
|
@@ -693,12 +693,14 @@ public class TaskWorkNode {
|
|
|
else if (DemoLineConstant.DEMOLINE_OP01_04.equals(taskNode.getNodeNo())) {
|
|
|
//机器人放子盘夹具到上下料站(从机械手到上下料站)
|
|
|
//节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
|
|
|
- map.put("functionName", "QSTATION_IN");
|
|
|
- nodeOperationService.initResource(taskNode,task,map);
|
|
|
+ //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())) {
|
|
@@ -737,18 +739,17 @@ public class TaskWorkNode {
|
|
|
String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
|
|
|
: msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
|
|
|
|
|
|
- //根据产线编号,匹配出产线类型。
|
|
|
- String JQR = "";
|
|
|
-
|
|
|
//记录产品流转到的库位
|
|
|
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("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);
|
|
|
}
|
|
|
}
|
|
@@ -779,7 +780,7 @@ public class TaskWorkNode {
|
|
|
map = nodeOperationService.checkCondition(taskNode,task,map);
|
|
|
}
|
|
|
else if (DemoLineConstant.DEMOLINE_OP03_03.equals(taskNode.getNodeNo())) {
|
|
|
- //清洗,PLC接口
|
|
|
+ //柔性线清洗机,PLC接口
|
|
|
map.put("functionName", "RX_CLEAN");
|
|
|
map = nodeOperationService.checkCondition(taskNode,task,map);
|
|
|
}
|
|
@@ -829,81 +830,22 @@ public class TaskWorkNode {
|
|
|
: msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
|
|
|
|
|
|
//根据产线编号,匹配出产线类型。
|
|
|
- String JQR = "";
|
|
|
|
|
|
if (DemoLineConstant.DEMOLINE_WORK_SPACE1.equals(zoneNo)) {
|
|
|
- Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
|
|
|
- Storge plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo()) == null ? null : (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo());
|
|
|
- map.put("zkIp", ZK_ip_zndy);
|
|
|
- map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
|
|
|
- map.put("fromStorge", jqrStorge);
|
|
|
- map.put("toStorge", plantStorge);
|
|
|
- map.put("Data", plantStorge);
|
|
|
- //出入库类型
|
|
|
- map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
- msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), plantStorge, 1, TimeUnit.DAYS);
|
|
|
- //前一步已经锁定完毕,直接满足条件
|
|
|
- map.put("result", true);
|
|
|
- } else if (DemoLineConstant.DEMOLINE_WORK_SPACE2.equals(zoneNo)) {
|
|
|
- //当前步骤。骤有的节点会生产多步执行
|
|
|
- int count = dataMap.get(taskNode.getId().toString() + "count") == null ? 0 : Integer.parseInt(dataMap.get(taskNode.getId().toString() + "count").toString());
|
|
|
- //执行到第几步
|
|
|
- map.put(taskNode.getId().toString() + "count", count);
|
|
|
- map.put(DemoLineConstant.DEMOLINE_RXJQR_FLAG, "1");
|
|
|
- map.put("zkIp", ZK_ip_rxx);
|
|
|
-// JQR = DemoLineConstant.JQR3;
|
|
|
-// TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode, 1);
|
|
|
- if (count == 0) {//第一步移动
|
|
|
- Storge plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo()) == null ? null : (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo());
|
|
|
- if (plantStorge != null) {
|
|
|
- map.put("Data", plantStorge);
|
|
|
- map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "moveMaterial");
|
|
|
- } else {
|
|
|
- //前序绑定的线边库
|
|
|
- Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK + taskNode.getId());
|
|
|
- if (xbkStorge != null) {
|
|
|
- xbkStorge = (Storge) xbkStorge;
|
|
|
- //目的地为线边库
|
|
|
- map.put("toStorge", xbkStorge);
|
|
|
- //临时存放到了线边库的标志
|
|
|
- map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
|
|
|
- //临时存放到了智能单元的线边库
|
|
|
- map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZNSCDY_XBK);
|
|
|
- //当前执行数量
|
|
|
- msgUtil.redis_set(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo(), 0, 1, TimeUnit.DAYS);
|
|
|
- }
|
|
|
- }
|
|
|
- } else if (count == 1) {//从缓存位拿出来
|
|
|
- map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "fetchMaterial");
|
|
|
- Storge hcwStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.DEMOLINE_RJQR_HCW + taskNode.getId());
|
|
|
- map.put("Data", hcwStorge);
|
|
|
- map.put("fromStorge", hcwStorge);
|
|
|
- Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
|
|
|
- map.put("toStorge", jqrStorge);
|
|
|
- //出入库类型
|
|
|
- map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
- } else if (count == 2) {
|
|
|
- map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
|
|
|
- //出入库类型
|
|
|
- map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
- Storge plantStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo()) == null ? null : (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_TB_STORAGE + "_" + task.getCompleteBatchNo());
|
|
|
- map.put("Data", plantStorge);
|
|
|
- map.put("toStorge", plantStorge);
|
|
|
- Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR3 + taskNode.getId());
|
|
|
- map.put("fromStorge", jqrStorge);
|
|
|
- msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), plantStorge, 1, TimeUnit.DAYS);
|
|
|
- }
|
|
|
- map.put("result", true);
|
|
|
+ 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运回
|
|
|
- nodeOperationService.checkCondition(taskNode, task, dataMap);
|
|
|
-
|
|
|
+ map = nodeOperationService.checkCondition(taskNode, task, dataMap);
|
|
|
}
|
|
|
else if (DemoLineConstant.DEMOLINE_OP05_02.equals(taskNode.getNodeNo())) {
|
|
|
//取放到三坐标
|
|
@@ -911,42 +853,8 @@ public class TaskWorkNode {
|
|
|
map = nodeOperationService.checkCondition(taskNode,task,map);
|
|
|
}
|
|
|
else if (DemoLineConstant.DEMOLINE_OP05_03.equals(taskNode.getNodeNo())) {
|
|
|
- //取放到三坐标 从机器人手臂到三坐标
|
|
|
- Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo());
|
|
|
-
|
|
|
- map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
|
|
|
- map.put("zkIp", ZK_ip_zlzx);
|
|
|
- map.put("fromStorge", jqrStorge);
|
|
|
- map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
- //前序绑定的sum50
|
|
|
- Object szbStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.Q3ZUOBIAO + taskNode.getId());
|
|
|
- if (szbStorge != null) {//前序是绑定到托板
|
|
|
- szbStorge = (Storge) szbStorge;
|
|
|
- //目的地为机器人手臂
|
|
|
- map.put("toStorge", szbStorge);
|
|
|
- map.put("Data", szbStorge);
|
|
|
- msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), szbStorge, 1, TimeUnit.DAYS);
|
|
|
- } else {
|
|
|
- //前序绑定的线边库
|
|
|
- Object xbkStorge = msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.NODE_RESOURCE_ZLZX_XBK + taskNode.getId());
|
|
|
- if (xbkStorge != null) {
|
|
|
- xbkStorge = (Storge) xbkStorge;
|
|
|
- //目的地为线边库
|
|
|
- map.put("toStorge", xbkStorge);
|
|
|
- map.put("Data", xbkStorge);
|
|
|
- //出入库类型
|
|
|
- map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
- //临时存放到了线边库的标志
|
|
|
- map.put(DemoLineConstant.DEMOLINE_XBKFLAG, "1");
|
|
|
- //临时存放到了智能单元的线边库
|
|
|
- map.put(DemoLineConstant.DEMOLINE_XBK_TYPE, DemoLineConstant.NODE_RESOURCE_ZLZX_XBK);
|
|
|
- //搬运类型
|
|
|
- map.put(DemoLineConstant.DEMOLINE_XBK_CARRY_TYPE, BizConstant.MQ_TASK_NODE_TYPE_STORAGE_WAIT_ZLZX_SZB);
|
|
|
- //当前执行数量
|
|
|
- msgUtil.redis_set(DemoCacheKey.DEMOLINE_XBK_CURRCOUNT + task.getCompleteBatchNo(), 0, 1, TimeUnit.DAYS);
|
|
|
- }
|
|
|
- }
|
|
|
- map.put("result", true);
|
|
|
+ map.put("robotType", DemoLineConstant.JQR2);
|
|
|
+ map = nodeOperationService.checkCondition(taskNode,task,map);
|
|
|
}
|
|
|
else if (DemoLineConstant.DEMOLINE_OP05_04.equals(taskNode.getNodeNo())) {
|
|
|
//执行三坐标测量
|
|
@@ -965,22 +873,8 @@ public class TaskWorkNode {
|
|
|
//机器人放子盘夹具到上下料站(从机械手到上下料站)
|
|
|
//节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
|
|
|
//1、取出机器人
|
|
|
- Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR1 + taskNode.getId());
|
|
|
- //2、取出上下料站
|
|
|
- Storge sxlzstorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.SXLZ + taskNode.getId());
|
|
|
- map.put("zkIp", ZK_ip_zlzx);
|
|
|
- //3、把起始终点库位存放到map,用于接口
|
|
|
- map.put("fromStorge", jqrStorge);
|
|
|
- map.put("toStorge", sxlzstorge);
|
|
|
- map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
|
|
|
- //出入库类型
|
|
|
- map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
- //目的地为机器人手臂
|
|
|
- map.put("Data", sxlzstorge);
|
|
|
- //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
|
|
|
- map.put("result", true);
|
|
|
- //4、记录机器人的库位,下一个步骤使用
|
|
|
- msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sxlzstorge, 1, TimeUnit.DAYS);
|
|
|
+ map.put("robotType", DemoLineConstant.JQR1);
|
|
|
+ map = nodeOperationService.checkCondition(taskNode,task,map);
|
|
|
}
|
|
|
break;
|
|
|
case "OP60":
|
|
@@ -994,23 +888,8 @@ public class TaskWorkNode {
|
|
|
//机器人放子盘夹具到上下料站(从机械手到上下料站)
|
|
|
//节点4的任务都在节点3被锁定过了,只要从缓存拿出来对应的值即可
|
|
|
//1、取出机器人
|
|
|
- Storge jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.JQR1 + taskNode.getId());
|
|
|
-// //重新锁定一下机器人的库位,更新一下被锁定的业务ID(由于搬运拆成两个节点)
|
|
|
-// storgeService.lockStorge(jqrStorge, taskNode.getId());
|
|
|
- //2、取出上下料站
|
|
|
- Storge xbkstorge = (Storge) msgUtil.redis_get(DemoCacheKey.DEMOLINE_CAMP + "_" + DemoLineConstant.XBK + taskNode.getId());
|
|
|
- map.put("zkIp", ZK_ip_zlzx);
|
|
|
- //3、把起始终点库位存放到map,用于接口
|
|
|
- map.put("fromStorge", jqrStorge);
|
|
|
- map.put("toStorge", xbkstorge);
|
|
|
- map.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_TRAY_CRK);
|
|
|
-
|
|
|
- map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "putMaterial");
|
|
|
- map.put("Data", xbkstorge);
|
|
|
- //这个节点没有需要验证的内容,都在前一个节点验证并且锁定了
|
|
|
- map.put("result", true);
|
|
|
- //4、记录机器人的库位,下一个步骤使用
|
|
|
-// msgUtil.redis_set(DemoCacheKey.DEMOLINE_CIRCULATION_STORAGE + "_" + task.getCompleteBatchNo(), sxlzstorge, 1, TimeUnit.DAYS);
|
|
|
+ map.put("robotType", DemoLineConstant.JQR1);
|
|
|
+ map = nodeOperationService.checkCondition(taskNode, task, dataMap);
|
|
|
}
|
|
|
else if (DemoLineConstant.DEMOLINE_OP06_04.equals(taskNode.getNodeNo())) {
|
|
|
//AGV
|