no message

main
HUOJIN\92525 2026-02-05 14:03:06 +08:00
parent 353ca68ab5
commit 34f54a830b
3 changed files with 46 additions and 1 deletions

View File

@ -748,6 +748,11 @@ public class ScanTrayProcessor {
pointService.bindPoint(toPoint); pointService.bindPoint(toPoint);
inv.setStatus(InventoryStatusEnum.MOVE.getValue()); inv.setStatus(InventoryStatusEnum.MOVE.getValue());
processedStock.add(inv.getStockId()); processedStock.add(inv.getStockId());
//移位的库位是否需要移位
List<Point> movePointsForInbound = getMovePointsForInbound(toPoint);
if (CollectionUtils.isNotEmpty(movePointsForInbound)) {
buildMoveTask(movePointsForInbound);
}
log.info("生成移位任务:{}- 容器:{} - 库位:{} - 库存数量:{}", taskNo, stock.getStockCode(), fromPoint.getPointCode(), inv.getQuantity()); log.info("生成移位任务:{}- 容器:{} - 库位:{} - 库存数量:{}", taskNo, stock.getStockCode(), fromPoint.getPointCode(), inv.getQuantity());
} catch (Exception e) { } catch (Exception e) {
throw e; throw e;

View File

@ -32,6 +32,6 @@
JOIN data_pick_detail pd ON pd.pick_id=p.id JOIN data_pick_detail pd ON pd.pick_id=p.id
WHERE p.`status` in (1,2,4) WHERE p.`status` in (1,2,4)
AND pd.order_qty-pd.allocated_qty>0 AND pd.order_qty-pd.allocated_qty>0
ORDER BY p.create_time,pd.create_time ORDER BY p.id,pd.id
</select> </select>
</mapper> </mapper>

View File

@ -994,6 +994,11 @@ public class AllocateProcessor {
pointService.bindPoint(toPoint); pointService.bindPoint(toPoint);
inv.setStatus(InventoryStatusEnum.MOVE.getValue()); inv.setStatus(InventoryStatusEnum.MOVE.getValue());
processedStock.add(inv.getStockId()); processedStock.add(inv.getStockId());
//移位的库位是否需要移位
List<Point> movePointsForInbound = getMovePointsForOutbound(toPoint);
if (CollectionUtils.isNotEmpty(movePointsForInbound)) {
buildMoveTask(toPoint.getPointCode(),movePointsForInbound,processedStock);
}
log.info("生成移位任务:{}- 容器:{} - 库位:{} - 库存数量:{}", taskNo, stock.getStockCode(), fromPoint.getPointCode(), inv.getQuantity()); log.info("生成移位任务:{}- 容器:{} - 库位:{} - 库存数量:{}", taskNo, stock.getStockCode(), fromPoint.getPointCode(), inv.getQuantity());
} catch (Exception e) { } catch (Exception e) {
throw e; throw e;
@ -1005,6 +1010,41 @@ public class AllocateProcessor {
return moveList; return moveList;
} }
/**
*
*
* @param currPoint
* @return
*/
private List<Point> getMovePointsForOutbound(Point currPoint) {
// 移位库位
List<Point> movePoints = new ArrayList<>();
//当前巷道的库位数
List<Point> points = pointMapper.findByColAndLayer(currPoint.getColNum(), currPoint.getLayerNum());
// 目标库位的深度位转换为索引
int targetIndex = Integer.parseInt(currPoint.getRowNum()) - 1;
//双通道
if (currPoint.getIzDoubleLane().equals(1)) {
// 计算左侧占用数
List<Point> leftPoints = calculateUsedPoints(points, 0, targetIndex);
// 计算右侧占用数
List<Point> rightPoints = calculateUsedPoints(points, targetIndex + 1, points.size());
//取两个集合中,元素最少的那个集合
movePoints = leftPoints.size() < rightPoints.size() ? leftPoints : rightPoints;
} else {
movePoints = calculateUsedPoints(points, 0, targetIndex);
}
return movePoints;
}
/** /**
* *
* *