|
@@ -166,7 +166,7 @@ public class CacheRobotStrategy implements RobotStrategy {
|
|
|
String targetXbk = !returnMap.containsKey("targetxbk") ? null : returnMap.get("targetxbk").toString();
|
|
|
|
|
|
//处理机器人库位
|
|
|
- List<ProductionresourcePosition> robotList = productionresourcePositionService.list(Wraps.<ProductionresourcePosition>lbQ().eq(ProductionresourcePosition::getResourceId, taskNode.getResourceId()));
|
|
|
+ List<ProductionresourcePosition> robotList = productionresourcePositionService.getFreeProductionresourcePositionByIds(new String[]{taskNode.getResourceId().toString()});
|
|
|
Map putMap = this.robotPut(returnMap, taskNode, startStore, targetStorge, robotList, targetXbk, targetStorgeResourceId);
|
|
|
return putMap;
|
|
|
}
|
|
@@ -175,8 +175,6 @@ public class CacheRobotStrategy implements RobotStrategy {
|
|
|
public Map robotPut(Map returnMap, TaskNode taskNode, Storge startStorge, Storge targetStorge, List<ProductionresourcePosition> robotList, String targetXbk, Long targetStorgeResourceId) {
|
|
|
|
|
|
Map<String, List<ProductionresourcePosition>> jqrMap = robotList.stream().collect(Collectors.groupingBy(ProductionresourcePosition::getPointId));
|
|
|
- //Storge jqrStorge = storgeService.getById(jqrMap.get(DemoLineConstant.DEMOLINE_RJQR_ZS).get(0).getStorgeId());
|
|
|
- //TaskNode nextTaskNode = taskNodeService.getNextNTaskNode(taskNode,1);
|
|
|
|
|
|
//锁定机器人抓手
|
|
|
Storge jqrStorge = null;
|
|
@@ -224,11 +222,11 @@ public class CacheRobotStrategy implements RobotStrategy {
|
|
|
}
|
|
|
}
|
|
|
//锁定暂存缓存位库位
|
|
|
-
|
|
|
startStorge.setCompleteBatchNo(taskNode.getCompleteBatchNo());
|
|
|
storgeService.lockStorge(startStorge, taskNode.getId());
|
|
|
- //判断暂存库位作为库位起始位
|
|
|
- List<ProductionresourcePosition> hcwFilter = hcwList.stream().filter(p -> p.getPointId().equals(startStorge.getPointId())).collect(Collectors.toList());
|
|
|
+ //暂存库位作为库位起始位不需重复锁定暂存位
|
|
|
+ ProductionresourcePosition startPosition = productionresourcePositionService.getOne(new LbqWrapper<ProductionresourcePosition>().eq(ProductionresourcePosition::getStorgeId, startStorge.getId()).last("limit 1"));
|
|
|
+ List<ProductionresourcePosition> hcwFilter = hcwList.stream().filter(p -> p.getResourceId().equals(startPosition.getResourceId())).collect(Collectors.toList());
|
|
|
Storge hcwStorge = null;
|
|
|
if(hcwFilter.size() == 0) {
|
|
|
hcwStorge = storgeService.getById(hcwList.get(0).getStorgeId());
|
|
@@ -247,11 +245,7 @@ public class CacheRobotStrategy implements RobotStrategy {
|
|
|
returnMap.put(YunjianConstant.YUNJIAN_HCW_XBKFLAG, "1");
|
|
|
msgUtil.redis_set(DemoCacheKey.YUNJIAN_CAMP + "_" + DemoLineConstant.YUNJIAN_TARGET_STORE + taskNode.getId(), targetStorge, 10, TimeUnit.DAYS);
|
|
|
} else {
|
|
|
- //锁定目标线边库库位
|
|
|
- targetStorge.setCompleteBatchNo(taskNode.getCompleteBatchNo());
|
|
|
- storgeService.lockStorge(targetStorge, taskNode.getId());
|
|
|
-
|
|
|
-
|
|
|
+ //暂存位优先级处理判断
|
|
|
|
|
|
if (targetXbk.equals("0")) {
|
|
|
//目标缓存
|
|
@@ -262,6 +256,9 @@ public class CacheRobotStrategy implements RobotStrategy {
|
|
|
returnMap.put(YunjianConstant.YUNJIAN_XBKFLAG, "1");
|
|
|
returnMap.remove(taskNode.getId().toString()+"count");
|
|
|
}
|
|
|
+ //锁定目标线边库库位
|
|
|
+ targetStorge.setCompleteBatchNo(taskNode.getCompleteBatchNo());
|
|
|
+ storgeService.lockStorge(targetStorge, taskNode.getId());
|
|
|
}
|
|
|
// 放入线边库或机器人缓存位
|
|
|
log.info("节点{}提前占用机器人抓手{},缓存位{},目标库位{}", taskNode.getId(), jqrStorge.getPointId(), hcwStorge.getPointId(), targetStorge.getPointId());
|