|
@@ -232,7 +232,7 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
|
|
|
Map locationMap = new HashMap();
|
|
|
locationMap.put("location", startStorge.getPointId()); //零件当前位置
|
|
|
- locationMap.put("destLocation", targetStorge.getPointId()); //机器人缓存位
|
|
|
+ locationMap.put("destLocation", targetStorge.getPointId()); //机器人目标位
|
|
|
|
|
|
TTask task = taskService.getById(taskNode.getTaskId());
|
|
|
OrderTask orderTask = orderTaskService.getOne(new LbqWrapper<OrderTask>().eq(OrderTask::getOrderId, task.getOrderId()).last("LIMIT 1"));
|
|
@@ -267,70 +267,26 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
ZZone zZone = (ZZone) robotInfo.get("zZone");
|
|
|
String zoneName = zZone.getName();
|
|
|
List<ProductionresourcePosition> xbkList = productionresourcePositionService.getFreeProductionresourcePositionByNos(DictionaryKey.YJ_ZONE_XBK.get(zoneName+"-tool").split(","));
|
|
|
-
|
|
|
+ if(orderTask.getIsXbk().equals(0)){
|
|
|
+ dataMap.put("result", false);
|
|
|
+ dataMap.put("resultMsg", "自定义订单不支持刀具线边库");
|
|
|
+ return dataMap;
|
|
|
+ }
|
|
|
Map returnMap = this.robotTarget(taskNode, orderTask, xbkList, bomProcedure, dataMap);
|
|
|
- return returnMap;
|
|
|
+ Long targetStorgeResourceId = !returnMap.containsKey("storeResourceId") ? null : Long.valueOf(returnMap.get("storeResourceId").toString());
|
|
|
+ if(null == targetStorgeResourceId || xbkList.size()==0){
|
|
|
+ dataMap.put("result", false);
|
|
|
+ dataMap.put("resultMsg", "刀具线边库条件不允许");
|
|
|
+ return dataMap;
|
|
|
+ }
|
|
|
+ Map putMap = this.robotPut(returnMap, taskNode, startStorge, endStorge, xbkList, "1", targetStorgeResourceId);
|
|
|
+ return putMap;
|
|
|
}
|
|
|
|
|
|
//获取目标地址
|
|
|
public Map robotTarget(TaskNode taskNode, OrderTask orderTask, List<ProductionresourcePosition> xbkList, BomProcedure bomProcedure, Map<String, Object> returnMap) {
|
|
|
List<ProductionresourcePosition> targetList = null;
|
|
|
Long targetResourceId = taskNode.getTargetResourceId();
|
|
|
-/*
|
|
|
- if(targetResourceId == null){
|
|
|
- //msgUtil.createWarnLog("刀具节点目标位数据为空","DataException");
|
|
|
- returnMap.put("resultMsg","刀具节点目标位数据为空");
|
|
|
- returnMap.put("result", false);
|
|
|
- return null;
|
|
|
- }
|
|
|
- targetList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[]{targetResourceId.toString()});
|
|
|
- if(CollectionUtil.isEmpty(targetList)){
|
|
|
- //msgUtil.createWarnLog("刀具节点目标位被占用","DataException");
|
|
|
- returnMap.put("resultMsg","刀具节点目标位被占用");
|
|
|
- returnMap.put("result", false);
|
|
|
- return null;
|
|
|
- }
|
|
|
- //按类型获取目标库位
|
|
|
- Storge targetStorge = null;
|
|
|
- if(StringUtil.isNotEmpty(orderTask.getGoal())){
|
|
|
- String pointId = orderTask.getGoal().replace("CT_", "");
|
|
|
- List<ProductionresourcePosition> positionList = targetList.stream().filter(item->item.getPointId().equals(pointId)).collect(Collectors.toList());
|
|
|
- targetStorge = storgeService.getById(positionList.get(0).getStorgeId());
|
|
|
- }else{
|
|
|
- targetStorge = storgeService.getById(targetList.get(0).getStorgeId());
|
|
|
- }
|
|
|
- //CCS判断目标位点位是否允许放置判断
|
|
|
- boolean bool = true;
|
|
|
- String pointId = targetStorge.getPointId();
|
|
|
- if(pointId.contains(DemoLineConstant.DEMOLINE_CUT_TOOL_TYPE_CNCT)){
|
|
|
- //从机床刀具库放需要预置处理
|
|
|
- Object cutToolAction = msgUtil.redis_get(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION);
|
|
|
- if(ObjectUtil.isEmpty(cutToolAction)){
|
|
|
- this.CNCTActionHandle(taskNode, true, pointId, orderTask);
|
|
|
- msgUtil.redis_set(DemoLineConstant.DEMOLINE_CUT_DEVICE_ACTION, taskNode.getId().toString(),10, TimeUnit.MINUTES);
|
|
|
-
|
|
|
- returnMap.put("resultMsg","机床CNC状态转动指令已下发");
|
|
|
- returnMap.put("result", false);
|
|
|
- return null;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //todo 与ccs联调需要释放 $需要换地址$
|
|
|
- String resultMsg = null;
|
|
|
- if(imcsTOccsEnable){
|
|
|
- String resultData = this.cutToolActionCondition("/api/getCutterDeviceIsPut", taskNode, pointId);
|
|
|
- JSONObject resultObj = JSONObject.parseObject(resultData);
|
|
|
- resultMsg = resultObj.getString("resultMsg");
|
|
|
- bool = resultObj.getBoolean("result");
|
|
|
- }
|
|
|
-
|
|
|
- if(!bool){
|
|
|
-// msgUtil.createWarnLog("刀具节点目标位放置条件不满足","DataException");
|
|
|
- returnMap.put("resultMsg",resultMsg ==null? "刀具节点目标位放置条件不满足": resultMsg);
|
|
|
- returnMap.put("result", false);
|
|
|
- return null;
|
|
|
-
|
|
|
- */
|
|
|
String xbkFlag = "";
|
|
|
Storge startStorge = null;
|
|
|
Storge targetStorge = null;
|
|
@@ -380,7 +336,9 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if ("1".equals(xbkFlag)) {
|
|
|
+
|
|
|
+ //天轨机器人目标去刀具上下料站 可以激活刀架线边库模式
|
|
|
+ if ("1".equals(xbkFlag) && orderTask.getIsXbk().equals("1")) {
|
|
|
ProductionresourcePosition position = xbkList.get(0);
|
|
|
targetStorge = storgeService.getById(position.getStorgeId());
|
|
|
returnMap.put("storeResourceId", position.getResourceId());
|