|
@@ -113,15 +113,14 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
dataMap.put(taskNode.getId().toString() + "count", 0);
|
|
|
dataMap.put(YunjianConstant.YUNJIAN_ROBORT_CACHE_FLAG, "0");
|
|
|
Storge startStore = null;
|
|
|
- TTask task = taskService.getById(taskNode.getTaskId());
|
|
|
OrderTask orderTask = (OrderTask) robotInfo.get("orderTask");
|
|
|
if (CollectionUtil.isNotEmpty(flikustockInfos)) {
|
|
|
//刀具线边库查询
|
|
|
startStore = storgeService.getById(flikustockInfos.get(0).getStorgeId());
|
|
|
}else {
|
|
|
- //硬件设备库位
|
|
|
- List<ProductionresourcePosition> storgeList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[]{task.getResourceId().toString()});
|
|
|
- startStore = storgeService.getById(storgeList.get(0).getStorgeId());
|
|
|
+ //List<ProductionresourcePosition> storgeList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[]{task.getResourceId().toString()});
|
|
|
+ String pointId = orderTask.getStart().replace("CT_", "");
|
|
|
+ startStore = storgeService.getOne(new LbqWrapper<Storge>().eq(Storge::getPointId, pointId).last("LIMIT 1"));
|
|
|
}
|
|
|
//CCS判断取条件是否满足
|
|
|
boolean bool = true;
|
|
@@ -133,7 +132,7 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
}
|
|
|
|
|
|
//处理目标库位
|
|
|
- returnMap = this.robotTarget(taskNode, robotInfo, null, bomProcedure,returnMap);
|
|
|
+ returnMap = this.robotTarget(taskNode, orderTask.getGoal(), null, bomProcedure,returnMap);
|
|
|
|
|
|
Storge targetStorge = !returnMap.containsKey("store") ? null : (Storge) returnMap.get("store");
|
|
|
Long targetStorgeResourceId = !returnMap.containsKey("storeResourceId") ? null : Long.valueOf(returnMap.get("storeResourceId").toString());
|
|
@@ -207,7 +206,7 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
}
|
|
|
|
|
|
//获取目标地址
|
|
|
- public Map robotTarget(TaskNode taskNode, Map robotInfo, List<ProductionresourcePosition> xbkList, BomProcedure bomProcedure, Map<String, Object> returnMap) {
|
|
|
+ public Map robotTarget(TaskNode taskNode, String goal, List<ProductionresourcePosition> xbkList, BomProcedure bomProcedure, Map<String, Object> returnMap) {
|
|
|
List<ProductionresourcePosition> targetList = null;
|
|
|
Long targetResourceId = taskNode.getTargetResourceId();
|
|
|
if(targetResourceId == null){
|
|
@@ -225,8 +224,16 @@ public class ToolRobotStrategy implements RobotStrategy {
|
|
|
msgUtil.createWarnLog("刀具节点目标位放置条件不满足","DataException");
|
|
|
return null;
|
|
|
}
|
|
|
- Storge targetStorge = storgeService.getById(targetList.get(0).getStorgeId());
|
|
|
- returnMap.put("storeResourceId", targetList.get(0).getResourceId());
|
|
|
+ //按类型获取目标库位
|
|
|
+ Storge targetStorge = null;
|
|
|
+ if(StringUtil.isNotEmpty(goal)){
|
|
|
+ List<ProductionresourcePosition> poistionList = targetList.stream().filter(item->item.getPointId().equals(goal)).collect(Collectors.toList());
|
|
|
+ targetStorge = storgeService.getById(poistionList.get(0).getStorgeId());
|
|
|
+ }else{
|
|
|
+ targetStorge = storgeService.getById(targetList.get(0).getStorgeId());
|
|
|
+ }
|
|
|
+
|
|
|
+ returnMap.put("storeResourceId", targetResourceId);
|
|
|
returnMap.put("store", targetStorge);
|
|
|
returnMap.put("targetxbk", "0");
|
|
|
|