-- 出入库历史单：云仓 ERP 反馈重发按钮权限（需在角色中勾选后才可使用）
-- 执行一次即可；若提示重复 authority 可忽略或先删除同 authority 记录
INSERT INTO `sys_menu` (`name`, `parent_id`, `parent_name`, `path`, `path_name`, `route`, `component`, `brief`, `code`, `type`, `authority`, `icon`, `sort`, `meta`, `tenant_id`, `status`, `deleted`, `create_time`, `create_by`, `update_time`, `update_by`, `memo`)
SELECT 'CloudWMS feedback resend',
       m.id,
       NULL,
       CONCAT(IFNULL(m.path, ''), ',cloudWmsResend'),
       NULL,
       NULL,
       NULL,
       NULL,
       NULL,
       1,
       'manager:asnOrderLog:cloudWmsResend',
       NULL,
       98,
       NULL,
       m.tenant_id,
       1,
       0,
       NULL,
       NULL,
       NULL,
       NULL,
       '入库/出库历史单：云仓反馈重发'
FROM `sys_menu` m
WHERE m.`authority` = 'manager:asnOrderLog:list'
  AND m.`type` = 1
  AND NOT EXISTS (SELECT 1 FROM `sys_menu` x WHERE x.`authority` = 'manager:asnOrderLog:cloudWmsResend')
LIMIT 1;
