-- 上传参数解析配置表(方案二:配置化替代代码硬编码) -- 数据库:MySQL(mes_cloud_xz) CREATE TABLE mes_param_parse_config ( id varchar(64) NOT NULL COMMENT '编码', line_sn varchar(50) NOT NULL COMMENT '产线编号(*表示所有产线)', oprno varchar(50) NOT NULL COMMENT '工位号(如OP035,不含尾缀字母)', craft varchar(50) NOT NULL COMMENT '工艺编码', ps_pos int DEFAULT NULL COMMENT 'ps报文位置(从1开始)', result_mode int DEFAULT 0 COMMENT '结果模式(0取报文Y/N 1固定OK)', title varchar(255) DEFAULT NULL COMMENT '描述', status char(1) DEFAULT '0' NOT NULL COMMENT '状态(0正常 1删除 2停用)', create_by varchar(64) NOT NULL COMMENT '创建者', create_date datetime NOT NULL COMMENT '创建时间', update_by varchar(64) NOT NULL COMMENT '更新者', update_date datetime NOT NULL COMMENT '更新时间', remarks varchar(255) DEFAULT NULL COMMENT '备注信息', PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='上传参数解析配置'; -- 种子数据:迁移原XT线硬编码规则 -- OP010 底板码:ps第1、2段,结果固定OK INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date) VALUES ('ppc_xt_op010_1', 'XT', 'OP010', '400005', 1, 1, '底板码1(固定OK)', '0', 'system', NOW(), 'system', NOW()); INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date) VALUES ('ppc_xt_op010_2', 'XT', 'OP010', '400005', 2, 1, '底板码2(固定OK)', '0', 'system', NOW(), 'system', NOW()); -- OP060/OP100/OP130 程序名称:ps第1段,结果取报文Y/N INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date) VALUES ('ppc_xt_op060_1', 'XT', 'OP060', '300001', 1, 0, '程序名称', '0', 'system', NOW(), 'system', NOW()); INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date) VALUES ('ppc_xt_op100_1', 'XT', 'OP100', '300001', 1, 0, '程序名称', '0', 'system', NOW(), 'system', NOW()); INSERT INTO mes_param_parse_config (id, line_sn, oprno, craft, ps_pos, result_mode, title, status, create_by, create_date, update_by, update_date) VALUES ('ppc_xt_op130_1', 'XT', 'OP130', '300001', 1, 0, '程序名称', '0', 'system', NOW(), 'system', NOW()); -- 后台菜单:挂在"生产管理"(menu_code=1672118505143263232)下 INSERT INTO js_sys_menu (menu_code, parent_code, parent_codes, tree_sort, tree_sorts, tree_leaf, tree_level, tree_names, menu_name, menu_type, menu_href, menu_target, menu_icon, menu_color, menu_title, permission, weight, is_show, sys_code, module_codes, status, create_by, create_date, update_by, update_date, remarks) VALUES ('2043000000000000001', '1672118505143263232', '0,1672118505143263232,', 2060, '0000009290,0000002060,', '1', 1, '生产管理/上传参数解析配置', '上传参数解析配置', '1', '/mes/mesParamParseConfig/list', '', '', '', '', 'mes:mesParamParseConfig:view,mes:mesParamParseConfig:edit', 40, '1', 'default', 'app', '0', 'system', NOW(), 'system', NOW(), ''); -- 角色授权:凡是有"生产管理"菜单的角色,自动授予新菜单 INSERT INTO js_sys_role_menu (role_code, menu_code) SELECT rm.role_code, '2043000000000000001' FROM js_sys_role_menu rm WHERE rm.menu_code = '1672118505143263232' AND NOT EXISTS (SELECT 1 FROM js_sys_role_menu x WHERE x.role_code = rm.role_code AND x.menu_code = '2043000000000000001');