-- =====================================================
-- 重新组织建模管理菜单结构
-- 按照新的层级结构重新排列菜单
-- =====================================================

SET NAMES utf8mb4;

-- =====================================================
-- 步骤1：清理建模管理相关的旧菜单数据
-- =====================================================
DELETE FROM `system_role_menu` WHERE menu_id >= 6400 AND menu_id < 6900;
DELETE FROM `system_menu` WHERE id >= 6400 AND id < 6900;

-- =====================================================
-- 建模管理 (ID: 6400, parent_id: 0, sort: 140, icon: ep:data-analysis)
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6400, '建模管理', '', 1, 140, 0, '/yunying', 'ep:data-analysis', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- =====================================================
-- 运营建模 (ID: 6410, 二级目录)
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6410, '运营建模', '', 1, 1, 6400, 'yunying', 'ep:operation', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- =====================================================
-- 产销建模 (ID: 6411, 三级目录) - 挂在运营建模下
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6411, '产销建模', '', 1, 1, 6410, 'chanxiao', 'ep:sell', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 产销建模子菜单
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6412, '客户管理', 'jianmo:customer:list', 2, 1, 6411, 'customer', 'ep:user', 'jianmo/views/CustomerManagement', 'JianmoCustomerManagement', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6413, '物料管理', 'jianmo:material:list', 2, 2, 6411, 'material', 'ep:goods', 'jianmo/views/MaterialManagement', 'JianmoMaterialManagement', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6414, '订单优先级', 'jianmo:order-priority:list', 2, 3, 6411, 'order-priority', 'ep:sort', 'jianmo/views/OrderPriorityConfig', 'JianmoOrderPriorityConfig', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- =====================================================
-- 制造建模 (ID: 6420, 三级目录) - 挂在运营建模下
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6420, '制造建模', '', 1, 2, 6410, 'manufacturing', 'ep:setting', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');


