|
|
@@ -513,9 +513,11 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
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")); //移动类型
|
|
|
|
|
|
+ Object startPoint = msgUtil.redis_get("jqr_postion");
|
|
|
//满足条件--机器人空闲,设备或线边库有一个空闲
|
|
|
Map locationMap = new HashMap();
|
|
|
- locationMap.put("location",startStore.getPointId());
|
|
|
+ locationMap.put("location",startPoint); //机器人当前位置
|
|
|
+ locationMap.put("destLocation",startStore.getPointId()); //零件当前位置-》机器人目标位置
|
|
|
dataMap.put("data", locationMap);
|
|
|
dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("MOVE"));
|
|
|
dataMap.put("method", "MoveRobotPosition");
|
|
|
@@ -523,7 +525,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
|
|
|
// 机器人移动到redis记录实时位子
|
|
|
msgUtil.redis_set(taskNode.getResourceId()+"postion",startStore.getPointId());
|
|
|
-
|
|
|
+ msgUtil.redis_set("jqr_postion",startStore.getPointId());
|
|
|
}else{
|
|
|
dataMap.put("result", false);
|
|
|
}
|
|
|
@@ -537,11 +539,11 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
} else if (count == 1) {
|
|
|
jqrStorge = (Storge) msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
|
|
|
dataMap.put("method", "GetQualityCenter");
|
|
|
- Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
|
|
|
- dataMap.put("fromStorge", currentStore);
|
|
|
+ //Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
|
|
|
+ dataMap.put("fromStorge", startStore);
|
|
|
|
|
|
Map locationMap = new HashMap();
|
|
|
- locationMap.put("location",currentStore.getPointId());
|
|
|
+ locationMap.put("location",startStore.getPointId());
|
|
|
locationMap.put("destLocation",jqrStorge.getPointId());
|
|
|
dataMap.put("data", locationMap);
|
|
|
//出入库类型
|
|
|
@@ -564,16 +566,17 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.RFID_WRITE);
|
|
|
dataMap.put("result", true);
|
|
|
}else if(count == 4) {
|
|
|
- Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
|
|
|
+ //Storge currentStore = workpieceService.getWorkPieceStock(taskNode.getCompleteBatchNo(), false);
|
|
|
dataMap.put("method", "SendQualityCenter");
|
|
|
- dataMap.put("fromStorge", currentStore);
|
|
|
+ dataMap.put("fromStorge", startStore);
|
|
|
//出入库类型
|
|
|
dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
//目的地为机器人手臂
|
|
|
Storge hcwStorge = (Storge) msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_HCW + taskNode.getId());
|
|
|
|
|
|
Map locationMap = new HashMap();
|
|
|
- locationMap.put("location",hcwStorge.getPointId());
|
|
|
+ locationMap.put("location",startStore.getPointId());
|
|
|
+ locationMap.put("destLocation",hcwStorge.getPointId());
|
|
|
dataMap.put("data", locationMap);
|
|
|
|
|
|
dataMap.put("toStorge", hcwStorge);
|
|
|
@@ -790,15 +793,21 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
int storageCount = storgeService.count(new LbqWrapper<Storge>().eq(Storge::getCompleteBatchNo, taskNode.getCompleteBatchNo()).eq(Storge::getCampId, taskNode.getId()).eq(Storge::getLockStatus, "0"));
|
|
|
//当前零件满足锁定节点的零件一致允许移动
|
|
|
if(storageCount>0) {
|
|
|
+
|
|
|
+ Object startPoint = msgUtil.redis_get("jqr_postion");
|
|
|
+
|
|
|
Map locationMap = new HashMap();
|
|
|
- locationMap.put("location", targetStorge.getPointId());
|
|
|
+ locationMap.put("location",startPoint); //机器人当前位置
|
|
|
+ locationMap.put("destLocation", targetStorge.getPointId());
|
|
|
dataMap.put("data", locationMap);
|
|
|
|
|
|
dataMap.put("method", "MoveRobotPosition");
|
|
|
+ dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("MOVE"));
|
|
|
dataMap.put("result", true);
|
|
|
|
|
|
// 机器人移动到redis记录实时位子
|
|
|
msgUtil.redis_set(taskNode.getResourceId()+"postion",targetStorge.getPointId());
|
|
|
+ msgUtil.redis_set("jqr_postion",targetStorge.getPointId());
|
|
|
}else{
|
|
|
log.warn("节点{}并发抢占框体机器人移动条件不满足", taskNode.getId());
|
|
|
dataMap.put("result", false);
|
|
|
@@ -820,29 +829,44 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
//}
|
|
|
}
|
|
|
|
|
|
- Map locationMap = new HashMap();
|
|
|
- locationMap.put("location",hcwStorge.getPointId());
|
|
|
- dataMap.put("data", locationMap);
|
|
|
-
|
|
|
dataMap.put("fromStorge", hcwStorge);
|
|
|
Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
|
|
|
dataMap.put("toStorge", handStorge);
|
|
|
+
|
|
|
+ Map locationMap = new HashMap();
|
|
|
+ locationMap.put("location",hcwStorge.getPointId()); //开始位置 -- 缓存位
|
|
|
+ locationMap.put("destLocation", handStorge.getPointId()); // 目的位置 -- 机器人手抓
|
|
|
+ dataMap.put("data", locationMap);
|
|
|
+
|
|
|
//出入库类型
|
|
|
+ dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("CARRY"));
|
|
|
+ dataMap.put("carryType",DictionaryKey.CARRY_TYPE.get("TRAY_ONE"));
|
|
|
dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
dataMap.put("result", true);
|
|
|
}else if(count == 2){
|
|
|
//读RFID
|
|
|
+ dataMap.put("method", "readAndWrite");
|
|
|
+ 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){
|
|
|
//写RFID
|
|
|
+ dataMap.put("method", "readAndWrite");
|
|
|
+ dataMap.put("taskType", DictionaryKey.TASK_TYPE.get("READ_WRITE")); //读取RFID
|
|
|
+ dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, DemoLineConstant.RFID_WRITE);
|
|
|
+ dataMap.put("result", true);
|
|
|
}else if(count == 4){
|
|
|
+ Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
|
|
|
+ dataMap.put("fromStorge", handStorge);
|
|
|
+
|
|
|
dataMap.put("method", "SendQualityCenter");
|
|
|
//出入库类型
|
|
|
dataMap.put(DemoLineConstant.DEMOLINE_STOCK_TYPE,DemoLineConstant.DEMOLINE_STOCK_TYPE_ALL_CRK);
|
|
|
|
|
|
Map locationMap = new HashMap();
|
|
|
|
|
|
- locationMap.put("location",targetStorge.getPointId());
|
|
|
-
|
|
|
+ locationMap.put("location",handStorge.getPointId()); //开始位置 -- 机器人手抓
|
|
|
+ locationMap.put("destLocation", targetStorge.getPointId()); // 目的位置
|
|
|
if(taskNode.getTargetResourceId() !=null){
|
|
|
Productionresource productionresource = productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,taskNode.getTargetResourceId()));
|
|
|
if(!Objects.isNull(productionresource) && StringUtil.isNotEmpty(productionresource.getModeSpecification()) && productionresource.getModeSpecification().contains("HELLER")){
|
|
|
@@ -866,14 +890,16 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
|
|
|
dataMap.put("toStorge", targetStorge);
|
|
|
|
|
|
- Storge handStorge = (Storge)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + YunjianConstant.YUNJIAN_JXS + taskNode.getId());
|
|
|
- dataMap.put("fromStorge", handStorge);
|
|
|
+
|
|
|
String targetxbk =(String)msgUtil.redis_get(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_XBK_FLAG + taskNode.getId());
|
|
|
if("1".equals(targetxbk)){
|
|
|
dataMap.put(YunjianConstant.YUNJIAN_XBKFLAG, YunjianConstant.YUNJIAN_XBKFLAG);
|
|
|
//把计数去掉,从线边库开始重新计数
|
|
|
dataMap.remove(taskNode.getId().toString()+"count");
|
|
|
}
|
|
|
+
|
|
|
+ dataMap.put("taskType",DictionaryKey.TASK_TYPE.get("CARRY"));
|
|
|
+ dataMap.put("carryType",DictionaryKey.CARRY_TYPE.get("TRAY_ONE"));
|
|
|
dataMap.put("result", true);
|
|
|
}
|
|
|
}
|
|
|
@@ -1241,7 +1267,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
//目标设备
|
|
|
if(resourceId!=null){
|
|
|
String zoneType = (null == msgUtil.redis_get(ParameterKey.PARAMETERS)? "": ((Map<String,String>)msgUtil.redis_get(ParameterKey.PARAMETERS)).get(ParameterKey.ZONE_TYPE).toString());
|
|
|
- if(zoneType.equals(ParameterKey.ZONE_YJ)){
|
|
|
+ if(!"从本序加工设备取".equals(taskNode.getNodeName()) && zoneType.equals(ParameterKey.ZONE_YJ)){
|
|
|
TTask task = tTaskMapper.selectById(taskNode.getTaskId());
|
|
|
BomProcedure procedure = bomProcedureService.getById(task.getProcedureId());
|
|
|
Productionresource productionresource = productionresourceBizMapper.selectOne(Wraps.<Productionresource>lbQ().eq(Productionresource::getId,resourceId));
|
|
|
@@ -1297,7 +1323,8 @@ public class RobotNodeServiceImpl implements NodeOperationService {
|
|
|
targetList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[] {resourceId.toString()});
|
|
|
}
|
|
|
}else{
|
|
|
- targetList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[] {resourceId.toString()});
|
|
|
+ //暂时先用具体类型标识(清洗类型)
|
|
|
+ targetList = productionresourcePositionService.getFreeProductionresourcePositionByIdsAndType(new String[] {resourceId.toString()},Long.parseLong("1496431321931579392"));
|
|
|
}
|
|
|
|
|
|
if(CollectionUtil.isNotEmpty(targetList)){
|