WMS/sql/02_agv_locationzone_floor.sql
sunwang c76e7bb681 fix:永丰售后修复BUG,
1,物料库存获取不到ERP:重新调整触发查询逻辑
2,工序变更导致物料无法出库:配置旧工序
3,测试出库订单ERP推送,任务下发
2026-10-29 13:12:11 +08:00

32 lines
1.2 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- =============================================================
-- AGV 平库对接 · 02 LocationZone 新增楼层字段
-- 依据:《平库AGV方案流程(AGV自调度版).md》5.3 / 10.2
-- 说明:
-- 1) Floor 用于 AGV 任务 FromFloor/ToFloor 取值与跨楼层方向校验;
-- 2) 若采用 Location.Floor 替代方案,则改为在 Location 上加列;
-- 3) 方案乙(AGV 自判楼层)确认后本脚本可废弃(见 15.7);
-- 4) 脚本可重复执行。
-- =============================================================
-- 新增楼层字段
SET @col_exists = (
SELECT COUNT(1)
FROM information_schema.COLUMNS
WHERE TABLE_SCHEMA = DATABASE()
AND TABLE_NAME = 'LocationZone'
AND COLUMN_NAME = 'Floor'
);
SET @ddl = IF(
@col_exists = 0,
'ALTER TABLE LocationZone ADD COLUMN Floor INT NULL COMMENT ''库区所在楼层''',
'SELECT 1'
);
PREPARE stmt FROM @ddl;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
-- 提示:现场需按实际楼层为各库区补充 Floor 值(示例,请按现场调整)
-- UPDATE LocationZone SET Floor = 1 WHERE ZoneCode = 'CP'; -- 成品库
-- UPDATE LocationZone SET Floor = 1 WHERE ZoneCode = 'XB'; -- 线边库