# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Project Overview This is a .NET 8 MES (Manufacturing Execution System) solution built with ASP.NET Core Web API. The system is organized as a modular monolith with domain-separated projects for different business areas. ## Solution Structure The solution follows a modular architecture with these main projects: - **Gs.HostIIS**: Main Web API host application with Swagger documentation - **Gs.Entity**: Data entities organized by business domains (BaseInfo, QC, Sys, Warehouse) - **Gs.Toolbox**: Core utilities, API framework, and dependency injection infrastructure - **Business Modules**: - **Gs.BaseInfo**: Basic information management (items, customers, suppliers, staff, etc.) - **Gs.Warehouse**: Inventory and warehouse management - **Gs.QC** / **GS.QC**: Quality control functionality - **Gs.Sys**: System administration and user management - **Gs.Report**: Reporting functionality - **Gs.Wom**: Work order management - **Gs.Sales**: Sales management - **Gs.Pda**: Mobile/handheld device support - **Gs.QiTaCk** / **Gs.QiTaRk**: Additional business modules - **Gs.Ww**: Additional functionality ## Development Commands ### Build and Run - Build entire solution: `dotnet build GsMesSolution.sln` - Run main API: `dotnet run --project Gs.HostIIS` - Build specific project: `dotnet build Gs.ProjectName/Gs.ProjectName.csproj` ### Development Server - The API runs on `http://localhost:5263` (or `http://localhost:37005` via IIS Express) - Swagger UI is available at `/swagger` endpoint - CORS is configured to allow all origins for development ## Architecture Details ### Custom API Framework The solution uses a custom API framework built in `Gs.Toolbox`: - Custom dependency injection with lifecycle attributes (`ITransient`, `IScope`, `ISingleton`) - Custom controller convention and routing - API grouping for Swagger documentation via `ApiGroupAttribute` - Custom authorization with `ApiAuthorizeAttribute` ### Data Access - Uses SqlSugar ORM for database operations - Connection string configured in `appsettings.json` - Repository pattern implemented in `Gs.Toolbox/Repository.cs` ### Configuration - Database: SQL Server (connection string in appsettings.json) - External services: ERP integration endpoints configured - File paths: Services, logs, upload, and download paths configured - Custom JSON serialization with Newtonsoft.Json ### Key Components - **CustomContractResolver**: Custom JSON property naming - **ResponseResult**: Standardized API response format - **ExcelHelper**: Excel import/export functionality - **LogHelper**: Logging utilities - **DbHelperSQL**: Additional database utilities ## Business Domains The system handles typical MES functionality: - Base information (items, customers, suppliers, departments, staff) - Quality control and inspection - Warehouse and inventory management - Work order management - Reporting and analytics - Mobile device integration ## Development Notes - All projects target .NET 8.0 - Nullable reference types are enabled - The system uses a Chinese interface (comments and some naming in Chinese) - Custom API framework provides dependency injection and controller conventions - Swagger documentation is automatically generated with XML comments