移库逻辑修改

This commit is contained in:
陆一凡 2025-03-26 12:21:08 +08:00
parent 9b3f8e27db
commit b4cb27e7af
2 changed files with 13 additions and 8 deletions

View File

@ -100,7 +100,7 @@ public class JobComponent extends BaseController {
}
if(task.getTaskType().equals(TaskType.MOVE.getCode())){
sendTasksMoveToWcs(task);
return;
// return;
}
}
}catch (Exception exception){
@ -352,6 +352,7 @@ public class JobComponent extends BaseController {
*/
@Transactional(isolation = Isolation.REPEATABLE_READ, propagation = Propagation.REQUIRED)
public void sendTasksMoveToWcs(Task task){
// 目标库位
List<Location> desLocations = locationService.selLocations(new Location(task.getDestination()));
if(desLocations == null) {
logger.info("下发移库任务查询库位详细信息失败,数据库网络连接异常");
@ -385,16 +386,20 @@ public class JobComponent extends BaseController {
if (desDeepLocations.isEmpty()) {
logger.info("后一个库位信息为空");
}else {
Location desDeepLocation = desDeepLocations.get(0); // 一个库位
Location desDeepLocation = desDeepLocations.get(0); // 移动目标库位后一个库位
List<Task> desNotCompleteTasks = taskMapper.haveNotCompleteTask(desDeepLocation.getLocationId());
if (desNotCompleteTasks == null) {
logger.info("查询任务异常");
return;
}
if (!desNotCompleteTasks.isEmpty()) {
// for (Task desNotCompleteTask : desNotCompleteTasks) {&& desNotCompleteTask.getTaskType() != 9
if (!desNotCompleteTasks.isEmpty() ) {
logger.info("发送移库任务时目标库位,高深度存在未完成的任务,退出函数");
return;
}
// }
}

View File

@ -158,8 +158,8 @@ public class LocationUtils {
boolean canUse = true;
for (Location location : canUseLocations) {
/* 校验此位置是否有遮挡 */ /* 如果这位置有库存(可能出现记错导致有库存),或者这位置其他深度(不论深度大小)有任务则不采用此位置 */
// 如果在同一排上则不采用
if (location.getQueue().equals(thisLocation.getQueue())) {
// 如果在同一排 同巷道上则不采用
if (location.getQueue().equals(thisLocation.getQueue()) && location.getTunnelId().equals(thisLocation.getTunnelId())) {
continue;
}
/* 1 判断库存 */