-- 制造建模子菜单
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6421, '标准BOM', 'jianmo:standard-bom:list', 2, 1, 6420, 'standard-bom', 'ep:document', 'jianmo/views/manufacturing/StandardBomManagement', 'JianmoStandardBomManagement', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6422, '标准工序', 'jianmo:standard-process:list', 2, 2, 6420, 'standard-process', 'ep:list', 'jianmo/views/manufacturing/StandardProcessList', 'JianmoStandardProcessList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6423, '生产线维护', 'jianmo:production-line:list', 2, 3, 6420, 'production-line', 'ep:guide', 'jianmo/views/manufacturing/ProductionLineList', 'JianmoProductionLineList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6424, '工艺流程', 'jianmo:routing:list', 2, 4, 6420, 'routing', 'ep:connection', 'jianmo/views/manufacturing/RoutingList', 'JianmoRoutingList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6425, '物料替代', 'jianmo:material-substitution:list', 2, 5, 6420, 'material-substitution', 'ep:switch', 'jianmo/views/manufacturing/MaterialSubstitutionList', 'JianmoMaterialSubstitutionList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6426, '工单控制参数', 'jianmo:workorder-control:list', 2, 6, 6420, 'workorder-control', 'ep:operation', 'jianmo/views/manufacturing/WorkOrderControlParams', 'JianmoWorkOrderControlParams', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6427, '人员技能', 'jianmo:personnel-skill:list', 2, 7, 6420, 'personnel-skill', 'ep:user-filled', 'jianmo/views/manufacturing/PersonnelSkillList', 'JianmoPersonnelSkillList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6428, '产线岗位', 'jianmo:line-post:list', 2, 8, 6420, 'line-post', 'ep:position', 'jianmo/views/manufacturing/LinePostList', 'JianmoLinePostList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6429, '工作中心', 'jianmo:work-center:list', 2, 9, 6420, 'work-center', 'ep:office-building', 'jianmo/views/manufacturing/WorkCenterList', 'JianmoWorkCenterList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6430, '生产线物料', 'jianmo:line-material:list', 2, 10, 6420, 'line-material', 'ep:goods-filled', 'jianmo/views/manufacturing/LineMaterialList', 'JianmoLineMaterialList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6431, '生产要素参数', 'jianmo:production-element:list', 2, 11, 6420, 'production-element', 'ep:data-board', 'jianmo/views/manufacturing/ProductionElementParamList', 'JianmoProductionElementParamList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6432, '物料工序要素', 'jianmo:material-process-element:list', 2, 12, 6420, 'material-process-element', 'ep:collection', 'jianmo/views/manufacturing/MaterialProcessElementList', 'JianmoMaterialProcessElementList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6433, '前处理要素', 'jianmo:preprocess-element:list', 2, 13, 6420, 'preprocess-element', 'ep:magic-stick', 'jianmo/views/manufacturing/PreprocessElementList', 'JianmoPreprocessElementList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6434, '前处理要素参数', 'jianmo:preprocess-element-param:list', 2, 14, 6420, 'preprocess-element-param', 'ep:set-up', 'jianmo/views/manufacturing/PreprocessElementParamList', 'JianmoPreprocessElementParamList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6435, 'SOP文件类型', 'jianmo:sop-file-type:list', 2, 15, 6420, 'sop-file-type', 'ep:folder', 'jianmo/views/manufacturing/SopFileTypeList', 'JianmoSopFileTypeList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6436, 'SOP维护', 'jianmo:sop-maintenance:list', 2, 16, 6420, 'sop-maintenance', 'ep:document-copy', 'jianmo/views/manufacturing/SopMaintenanceList', 'JianmoSopMaintenanceList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- =====================================================
-- 仓储建模 (ID: 6440, 三级目录) - 挂在运营建模下
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6440, '仓储建模', '', 1, 3, 6410, 'warehouse', 'ep:house', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 仓储建模子菜单
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6441, '库位维护', 'jianmo:location:list', 2, 1, 6440, 'location', 'ep:location', 'jianmo/views/warehouse/LocationMaintenanceList', 'JianmoLocationMaintenanceList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6442, '货架列表', 'jianmo:rack:list', 2, 2, 6440, 'rack', 'ep:grid', 'jianmo/views/warehouse/RackList', 'JianmoRackList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6443, '部门维护', 'jianmo:department:list', 2, 3, 6440, 'department', 'ep:office-building', 'jianmo/views/warehouse/DepartmentMaintenanceList', 'JianmoDepartmentMaintenanceList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6444, '雇员列表', 'jianmo:employee:list', 2, 4, 6440, 'employee', 'ep:avatar', 'jianmo/views/warehouse/EmployeeList', 'JianmoEmployeeList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6445, '条码规则', 'jianmo:barcode-rule:list', 2, 5, 6440, 'barcode-rule', 'ep:postcard', 'jianmo/views/warehouse/BarcodeRuleList', 'JianmoBarcodeRuleList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6446, '标签格式', 'jianmo:label-format:list', 2, 6, 6440, 'label-format', 'ep:price-tag', 'jianmo/views/warehouse/LabelFormatList', 'JianmoLabelFormatList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6447, '成本中心', 'jianmo:cost-center:list', 2, 7, 6440, 'cost-center', 'ep:money', 'jianmo/views/warehouse/CostCenterList', 'JianmoCostCenterList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6448, '物料职责', 'jianmo:material-duty:list', 2, 8, 6440, 'material-duty', 'ep:stamp', 'jianmo/views/warehouse/MaterialDutyList', 'JianmoMaterialDutyList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6449, '单号类型', 'jianmo:order-type:list', 2, 9, 6440, 'order-type', 'ep:tickets', 'jianmo/views/warehouse/OrderTypeList', 'JianmoOrderTypeList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6450, '单号规则', 'jianmo:order-rule:list', 2, 10, 6440, 'order-rule', 'ep:document-checked', 'jianmo/views/warehouse/OrderRuleList', 'JianmoOrderRuleList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6451, '包装规格', 'jianmo:packaging-spec:list', 2, 11, 6440, 'packaging-spec', 'ep:box', 'jianmo/views/warehouse/PackagingSpecList', 'JianmoPackagingSpecList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6452, '物料状态任务', 'jianmo:material-status-task:list', 2, 12, 6440, 'material-status-task', 'ep:finished', 'jianmo/views/warehouse/MaterialStatusTaskList', 'JianmoMaterialStatusTaskList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6453, '生产领料单', 'jianmo:production-picking-model:list', 2, 13, 6440, 'production-picking-model', 'ep:goods', 'jianmo/views/warehouse/ProductionPickingModelList', 'JianmoProductionPickingModelList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');


