no message
parent
353ca68ab5
commit
34f54a830b
|
|
@ -748,6 +748,11 @@ public class ScanTrayProcessor {
|
|||
pointService.bindPoint(toPoint);
|
||||
inv.setStatus(InventoryStatusEnum.MOVE.getValue());
|
||||
processedStock.add(inv.getStockId());
|
||||
//移位的库位是否需要移位
|
||||
List<Point> movePointsForInbound = getMovePointsForInbound(toPoint);
|
||||
if (CollectionUtils.isNotEmpty(movePointsForInbound)) {
|
||||
buildMoveTask(movePointsForInbound);
|
||||
}
|
||||
log.info("生成移位任务:{}- 容器:{} - 库位:{} - 库存数量:{}", taskNo, stock.getStockCode(), fromPoint.getPointCode(), inv.getQuantity());
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,6 @@
|
|||
JOIN data_pick_detail pd ON pd.pick_id=p.id
|
||||
WHERE p.`status` in (1,2,4)
|
||||
AND pd.order_qty-pd.allocated_qty>0
|
||||
ORDER BY p.create_time,pd.create_time
|
||||
ORDER BY p.id,pd.id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
|||
|
|
@ -994,6 +994,11 @@ public class AllocateProcessor {
|
|||
pointService.bindPoint(toPoint);
|
||||
inv.setStatus(InventoryStatusEnum.MOVE.getValue());
|
||||
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());
|
||||
} catch (Exception e) {
|
||||
throw e;
|
||||
|
|
@ -1005,6 +1010,41 @@ public class AllocateProcessor {
|
|||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 智能分配移位库位
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue