Files
klp-oa/script/sql/mysql/patch_wms_process_spec_dict.sql
王文昊 5a56094e4f refactor(dict): 优化字典数据查询逻辑和接口
- 移除不必要的 ISysDictTypeService 依赖,简化 SysDictDataController
- 新增 selectDictDataByTypeRealtime 方法,支持实时查询字典数据,避免缓存问题
- 更新 SysDictDataController 中的字典数据查询逻辑,使用新方法
- 在 SysDictTypeController 中添加按字典类型编码精确查询的接口
- 更新前端组件以支持新的字典查询接口,优化字典选择器的加载逻辑
2026-04-28 19:12:50 +08:00

29 lines
1.9 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.

-- -------------------------------------------------------------------------------------
-- 规程管理页面字典:工艺类型(wms_process_spec_type)、产线筛选项(wms_process_spec_line)
-- 执行前提:已有 sys_dict_type / sys_dict_data 表。
--
-- 产线字典(dict.value):须为数字型的产线 ID与 wms_production_line.line_id / wms_process_spec.line_id 一致),不可用字母;
-- 字典标签为该产线在规程页 Tab/下拉的展示文案。前端以产线主表列表为全集,字典仅覆盖同 line_id 的显示名(见 processSpec/loadLineOptions
-- -------------------------------------------------------------------------------------
START TRANSACTION;
INSERT INTO sys_dict_type (dict_id, dict_name, dict_type, status, create_time, remark)
VALUES
(2036400000000000001, N'规程工艺类型', 'wms_process_spec_type', '0', NOW(), N'规程页筛选用dict_value = spec_type'),
(2036400000000000002, N'规程产线筛选项', 'wms_process_spec_line', '0', NOW(), N'规程页产线筛选dict_value = line_id')
ON DUPLICATE KEY UPDATE dict_name = VALUES(dict_name), remark = VALUES(remark), status = '0';
INSERT INTO sys_dict_data (dict_code, dict_sort, dict_label, dict_value, dict_type, status, create_time)
VALUES
(2036400000000100001, 10, N'工艺规程', 'PROCESS', 'wms_process_spec_type', '0', NOW()),
(2036400000000100002, 20, N'标准', 'STANDARD', 'wms_process_spec_type', '0', NOW())
ON DUPLICATE KEY UPDATE dict_label = VALUES(dict_label), dict_sort = VALUES(dict_sort), dict_value = VALUES(dict_value), status = '0';
-- 产线筛选项暂不批量插入(避免 dict_code 与库内既有数据冲突)。
-- 若需字典内可编辑的产线与页面一致在「规程管理」页产线行齿轮中新增或按产线主表自行插入dict_value = CAST(line_id AS CHAR)。
COMMIT;
-- 执行完成后建议在「系统管理 - 字典管理」中刷新缓存,或使用接口 /system/dict/type/refreshCache