-- =====================================================
-- 质量建模 (ID: 6460, 三级目录) - 挂在运营建模下
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6460, '质量建模', '', 1, 4, 6410, 'quality', 'ep:checked', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 质量建模子菜单
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6461, '单据类型', 'jianmo:document-type:list', 2, 1, 6460, 'document-type', 'ep:document', 'jianmo/views/quality/DocumentTypeList', 'JianmoDocumentTypeList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6462, '业务类型', 'jianmo:business-type:list', 2, 2, 6460, 'business-type', 'ep:briefcase', 'jianmo/views/quality/BusinessTypeList', 'JianmoBusinessTypeList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6463, '客诉类别', 'jianmo:complaint-category:list', 2, 3, 6460, 'complaint-category', 'ep:chat-line-square', 'jianmo/views/quality/ComplaintCategoryList', 'JianmoComplaintCategoryList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6464, '检验优先级', 'jianmo:inspection-priority:list', 2, 4, 6460, 'inspection-priority', 'ep:sort', 'jianmo/views/quality/InspectionPriorityList', 'JianmoInspectionPriorityList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6465, '不合格联络单模板', 'jianmo:nonconformance-template:list', 2, 5, 6460, 'nonconformance-template', 'ep:warning', 'jianmo/views/quality/NonconformanceContactTemplateList', 'JianmoNonconformanceContactTemplateList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6466, '8D模板', 'jianmo:eight-d-template:list', 2, 6, 6460, 'eight-d-template', 'ep:document-copy', 'jianmo/views/quality/EightDTemplateList', 'JianmoEightDTemplateList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6467, 'NCR处置类型', 'jianmo:ncr-disposition-type:list', 2, 7, 6460, 'ncr-disposition-type', 'ep:delete', 'jianmo/views/quality/NcrDispositionTypeList', 'JianmoNcrDispositionTypeList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6468, '质量项目', 'jianmo:quality-project:list', 2, 8, 6460, 'quality-project', 'ep:folder-opened', 'jianmo/views/quality/QualityProjectTemplateList', 'JianmoQualityProjectTemplateList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6469, 'CAPA类型', 'jianmo:capa-type:list', 2, 9, 6460, 'capa-type', 'ep:aim', 'jianmo/views/quality/CapaTypeList', 'JianmoCapaTypeList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6470, '检验状态', 'jianmo:inspection-status:list', 2, 10, 6460, 'inspection-status', 'ep:circle-check', 'jianmo/views/quality/InspectionStatusList', 'JianmoInspectionStatusList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6471, 'AQL检验水平', 'jianmo:aql-level:list', 2, 11, 6460, 'aql-level', 'ep:data-line', 'jianmo/views/quality/AqlLevelList', 'JianmoAqlLevelList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6472, 'AQL值', 'jianmo:aql-value:list', 2, 12, 6460, 'aql-value', 'ep:histogram', 'jianmo/views/quality/AqlValueList', 'JianmoAqlValueList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6473, '抽样方案', 'jianmo:sampling-plan:list', 2, 13, 6460, 'sampling-plan', 'ep:pie-chart', 'jianmo/views/quality/SamplingPlanList', 'JianmoSamplingPlanList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6474, '检验方法', 'jianmo:inspection-method:list', 2, 14, 6460, 'inspection-method', 'ep:tools', 'jianmo/views/quality/InspectionMethodList', 'JianmoInspectionMethodList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6475, '检验依据', 'jianmo:inspection-basis:list', 2, 15, 6460, 'inspection-basis', 'ep:reading', 'jianmo/views/quality/InspectionBasisList', 'JianmoInspectionBasisList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6476, '检验仪器', 'jianmo:inspection-instrument:list', 2, 16, 6460, 'inspection-instrument', 'ep:odometer', 'jianmo/views/quality/InspectionInstrumentList', 'JianmoInspectionInstrumentList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6477, '检验频率', 'jianmo:inspection-frequency:list', 2, 17, 6460, 'inspection-frequency', 'ep:timer', 'jianmo/views/quality/InspectionFrequencyList', 'JianmoInspectionFrequencyList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6478, '检验项目', 'jianmo:inspection-item:list', 2, 18, 6460, 'inspection-item', 'ep:list', 'jianmo/views/quality/InspectionItemList', 'JianmoInspectionItemList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6479, '检验标准', 'jianmo:inspection-standard:list', 2, 19, 6460, 'inspection-standard', 'ep:document-checked', 'jianmo/views/quality/InspectionStandardList', 'JianmoInspectionStandardList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6480, '检验方案', 'jianmo:inspection-scheme:list', 2, 20, 6460, 'inspection-scheme', 'ep:memo', 'jianmo/views/quality/InspectionSchemeList', 'JianmoInspectionSchemeList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6481, '原材料免检', 'jianmo:raw-material-skip:list', 2, 21, 6460, 'raw-material-skip', 'ep:circle-close', 'jianmo/views/quality/RawMaterialSkipList', 'JianmoRawMaterialSkipList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- =====================================================
-- 供应建模 (ID: 6490, 三级目录) - 挂在运营建模下
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6490, '供应建模', '', 1, 5, 6410, 'supply', 'ep:van', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 供应建模子菜单
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6491, '供应商维护', 'jianmo:supplier:list', 2, 1, 6490, 'supplier', 'ep:user', 'jianmo/views/supply/SupplierList', 'JianmoSupplierList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6492, '货源清单', 'jianmo:sourcing:list', 2, 2, 6490, 'sourcing', 'ep:document', 'jianmo/views/supply/SourcingList', 'JianmoSourcingList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');


