-- ============================================ -- 此文件由 Meoo Cloud 自动生成,请勿修改 -- This file is auto-generated by Meoo Cloud, DO NOT MODIFY -- ============================================ -- 创建示例生产计划 INSERT INTO public.production_plans (id, plan_code, product_name, color, fabric_code, color_code, remark, purchaser_id, target_quantity, completed_quantity, yarn_usage_per_meter, production_price, status, start_time, created_by) VALUES ('33333333-3333-3333-3333-333333333301', 'PLAN-2026-001', '水洗棉花糖', '白色', 'SX', '01', '60*40', '11111111-1111-1111-1111-111111111101', 10000, 6500, 100, 10, 'producing', '2026-01-15T00:00:00Z', 'a0000001-0000-0000-0000-000000000001'), ('33333333-3333-3333-3333-333333333302', 'PLAN-2026-002', '纯棉汗布', '黑色', 'CM', '02', '60双股', '11111111-1111-1111-1111-111111111101', 8000, 0, 120, 12, 'pending', NULL, 'a0000001-0000-0000-0000-000000000001'), ('33333333-3333-3333-3333-333333333303', 'PLAN-2026-003', '磨毛布', '灰色', 'MM', '03', '40*40', '11111111-1111-1111-1111-111111111101', 5000, 5000, 80, 8, 'completed', '2026-01-01T00:00:00Z', 'a0000001-0000-0000-0000-000000000001'); -- 创建计划与工厂关联 INSERT INTO public.plan_factories (plan_id, factory_id, factory_type) VALUES ('33333333-3333-3333-3333-333333333301', '11111111-1111-1111-1111-111111111102', 'textile'), ('33333333-3333-3333-3333-333333333302', '11111111-1111-1111-1111-111111111102', 'textile'), ('33333333-3333-3333-3333-333333333303', '11111111-1111-1111-1111-111111111102', 'textile'); -- 创建纱线配比 INSERT INTO public.yarn_ratios (plan_id, yarn_name, ratio, amount_per_meter, total_amount) VALUES ('33333333-3333-3333-3333-333333333301', '棉纱32S', 1, 10, 100000), ('33333333-3333-3333-3333-333333333301', '涤纶纱', 1, 10, 100000), ('33333333-3333-3333-3333-333333333301', '氨纶', 8, 80, 800000); -- 创建流程节点 INSERT INTO public.plan_process_steps (plan_id, step_type, status, timestamp, operator_id) VALUES ('33333333-3333-3333-3333-333333333301', 'confirm', 'completed', '2026-01-15T09:30:00Z', 'a0000001-0000-0000-0000-000000000001'), ('33333333-3333-3333-3333-333333333301', 'yarn_purchase', 'completed', '2026-01-16T14:20:00Z', 'a0000002-0000-0000-0000-000000000002'), ('33333333-3333-3333-3333-333333333301', 'dyeing', 'completed', '2026-01-18T10:00:00Z', 'a0000002-0000-0000-0000-000000000002'), ('33333333-3333-3333-3333-333333333301', 'machine_start', 'active', '2026-01-20T08:00:00Z', 'a0000002-0000-0000-0000-000000000002'), ('33333333-3333-3333-3333-333333333301', 'fabric_warehouse', 'pending', NULL, NULL); -- 创建结款记录 INSERT INTO public.payments (plan_id, from_company_id, to_company_id, amount, quantity, price_per_meter, status) VALUES ('33333333-3333-3333-3333-333333333301', '11111111-1111-1111-1111-111111111101', '11111111-1111-1111-1111-111111111102', 65000, 6500, 10, 'pending'), ('33333333-3333-3333-3333-333333333303', '11111111-1111-1111-1111-111111111101', '11111111-1111-1111-1111-111111111102', 50000, 5000, 10, 'pending');