|
@@ -466,20 +466,20 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
if(null != targetStorge){
|
|
|
|
|
|
//优先级判断
|
|
|
- Object priorityTaskNodeIdObj = msgUtil.redis_get("PRIORITY_PROCESSING");
|
|
|
+ /*Object priorityTaskNodeIdObj = msgUtil.redis_get("PRIORITY_PROCESSING");
|
|
|
if(!Objects.isNull(priorityTaskNodeIdObj) && StringUtil.isNotEmpty(priorityTaskNodeIdObj.toString())){
|
|
|
String priorityTaskNodeId = priorityTaskNodeIdObj.toString();
|
|
|
if(!priorityTaskNodeId.equals(taskNode.getId())){
|
|
|
throw new InterruptedException("存在优先任务:"+priorityTaskNodeId+",当前消息重新进入队尾");
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
String targetxbk = returnMap.get("targetxbk")==null?null:(String)returnMap.get("targetxbk");
|
|
|
jqrStorge = storgeService.getById(jqrMap.get(DemoLineConstant.DEMOLINE_RJQR_ZS).get(0).getStorgeId());
|
|
|
jqrStorge.setCompleteBatchNo(task.getCompleteBatchNo());
|
|
|
storgeService.lockStorge(jqrStorge, nextTaskNode.getId());
|
|
|
//锁定一个缓存位
|
|
|
- List<ProductionresourcePosition> hcwList = jqrMap.get(jqrMap.keySet().stream().filter(p -> !DemoLineConstant.DEMOLINE_RJQR_ZS.equals(p)).findFirst().get());
|
|
|
+ List<ProductionresourcePosition> hcwList = jqrMap.get(jqrMap.keySet().stream().filter(p -> !DemoLineConstant.DEMOLINE_RJQR_ZS.equals(p) && !DemoLineConstant.DEMOLINE_RJQR_SIX.equals(p)).findFirst().get());
|
|
|
Storge hcwStorge = storgeService.getById(hcwList.get(0).getStorgeId());
|
|
|
hcwStorge.setCompleteBatchNo(task.getCompleteBatchNo());
|
|
|
storgeService.lockStorge(hcwStorge, nextTaskNode.getId());
|
|
@@ -511,17 +511,26 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
//目标是线边库
|
|
|
msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_XBK_FLAG + taskNode.getId(), targetxbk, 10, TimeUnit.DAYS);
|
|
|
msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_XBK_FLAG + nextTaskNode.getId(), targetxbk, 10, TimeUnit.DAYS);
|
|
|
- dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("MOVE")); //移动类型
|
|
|
+ dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("CARRY")); //移动类型
|
|
|
+
|
|
|
+ if(taskNode.getNodeName().indexOf("从立库取") > -1){
|
|
|
+ dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_TRAY_CRK);
|
|
|
+ }else{
|
|
|
+ dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
+ }
|
|
|
|
|
|
- Object startPoint = msgUtil.redis_get("jqr_postion");
|
|
|
+ //Object startPoint = msgUtil.redis_get("jqr_postion");
|
|
|
//满足条件--机器人空闲,设备或线边库有一个空闲
|
|
|
Map locationMap = new HashMap();
|
|
|
- locationMap.put("location",startPoint); //机器人当前位置
|
|
|
- locationMap.put("destLocation",startStore.getPointId()); //零件当前位置-》机器人目标位置
|
|
|
+ locationMap.put("location",startStore.getPointId()); //零件当前位置
|
|
|
+ locationMap.put("destLocation",hcwStorge.getPointId()); //机器人缓存位
|
|
|
+ locationMap.put("taskType",DictionaryKey.TASK_TYPE.get("CARRY"));
|
|
|
+ locationMap.put("carryType","1");
|
|
|
dataMap.put("data", locationMap);
|
|
|
- dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("MOVE"));
|
|
|
- dataMap.put("method", "MoveRobotPosition");
|
|
|
+ dataMap.put("method", "RobotAction");
|
|
|
dataMap.put("result", true);
|
|
|
+ dataMap.put("fromStorge", startStore);
|
|
|
+ dataMap.put("toStorge", hcwStorge);
|
|
|
|
|
|
// 机器人移动到redis记录实时位子
|
|
|
msgUtil.redis_set(taskNode.getResourceId()+"postion",startStore.getPointId());
|
|
@@ -545,23 +554,23 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
Map locationMap = new HashMap();
|
|
|
locationMap.put("location",startStore.getPointId());
|
|
|
locationMap.put("destLocation",jqrStorge.getPointId());
|
|
|
+ locationMap.put("taskType", DictionaryKey.TASK_TYPE.get("CARRY")); //运输类型
|
|
|
+ locationMap.put("carryType","1");
|
|
|
dataMap.put("data", locationMap);
|
|
|
//出入库类型
|
|
|
dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
//目的地为机器人手臂
|
|
|
dataMap.put("toStorge", jqrStorge);
|
|
|
dataMap.put("result", true);
|
|
|
- dataMap.put("carryType","");
|
|
|
- dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("CARRY")); //运输类型
|
|
|
- }else if(count == 2){
|
|
|
+ }else if(count == 3){
|
|
|
//读RFID
|
|
|
- dataMap.put("method", "readAndWrite");
|
|
|
+ dataMap.put("method", "ReadRFID");
|
|
|
dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("READ_WRITE")); //读取RFID
|
|
|
dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.RFID_READ);
|
|
|
dataMap.put("result", true);
|
|
|
- }else if(count == 3){
|
|
|
+ }else if(count == 2){
|
|
|
//写RFID
|
|
|
- dataMap.put("method", "readAndWrite");
|
|
|
+ dataMap.put("method", "WriteRFID");
|
|
|
dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("READ_WRITE")); //读取RFID
|
|
|
dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.RFID_WRITE);
|
|
|
dataMap.put("result", true);
|
|
@@ -577,14 +586,13 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
Map locationMap = new HashMap();
|
|
|
locationMap.put("location",startStore.getPointId());
|
|
|
locationMap.put("destLocation",hcwStorge.getPointId());
|
|
|
+ locationMap.put("carryType","1");
|
|
|
+ locationMap.put("taskType", DictionaryKey.TASK_TYPE.get("CARRY")); //运输类型
|
|
|
dataMap.put("data", locationMap);
|
|
|
|
|
|
dataMap.put("toStorge", hcwStorge);
|
|
|
dataMap.put("result", true);
|
|
|
|
|
|
- dataMap.put("carryType","");
|
|
|
- dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("CARRY")); //运输类型
|
|
|
-
|
|
|
}
|
|
|
}else if (BizConstant.ROBOT_TYPE_NOCACHE.equals(zoneService.getRobotTypebyZone(zoneName))) {
|
|
|
BomProcedure procedure = bomProcedureService.getById(task.getProcedureId());
|
|
@@ -794,17 +802,26 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
//当前零件满足锁定节点的零件一致允许移动
|
|
|
if(storageCount>0) {
|
|
|
|
|
|
- Object startPoint = msgUtil.redis_get("jqr_postion");
|
|
|
+ //Object startPoint = msgUtil.redis_get("jqr_postion");
|
|
|
+ TaskNode beforeTaskNode = taskNodeService.getNextNTaskNode(taskNode, -1);
|
|
|
+ if(beforeTaskNode.getNodeName().indexOf("从立库取") > -1){
|
|
|
+ dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_TRAY_CRK);
|
|
|
+ }else{
|
|
|
+ dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
+ }
|
|
|
|
|
|
Map locationMap = new HashMap();
|
|
|
- locationMap.put("location",startPoint); //机器人当前位置
|
|
|
+ locationMap.put("location",startStore.getPointId()); //机器人当前位置
|
|
|
locationMap.put("destLocation", targetStorge.getPointId());
|
|
|
+ locationMap.put("taskType",DictionaryKey.TASK_TYPE.get("CARRY"));
|
|
|
+ locationMap.put("carryType","1");
|
|
|
dataMap.put("data", locationMap);
|
|
|
|
|
|
dataMap.put("method", "MoveRobotPosition");
|
|
|
- dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("MOVE"));
|
|
|
dataMap.put("result", true);
|
|
|
|
|
|
+ dataMap.put("fromStorge", startStore);
|
|
|
+ dataMap.put("toStorge", targetStorge);
|
|
|
// 机器人移动到redis记录实时位子
|
|
|
msgUtil.redis_set(taskNode.getResourceId()+"postion",targetStorge.getPointId());
|
|
|
msgUtil.redis_set("jqr_postion",targetStorge.getPointId());
|
|
@@ -1333,12 +1350,12 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
returnMap.put("store",targetStorge);
|
|
|
returnMap.put("targetxbk","0");
|
|
|
|
|
|
- if("1".equals(bomzZone.getRunMode())){//自动模式下,
|
|
|
+ /*if("1".equals(bomzZone.getRunMode())){//自动模式下,
|
|
|
TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode,1);
|
|
|
if("04".equals(nextTaskNode.getInterfaceType())){//上料、下料、翻面
|
|
|
xbkFlag = "1";
|
|
|
}
|
|
|
- }
|
|
|
+ }*/
|
|
|
}else{//需要放到线边库
|
|
|
|
|
|
TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode,1);
|
|
@@ -1432,7 +1449,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
|
|
|
List<BomProcedureTray>trayList = procedureTrayService.list(Wraps.<BomProcedureTray>lbQ().eq(BomProcedureTray::getProcedureId, task.getProcedureId()).orderByAsc(BomProcedureTray::getBizType));
|
|
|
List<Long>trayIdList = trayList.stream().map(t->t.getTrayId()).collect(Collectors.toList());
|
|
|
- // 判断夹具是否有可用的,查询330个库位信息中是否还有夹具
|
|
|
+ // 判断夹具是否有可用的,查询线边库位信息中是否还有夹具
|
|
|
List<StockInfo> allStockInfos = stockInfoMapper.selectList(Wraps.<StockInfo>lbQ().in(StockInfo::getGoodsId,trayIdList).in(StockInfo::getStorgeId,startProductionresourcePositionIds).eq(StockInfo::getLockStatus, "1").orderByAsc(StockInfo::getGoodsType));
|
|
|
|
|
|
MToolClamp clamp = toolClampService.getById(trayIdList.get(1));
|