移库错误修复

This commit is contained in:
陆一凡 2025-03-18 12:57:15 +08:00
parent 3d1f0ec758
commit 1760bfd1f4
2 changed files with 14 additions and 12 deletions

View File

@ -258,6 +258,7 @@ public class JobComponent extends BaseController {
logger.info("没有可移动库位,移动库位存在任务");
return; // 没有可用库位或者m库位存在干涉
}
logger.info("查找到可用移动库位{},原库位{}", emptyLocationItem.getLocationId(),beforLocation.getLocationId());
// 锁定旧库位库存
stockMapper.updateStockStatusWithLocationId(beforLocation.getLocationId(), StockStatus.LOCK.getCode());
@ -385,19 +386,20 @@ public class JobComponent extends BaseController {
}
if (desDeepLocations.isEmpty()) {
logger.info("后一个库位信息为空");
return;
}
Location desDeepLocation = desDeepLocations.get(0); // 前一个库位
List<Task> desNotCompleteTasks = taskMapper.haveNotCompleteTask(desDeepLocation.getLocationId());
if (desNotCompleteTasks == null) {
logger.info("查询任务异常");
return;
}
if (!desNotCompleteTasks.isEmpty()) {
logger.info("发送移库任务时目标库位,高深度存在未完成的任务,退出函数");
return;
}else {
Location desDeepLocation = desDeepLocations.get(0); // 前一个库位
List<Task> desNotCompleteTasks = taskMapper.haveNotCompleteTask(desDeepLocation.getLocationId());
if (desNotCompleteTasks == null) {
logger.info("查询任务异常");
return;
}
if (!desNotCompleteTasks.isEmpty()) {
logger.info("发送移库任务时目标库位,高深度存在未完成的任务,退出函数");
return;
}
}
/* 检查该库位前一个深度是否存在库存,若存在库存则生成一个移库任务,此任务暂不下发 */
List<Location> thisLocations = locationService.selLocations(new Location(task.getOrigin()));
if(thisLocations == null) {

View File

@ -133,7 +133,7 @@ public class OrderOutImplements implements IOrderOutService {
outTasks.add(task);
}
// 把这条库存记录可用数量更新为 0
// stockMapper.updateStockAvailableNumWithStockId(outStock.getStockId(), outStock.getAvailableNum()-outNum);
stockMapper.updateStockAvailableNumWithStockId(outStock.getStockId(), outStock.getAvailableNum()-outNum);
// 更新库存为出库中
stockMapper.updateStockStatusWithLocationId(outStock.getLocationId(), StockStatus.OUT.getCode());
// 重新计算需求数量