-- =====================================================
-- 设备管理 (ID: 6500, 二级目录) - 直接挂在建模管理下
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6500, '设备管理', '', 1, 2, 6400, 'device', 'ep:cpu', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 设备管理子菜单
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6501, '设备列表', 'jianmo:device:list', 2, 1, 6500, 'device-list', 'ep:monitor', 'jianmo/views/device/DeviceList', 'JianmoDeviceList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6502, '模工具列表', 'jianmo:molding-tool:list', 2, 2, 6500, 'molding-tool', 'ep:tools', 'jianmo/views/device/MoldingToolList', 'JianmoMoldingToolList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- =====================================================
-- 仓储管理 (ID: 6600, 二级目录) - 直接挂在建模管理下
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6600, '仓储管理', '', 1, 3, 6400, 'wms', 'ep:house', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 仓储管理子菜单
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6601, '委外交料单', 'jianmo:outsource-delivery:list', 2, 1, 6600, 'outsource-delivery', 'ep:document', 'jianmo/views/wms/OutsourcingDeliveryList', 'JianmoOutsourcingDeliveryList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6602, '采购收货单', 'jianmo:purchase-receipt:list', 2, 2, 6600, 'purchase-receipt', 'ep:shopping-cart', 'jianmo/views/wms/PurchaseReceiptList', 'JianmoPurchaseReceiptList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6603, '生产领料单', 'jianmo:production-picking:list', 2, 3, 6600, 'production-picking', 'ep:goods', 'jianmo/views/wms/ProductionPickingList', 'JianmoProductionPickingList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6604, '生产退料单', 'jianmo:production-return:list', 2, 4, 6600, 'production-return', 'ep:refresh-left', 'jianmo/views/wms/ProductionReturnList', 'JianmoProductionReturnList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- =====================================================
-- 仓库数据 (ID: 6700, 二级目录) - 直接挂在建模管理下
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6700, '仓库数据', '', 1, 4, 6400, 'inventory', 'ep:data-analysis', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 仓库数据子菜单
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6701, '标签查询', 'jianmo:label-query:list', 2, 1, 6700, 'label-query', 'ep:price-tag', 'jianmo/views/inventory/TagQuery', 'JianmoLabelQueryList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6702, '标签历史记录', 'jianmo:label-history:list', 2, 2, 6700, 'label-history', 'ep:clock', 'jianmo/views/inventory/TagHistory', 'JianmoLabelHistoryList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6703, '暂收在检列表', 'jianmo:pending-inspection:list', 2, 3, 6700, 'pending-inspection', 'ep:loading', 'jianmo/views/inventory/PendingInspectionList', 'JianmoPendingInspectionList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6704, '库存查询', 'jianmo:inventory-query:list', 2, 4, 6700, 'inventory-query', 'ep:search', 'jianmo/views/inventory/StockQuery', 'JianmoInventoryQueryList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6705, '进出存查询', 'jianmo:stock-movement:list', 2, 5, 6700, 'stock-movement', 'ep:sort', 'jianmo/views/inventory/StockFlow', 'JianmoStockMovementList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- =====================================================
-- 成品仓库 (ID: 6800, 二级目录) - 直接挂在建模管理下
-- =====================================================
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6800, '成品仓库', '', 1, 5, 6400, 's7', 'ep:box', NULL, NULL, 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- 成品仓库子菜单
INSERT INTO `system_menu` (`id`, `name`, `permission`, `type`, `sort`, `parent_id`, `path`, `icon`, `component`, `component_name`, `status`, `visible`, `keep_alive`, `always_show`, `creator`, `create_time`, `updater`, `update_time`, `deleted`) VALUES 
(6801, '生产入库单列表', 'jianmo:production-inbound:list', 2, 1, 6800, 'production-inbound', 'ep:upload', 'jianmo/views/s7/ProductionInboundList', 'JianmoProductionInboundList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0'),
(6802, '销售发货通知', 'jianmo:sales-shipping-notice:list', 2, 2, 6800, 'sales-shipping-notice', 'ep:ship', 'jianmo/views/s7/SalesShipmentNotice', 'JianmoSalesShippingNoticeList', 0, b'1', b'1', b'1', 'admin', NOW(), 'admin', NOW(), b'0');

