-- 支付结算（商户结算配置、微信分账单）菜单及权限初始化 SQL
--
-- 号段：1926061410000000101 ~ 1926061410000000114（雪花十进制串，见 mock-data-id-rules.mdc）
-- 父菜单：2048654050841710593（业务管理，与 booking_menu_permission.sql 一致；若环境不同请先查询 sys_menu_info 后替换）
-- subsystem_id：1820814889969582082

-- 执行前检查
SELECT id, menu_name, menu_path
FROM sys_menu_info
WHERE del_flag = '0'
  AND menu_path IN ('businessFinanceMerchantSettle', 'businessFinanceProfitSharing');

SELECT id
FROM sys_menu_info
WHERE id BETWEEN '1926061410000000101' AND '1926061410000000114';

-- 1. 商户结算配置
INSERT INTO sys_menu_info (
    id, create_by, create_date, update_by, update_date, remarks, del_flag,
    organize_id, tenant_id, tenant_code, sort_num, menu_name, menu_short_name,
    menu_path, target, menu_parent_ids, menu_parent_id, menu_icon, is_show,
    permission, menu_type, tip, subsystem_id, category, class_path, component, verification
) VALUES (
    '1926061410000000101', '1', NOW(), '1', NOW(), 'finance_menu_permission', '0',
    NULL, '1', '1', 25, '商户结算配置', '结算配置',
    'businessFinanceMerchantSettle', '', '0,2048654050841710593,', '2048654050841710593', 'Setting', '1',
    '', '2', '', '1820814889969582082', 'WEB', '', 'business/finance/merchantSettle/index', '0'
);

