# MES **Repository Path**: duling/mes ## Basic Information - **Project Name**: MES - **Description**: 半导体MES芯片制造系统 - **Primary Language**: C# - **License**: OSL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 5 - **Forks**: 3 - **Created**: 2025-12-07 - **Last Updated**: 2026-04-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # MES Manufacturing Execution System ## Project Overview MES (Manufacturing Execution System) is a comprehensive manufacturing management system designed specifically for semiconductor/wafer fabrication facilities. Built on .NET 8 technology stack, it aims to optimize production workflows, track manufacturing processes, and manage integration with ERP, EAP (Equipment Automation Program), and SPC systems. ## Core Features ### 🏭 Distributed Workflow Engine - Real-time processing of 10,000+ concurrent lots - Redis-based distributed locks and state management - RabbitMQ for asynchronous task processing - Streaming data processing for large data volumes - Blockchain-based audit logs ensuring immutability ### 📊 Complete Production Management Modules - **System Management**: User, role, permission, and menu management - **Process Management**: Recipe, step, operation, and flow definition - **Material Management**: Raw materials, inventory, monitoring, transaction records - **Equipment Management**: Equipment, equipment groups, workstations, status monitoring - **Quality Management**: SPC statistical process control, measurement data, Chart analysis - **WIP Management**: Lot tracking, wafer start, processing history - **Special Features**: Auto Monitor, Season, Pilot Wafer, Reposition management ### 🔧 Technical Features - Multi-database support based on FreeSQL - Support for PostgreSQL, MySQL, SQL Server - Frontend built with Vue3 + TypeScript + Composition API - Responsive design supporting multiple devices - Complete permission control and audit tracking ## System Architecture ### Technology Stack - **Backend**: ASP.NET Core 8.0, C# - **Database**: MySQL (default) or PostgreSQL, Redis (cache) - **Message Queue**: RabbitMQ (optional) - **ORM**: FreeSQL 3.5.x - **Authentication**: JWT Bearer tokens - **Frontend**: Vue 3.5.x + Composition API, TypeScript - **UI Library**: Element Plus - **State Management**: Pinia - **Build Tools**: Vite 7.x - **Styling**: Tailwind CSS 4.x, SCSS ### Module Architecture ``` MES System ├── 10 System Module (systemMgr) - Permission and basic data management │ ├── 101 Department Management (dept) │ ├── 102 User Management (user) │ ├── 103 User Group Management (userGroup) │ ├── 104 Role Management (role) │ ├── 105 Menu Management (menu) │ └── 106 Dictionary Management (dict) ├── 20 Recipe Module (recipeMgr) - Process flow definition │ └── 201 Recipe Management (recipe) ├── 30 Material Module (materialsMgr) - Material lifecycle management │ ├── 301 Warehouse Management (warehouse) │ ├── 302 Material Management (materials) │ ├── 303 Material Receival (materialReceiv) │ ├── 304 Material Monitoring (materialMonitor) │ ├── 305 Material Transaction History (materialTransHistory) │ └── 306 Material Receive History (materialReceiveHistory) ├── 40 Equipment Module (eqpMgr) - Equipment and resource management │ ├── 401 Workstation Management (workstation) │ ├── 402 Equipment Management (eqp) │ ├── 403 Equipment Group Management (eqpGroup) │ ├── 404 Equipment Status Management (eqpStatus) │ ├── 405 Equipment Reservation (eqpReserv) │ └── 406 Equipment Process History (eqpProcessHistory) ├── 50 SPC Module (spcMgr) - Quality control and analysis │ ├── 501 SPC Rule Management (rule) │ ├── 502 EDC Management (edc) │ ├── 503 Chart Management (chart) │ └── 504 Measurement Rule Management (measurementRule) ├── 60 Flow Module (flowMgr) - Flow design and version control │ ├── 601 Step Management (step) │ ├── 602 SubPlan Management (subPlan) │ ├── 603 Stage Management (stage) │ ├── 604 Process Management (process) │ ├── 605 Flow Management (flow) │ ├── 606 Rework Management (rework) │ ├── 607 Loop Management (loop) │ ├── 608 Q-Time Management (qTime) │ ├── 609 Q-Time Monitoring (qTimeMonitor) │ ├── 610 OCAP Flow Setup (ocapFlow) │ ├── 611 RRC Flow Setup (rrcFlow) │ └── 612 SRC Flow Setup (srcFlow) ├── 70 Product Module (prodMgr) - Product and product group management │ ├── 701 Product Management (prod) │ └── 702 Product Group Management (prodGroup) ├── 80 Cassette Module (cassetteMgr) - Cassette and cleaning management │ ├── 801 Cassette Setup (cassette) │ └── 802 Cleaning Setup (cassetteClean) ├── 90 WIP Module (wipMgr) - Lot processing management │ ├── 901 Lot Plan (lotPlan) │ ├── 902 Wafer Start (waferStart) │ ├── 903 Single Lot (singleLot) │ ├── 904 Multi-Lot Processing (multiLot) │ ├── 905 Batch Lot Processing (batchLot) │ ├── 906 Future Hold (futureHold) │ ├── 907 Lot Transaction History (lotTransHistory) │ └── 908 OCAP (ocap) ├── 100 Measurement Module (measurementMgr) - Measurement data analysis │ ├── 1001 Measurement Analysis (analysis) │ └── 1002 EDC Data History (edcData) ├── 110 Order Module (orderMgr) - Order and shipment management │ ├── 1101 Order Management (order) │ ├── 1102 Shipment Statistics (orderStatisticsReport) │ └── 1103 Order History (orderHistory) ├── 120 Cross-Fab OEM Module (crossFabOEMMgr) - OEM business management │ ├── 1201 Cross-Fab Setup (crossFabSetup) │ ├── 1202 Cross-Fab Delivery (crossFab) │ └── 1203 Cross-Fab QC (crossFabQC) ├── 130 Track-In Constraint Module (trackInConstraintMgr) - Track-in restriction management │ ├── 1301 Equipment Constraint System (ecs) │ ├── 1302 Pollution Level Control (pollutionLevel) │ └── 1303 Check Custom (checkCust) ├── 140 Auto Monitor Module (autoMonitorMgr) - Equipment monitoring management │ ├── 1401 Auto Monitor Setup (autoMonitorSetup) │ ├── 1402 EMAS (emas) │ ├── 1403 Downgrade (downgrade) │ └── 1404 Auto Monitor History (autoMonitorHistory) ├── 150 Season Module (seasonMgr) - Equipment warm-up management │ ├── 1501 Season Management (season) │ └── 1502 Season History (seasonHistory) ├── 160 Pilot Module (pilotMgr) - Pilot wafer management │ ├── 1601 Pilot Wafer Management (pilotWafer) │ └── 1602 Pilot History (pilotHistory) ├── 170 Reposition Module (repositionMgr) - Lot reposition management │ ├── 1701 Auto Reposition (autoReposition) │ ├── 1702 Lot Sampling (lotSampling) │ └── 1703 Smart Sampling (smartSampling) └── 180 System Monitor (systemMonitor) - System logs and monitoring ├── 1801 Online Users (onlineUser) ├── 1802 Login Logs (loginLog) ├── 1803 Operation Logs (operationLog) └── 1804 System Logs (systemLog) ``` ## Workflow Engine Design ### Core Concepts 1. **Step** - Minimum atomic operation unit - Process Step (P) - Measurement Step (M) - Split Step (S) - Merge Step (M) - Virtual Process Step (V) 2. **SubPlan** - Multiple steps with branch condition support 3. **Process** - Multiple subPlans with Rework and Loop support 4. **Flow** - Complete process flow composed of multiple processes ### Features - ✅ Flow branching and conditional judgments - ✅ Rework management (with specified limit) - ✅ Loop management (with specified limit) - ✅ Q-Time control (millisecond to day level) - ✅ Equipment group, product group, recipe group binding - ✅ Flow activation, freeze, OA approval - ✅ Version control and change management ## Quick Start ### Prerequisites - .NET 8.0 SDK - MySQL 8.0+ or PostgreSQL 12+ - Redis 6.x+ - RabbitMQ 3.9.x+ (optional) - Node.js 18+ - pnpm 8+ ### Installation Steps 1. **Clone Repository** ```bash git clone https://github.com/your-org/mes.git cd mes ``` 2. **Backend Setup** ```bash cd MESAPI dotnet restore dotnet build # Configure database connection in appsettings.json dotnet run ``` 3. **Frontend Setup** ```bash cd MESUI pnpm install pnpm dev ``` 4. **Database Initialization** ```bash # Run database migrations dotnet ef database update ``` ### Configuration #### appsettings.json ```json { "ConnectionStrings": { "Default": "Server=localhost;Database=MES;Uid=root;Pwd=your_password" }, "Redis": { "ConnectionString": "localhost:6379" }, "RabbitMQ": { "HostName": "localhost", "Port": 5672, "UserName": "guest", "Password": "guest" } } ``` ## API Documentation After starting the backend service, visit: - Swagger Documentation: `http://localhost:5000/swagger` - API Version: `/api/v1` ## Module Details ### 1. WIP (Work In Process) - **Lot Creation**: Product selection and material consumption - **Lot Tracking**: Real-time status, location, process information - **Lot Operations**: Hold, release, skip, split, merge, scrap, recover - **Processing History**: Complete lot lifecycle records ### 2. Equipment Management - **Equipment Modeling**: Basic equipment information and attributes - **Equipment Group Management**: Equipment grouping and batch operations - **Status Monitoring**: Real-time equipment status and history - **Equipment Reservation**: Lot reservation for specific equipment ### 3. Quality Management (SPC) - **Chart Configuration**: Support for X-Bar, R, S and other control charts - **Rule Management**: WE1-WE9 Westgard rules - **OCAP Process**: Exception handling and corrective actions - **Real-time Monitoring**: Data collection and violation alerts ### 4. Special Features #### Auto Monitor Management - Equipment process validation - Post-PM validation - Auto-trigger mechanisms (By Batch/Time/Count) - Downgrade processing #### Season Management - Equipment process validation after idle - Chamber-level monitoring - Auto restriction release #### Pilot Wafer Management - Validation after long idle or run - Auto-trigger and retry mechanism - Split support ## Advanced Features ### 1. Distributed Workflow ```csharp // Example: Create and execute lot flow var workflowEngine = new DistributedWorkflowEngine(); await workflowEngine.ExecuteWorkflowAsync(new WorkflowRequest { LotId = "LOT001", FlowId = "FLOW-001", Priority = 1, Parameters = new Dictionary { ["Product"] = "PRODUCT-A", ["Quantity"] = 25 } }); ``` ### 2. Stream Data Processing ```csharp // Large batch measurement data processing await streamingProcessor.ProcessLargeDatasetAsync( dataStream, async data => { await spcService.CollectDataAsync(data); await auditLogger.LogAsync($"Collected data: {data.Id}"); } ); ``` ### 3. Audit Logs ```csharp // Immutable operation records await auditService.LogAsync(new AuditEvent { UserId = "USER001", Action = "LOT_TRACK_IN", TargetId = "LOT001", Data = JsonConvert.SerializeObject(lotData), PreviousHash = "0x..." }); ``` ## Target Users - Production operators and engineers - Quality control personnel - Equipment maintenance staff - Production planners and managers - System administrators ## System Features - Optimize production workflows and track manufacturing processes - Manage equipment, materials, lots (batches), and quality control - Integration with ERP, EAP (Equipment Automation Program), and SPC systems - Role-based access control and user groups - Complete audit logging ## Deployment Guide ### Docker Deployment ```bash # Build images docker-compose build # Start services docker-compose up -d ``` ### Kubernetes Deployment ```bash # Apply configuration kubectl apply -f k8s/ # Check status kubectl get pods -n mes ``` ## Development Standards ### Code Standards - C# follows Microsoft coding conventions - TypeScript follows ESLint rules - Commit messages follow Conventional Commits ### Branch Strategy - main: Production environment - develop: Development environment - feature/*: Feature branches - hotfix/*: Emergency fixes ## Contributing 1. Fork the project 2. Create feature branch 3. Commit code 4. Create Pull Request ## License This project is licensed under the MIT License. See [LICENSE](LICENSE) file for details. ## Contact Us - Project URL: https://github.com/your-org/mes - Issue Tracking: https://github.com/your-org/mes/issues - Email: mes-support@yourcompany.com ## Changelog ### v2.0.0 (2025-12-14) - Completed system modular refactoring - Added distributed workflow engine - Full upgrade to .NET 10 - Frontend fully adopted Composition API - Added quality management and SPC modules - Enhanced equipment management and lot tracking ### v1.0.0 (2023-12-01) - Project initialization - Basic functionality implementation