-- =====================================================
-- 为超级管理员角色分配新菜单权限
-- =====================================================
INSERT INTO `system_role_menu` (`role_id`, `menu_id`, `creator`, `create_time`, `updater`, `update_time`, `deleted`, `tenant_id`) 
SELECT 1, id, 'admin', NOW(), 'admin', NOW(), b'0', 1 
FROM `system_menu` 
WHERE id >= 6400 AND id < 6900 AND deleted = b'0';

-- =====================================================
-- 完成提示
-- =====================================================
-- 新的菜单结构：
-- 
-- 建模管理 (ID: 6400, parent_id: 0, sort: 140)
-- │
-- ├── 运营建模 (ID: 6410, 二级目录)
-- │   ├── 产销建模 (ID: 6411, 三级目录)
-- │   │   ├── 客户管理 (ID: 6412)
-- │   │   ├── 物料管理 (ID: 6413)
-- │   │   └── 订单优先级 (ID: 6414)
-- │   ├── 制造建模 (ID: 6420, 三级目录)
-- │   │   ├── 标准BOM (ID: 6421)
-- │   │   ├── 标准工序 (ID: 6422)
-- │   │   ├── 生产线维护 (ID: 6423)
-- │   │   ├── 工艺流程 (ID: 6424)
-- │   │   ├── 物料替代 (ID: 6425)
-- │   │   ├── 工单控制参数 (ID: 6426)
-- │   │   ├── 人员技能 (ID: 6427)
-- │   │   ├── 产线岗位 (ID: 6428)
-- │   │   ├── 工作中心 (ID: 6429)
-- │   │   ├── 生产线物料 (ID: 6430)
-- │   │   ├── 生产要素参数 (ID: 6431)
-- │   │   ├── 物料工序要素 (ID: 6432)
-- │   │   ├── 前处理要素 (ID: 6433)
-- │   │   ├── 前处理要素参数 (ID: 6434)
-- │   │   ├── SOP文件类型 (ID: 6435)
-- │   │   └── SOP维护 (ID: 6436)
-- │   ├── 仓储建模 (ID: 6440, 三级目录)
-- │   │   ├── 库位维护 (ID: 6441)
-- │   │   ├── 货架列表 (ID: 6442)
-- │   │   ├── 部门维护 (ID: 6443)
-- │   │   ├── 雇员列表 (ID: 6444)
-- │   │   ├── 条码规则 (ID: 6445)
-- │   │   ├── 标签格式 (ID: 6446)
-- │   │   ├── 成本中心 (ID: 6447)
-- │   │   ├── 物料职责 (ID: 6448)
-- │   │   ├── 单号类型 (ID: 6449)
-- │   │   ├── 单号规则 (ID: 6450)
-- │   │   ├── 包装规格 (ID: 6451)
-- │   │   ├── 物料状态任务 (ID: 6452)
-- │   │   └── 生产领料单 (ID: 6453)
-- │   ├── 质量建模 (ID: 6460, 三级目录)
-- │   │   ├── 单据类型 (ID: 6461)
-- │   │   ├── 业务类型 (ID: 6462)
-- │   │   ├── 客诉类别 (ID: 6463)
-- │   │   ├── 检验优先级 (ID: 6464)
-- │   │   ├── 不合格联络单模板 (ID: 6465)
-- │   │   ├── 8D模板 (ID: 6466)
-- │   │   ├── NCR处置类型 (ID: 6467)
-- │   │   ├── 质量项目 (ID: 6468)
-- │   │   ├── CAPA类型 (ID: 6469)
-- │   │   ├── 检验状态 (ID: 6470)
-- │   │   ├── AQL检验水平 (ID: 6471)
-- │   │   ├── AQL值 (ID: 6472)
-- │   │   ├── 抽样方案 (ID: 6473)
-- │   │   ├── 检验方法 (ID: 6474)
-- │   │   ├── 检验依据 (ID: 6475)
-- │   │   ├── 检验仪器 (ID: 6476)
-- │   │   ├── 检验频率 (ID: 6477)
-- │   │   ├── 检验项目 (ID: 6478)
-- │   │   ├── 检验标准 (ID: 6479)
-- │   │   ├── 检验方案 (ID: 6480)
-- │   │   └── 原材料免检 (ID: 6481)
-- │   └── 供应建模 (ID: 6490, 三级目录)
-- │       ├── 供应商维护 (ID: 6491)
-- │       └── 货源清单 (ID: 6492)
-- │
-- ├── 设备管理 (ID: 6500, 二级目录)
-- │   ├── 设备列表 (ID: 6501)
-- │   └── 模工具列表 (ID: 6502)
-- │
-- ├── 仓储管理 (ID: 6600, 二级目录)
-- │   ├── 委外交料单 (ID: 6601)
-- │   ├── 采购收货单 (ID: 6602)
-- │   ├── 生产领料单 (ID: 6603)
-- │   └── 生产退料单 (ID: 6604)
-- │
-- ├── 仓库数据 (ID: 6700, 二级目录)
-- │   ├── 标签查询 (ID: 6701)
-- │   ├── 标签历史记录 (ID: 6702)
-- │   ├── 暂收在检列表 (ID: 6703)
-- │   ├── 库存查询 (ID: 6704)
-- │   └── 进出存查询 (ID: 6705)
-- │
-- └── 成品仓库 (ID: 6800, 二级目录)
--     ├── 生产入库单列表 (ID: 6801)
--     └── 销售发货通知 (ID: 6802)
--
-- 执行完成后，请：
-- 1. 重新登录管理后台
-- 2. 在"系统管理" -> "菜单管理"中查看新增的菜单
-- 3. 在"系统管理" -> "角色管理"中为需要的角色分配菜单权限
-- 4. 刷新页面查看左侧菜单栏