INSERT INTO sys_menu_button_info (
    id, create_date, create_by, update_date, update_by, del_flag, remarks,
    tenant_id, tenant_code, organize_id, button_code, button_name, enable, menu_id, sort_num, sys_data, source
) VALUES
('1926061410000000102', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:merchantSettle:info', '详情', '1', '1926061410000000101', 10, '0', '0'),
('1926061410000000103', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:merchantSettle:list', '列表', '1', '1926061410000000101', 20, '0', '0'),
('1926061410000000104', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:merchantSettle:create', '新增', '1', '1926061410000000101', 30, '0', '0'),
('1926061410000000105', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:merchantSettle:update', '修改', '1', '1926061410000000101', 40, '0', '0'),
('1926061410000000106', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:merchantSettle:delete', '删除', '1', '1926061410000000101', 50, '0', '0');

-- 2. 微信分账单
INSERT INTO sys_menu_info (
    id, create_by, create_date, update_by, update_date, remarks, del_flag,
    organize_id, tenant_id, tenant_code, sort_num, menu_name, menu_short_name,
    menu_path, target, menu_parent_ids, menu_parent_id, menu_icon, is_show,
    permission, menu_type, tip, subsystem_id, category, class_path, component, verification
) VALUES (
    '1926061410000000111', '1', NOW(), '1', NOW(), 'finance_menu_permission', '0',
    NULL, '1', '1', 26, '微信分账单', '分账单',
    'businessFinanceProfitSharing', '', '0,2048654050841710593,', '2048654050841710593', 'Share', '1',
    '', '2', '', '1820814889969582082', 'WEB', '', 'business/finance/profitSharing/index', '0'
);

INSERT INTO sys_menu_button_info (
    id, create_date, create_by, update_date, update_by, del_flag, remarks,
    tenant_id, tenant_code, organize_id, button_code, button_name, enable, menu_id, sort_num, sys_data, source
) VALUES
('1926061410000000112', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:profitSharing:info', '详情', '1', '1926061410000000111', 10, '0', '0'),
('1926061410000000113', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:profitSharing:list', '列表', '1', '1926061410000000111', 20, '0', '0'),
('1926061410000000114', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:profitSharing:retry', '重试', '1', '1926061410000000111', 30, '0', '0');

-- 3. 支付退款单
INSERT INTO sys_menu_info (
    id, create_by, create_date, update_by, update_date, remarks, del_flag,
    organize_id, tenant_id, tenant_code, sort_num, menu_name, menu_short_name,
    menu_path, target, menu_parent_ids, menu_parent_id, menu_icon, is_show,
    permission, menu_type, tip, subsystem_id, category, class_path, component, verification
) VALUES (
    '1926061420000000101', '1', NOW(), '1', NOW(), 'finance_menu_permission', '0',
    NULL, '1', '1', 27, '支付退款单', '退款单',
    'businessFinancePayRefund', '', '0,2048654050841710593,', '2048654050841710593', 'Money', '1',
    '', '2', '', '1820814889969582082', 'WEB', '', 'business/finance/payRefund/index', '0'
);

INSERT INTO sys_menu_button_info (
    id, create_date, create_by, update_date, update_by, del_flag, remarks,
    tenant_id, tenant_code, organize_id, button_code, button_name, enable, menu_id, sort_num, sys_data, source
) VALUES
('1926061420000000102', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:payRefund:info', '详情', '1', '1926061420000000101', 10, '0', '0'),
('1926061420000000103', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:payRefund:list', '列表', '1', '1926061420000000101', 20, '0', '0'),
('1926061420000000104', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:payRefund:create', '发起退款', '1', '1926061420000000101', 30, '0', '0'),
('1926061420000000105', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:payRefund:retry', '重试', '1', '1926061420000000101', 40, '0', '0');

-- 4. 商户应收账
INSERT INTO sys_menu_info (
    id, create_by, create_date, update_by, update_date, remarks, del_flag,
    organize_id, tenant_id, tenant_code, sort_num, menu_name, menu_short_name,
    menu_path, target, menu_parent_ids, menu_parent_id, menu_icon, is_show,
    permission, menu_type, tip, subsystem_id, category, class_path, component, verification
) VALUES (
    '1926061430000000101', '1', NOW(), '1', NOW(), 'finance_menu_permission', '0',
    NULL, '1', '1', 28, '商户应收账', '应收账',
    'businessFinanceMerchantReceivable', '', '0,2048654050841710593,', '2048654050841710593', 'Coin', '1',
    '', '2', '', '1820814889969582082', 'WEB', '', 'business/finance/merchantReceivable/index', '0'
);

INSERT INTO sys_menu_button_info (
    id, create_date, create_by, update_date, update_by, del_flag, remarks,
    tenant_id, tenant_code, organize_id, button_code, button_name, enable, menu_id, sort_num, sys_data, source
) VALUES
('1926061430000000102', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:merchantReceivable:info', '详情', '1', '1926061430000000101', 10, '0', '0'),
('1926061430000000103', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:merchantReceivable:list', '列表', '1', '1926061430000000101', 20, '0', '0'),
('1926061430000000104', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:merchantReceivable:summary', '汇总', '1', '1926061430000000101', 30, '0', '0'),
('1926061430000000105', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:merchantReceivable:export', '导出', '1', '1926061430000000101', 40, '0', '0');

-- 5. 分账回退单
INSERT INTO sys_menu_info (
    id, create_by, create_date, update_by, update_date, remarks, del_flag,
    organize_id, tenant_id, tenant_code, sort_num, menu_name, menu_short_name,
    menu_path, target, menu_parent_ids, menu_parent_id, menu_icon, is_show,
    permission, menu_type, tip, subsystem_id, category, class_path, component, verification
) VALUES (
    '1926061440000000101', '1', NOW(), '1', NOW(), 'finance_menu_permission', '0',
    NULL, '1', '1', 29, '分账回退单', '分账回退',
    'businessFinanceProfitSharingReturn', '', '0,2048654050841710593,', '2048654050841710593', 'RefreshLeft', '1',
    '', '2', '', '1820814889969582082', 'WEB', '', 'business/finance/profitSharingReturn/index', '0'
);

INSERT INTO sys_menu_button_info (
    id, create_date, create_by, update_date, update_by, del_flag, remarks,
    tenant_id, tenant_code, organize_id, button_code, button_name, enable, menu_id, sort_num, sys_data, source
) VALUES
('1926061440000000102', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:profitSharingReturn:info', '详情', '1', '1926061440000000101', 10, '0', '0'),
('1926061440000000103', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:profitSharingReturn:list', '列表', '1', '1926061440000000101', 20, '0', '0'),
('1926061440000000104', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:profitSharingReturn:retry', '重试', '1', '1926061440000000101', 30, '0', '0');

-- 6. 财务对账导出
INSERT INTO sys_menu_info (
    id, create_by, create_date, update_by, update_date, remarks, del_flag,
    organize_id, tenant_id, tenant_code, sort_num, menu_name, menu_short_name,
    menu_path, target, menu_parent_ids, menu_parent_id, menu_icon, is_show,
    permission, menu_type, tip, subsystem_id, category, class_path, component, verification
) VALUES (
    '1926061450000000101', '1', NOW(), '1', NOW(), 'finance_menu_permission', '0',
    NULL, '1', '1', 30, '财务对账', '对账',
    'businessFinanceReconcile', '', '0,2048654050841710593,', '2048654050841710593', 'Document', '1',
    '', '2', '', '1820814889969582082', 'WEB', '', 'business/finance/reconcile/index', '0'
);

INSERT INTO sys_menu_button_info (
    id, create_date, create_by, update_date, update_by, del_flag, remarks,
    tenant_id, tenant_code, organize_id, button_code, button_name, enable, menu_id, sort_num, sys_data, source
) VALUES
('1926061450000000102', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:reconcile:summary', '汇总', '1', '1926061450000000101', 10, '0', '0'),
('1926061450000000103', NOW(), '1', NOW(), '1', '0', NULL, '1', '1', NULL, 'manager:business:finance:reconcile:export', '导出', '1', '1926061450000000101', 20, '0', '0');
