编辑 | blame | 历史 | 原始文档

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

LB_PdaService (蓝宝PDA后台) is a .NET 8 Web API service designed for PDA (Personal Digital Assistant) backend operations in a MES (Manufacturing Execution System). The service provides REST APIs for warehouse management, production order management, quality control, and ERP integration.

Build and Run Commands

# Build the project
dotnet build

# Run the project in development
dotnet run

# Publish for production
dotnet publish -c Release

The application runs on ASP.NET Core 8.0 and exposes Swagger documentation at /swagger in development mode.

Architecture and Code Structure

Core Components

  • Controllers/: REST API endpoints organized by functional domains
  • BaseController.cs: Base class providing RequestInfo injection for all controllers
  • Domain-specific folders: Warehouse/, QC/, Wom/, JJGZ/, Kingdee/
  • LoginController.cs and AuthController.cs: Authentication endpoints
  • service/: Business logic managers following a manager pattern

  • Organized by functional domains matching controller structure
  • Each manager handles specific entity operations and business rules
  • Names follow pattern Mes[Entity]Manager.cs
  • entity/: Data models and DTOs

  • Domain entities for database mapping
  • Extensive collection of MES-related entities (inventory, production, quality control)
  • Base/: Shared base entities like RequestInfo
  • util/: Utility classes and helpers

  • DbHelperSQL.cs: Database access abstraction layer
  • AppsettingsUtility.cs: Configuration management
  • Various helpers for logging, string operations, and API communication

Data Access Pattern

The application uses a custom database access layer (DbHelperSQL) rather than Entity Framework. Database connections are managed through the AppSettings.DataBaseConn configuration value.

Configuration

  • appsettings.json: Contains database connection strings and ERP service URLs
  • Configuration is injected through AppsettingsUtility and accessed via AppSettings class
  • Database connection string format: SQL Server with encryption enabled

Key Architectural Patterns

  1. Manager Pattern: Business logic is encapsulated in manager classes in the service/ directory
  2. Base Controller Pattern: Common functionality shared through BaseController
  3. Custom Data Access: Direct SQL execution through DbHelperSQL utility
  4. Configuration Injection: Settings injected through custom utility class
  5. Domain Separation: Code organized by business domains (Warehouse, Production, QC, etc.)

Integration Points

  • ERP Integration: Service communicates with external ERP systems via configured URLs
  • Database: SQL Server database with MES schema
  • CORS: Configured to allow cross-origin requests for API consumers

Development Notes

  • The codebase uses Chinese comments and naming conventions
  • Swagger is enabled in development for API documentation
  • JSON responses use camelCase naming convention
  • DateTime format: "yyyy-MM-dd HH:mm:ss"
  • No built-in test framework detected in the project structure