-- =============================================================
-- 线上线下库对齐修复脚本
-- 用于 klp-oa（线上）和 klp-oa-test（线下）
-- =============================================================
SET NAMES utf8mb4;

-- ==================== 第一部分：补字典（两边都执行） ====================

-- 1.1 regrade_quality_type 字典类型
INSERT IGNORE INTO sys_dict_type (dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark)
VALUES ('改判后质量状态', 'regrade_quality_type', '0', 'admin', NOW(), 'admin', NOW(), '');

-- 1.2 regrade_quality_type 字典数据
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
VALUES (1, '协议销售', 'protocol_sale', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW()),
(2, '转分剪', 'to_slitting', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW()),
(3, '降级', 'downgrade', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW()),
(4, '返修', 'rework', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW()),
(5, '报废', 'scrap', 'regrade_quality_type', '', '', 'Y', '0', 'admin', NOW());

-- 1.3 quality_review_status 补充缺失数据
INSERT IGNORE INTO sys_dict_data (dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time)
VALUES (2, '待审批', '2', 'quality_review_status', '', 'warning', 'Y', '0', 'admin', NOW()),
(3, '已通过', '3', 'quality_review_status', '', 'success', 'Y', '0', 'admin', NOW()),
(4, '已驳回', '4', 'quality_review_status', '', 'danger', 'Y', '0', 'admin', NOW());
