Cosmetics Production Ledger Summary and Report Generation: Deployment and Upgrade

Data originates from registered or filed formulas, raw material safety documents, weighing and emulsification equipment, ERP/MES systems, laboratory

What Data Looks Like for This Category

Data originates from registered or filed formulas, raw material safety documents, weighing and emulsification equipment, ERP/MES systems, laboratory, and packaging material version management modules. Daily documents include formula work orders, weighing and feeding records, emulsification or filling records, cleaning and sanitization records, semi-finished and finished product inspection reports, and label review forms. Data updates trigger per production batch or line change. Fields cover restricted substance content, emulsification temperature, production batch number, packaging material version number, and other relevant fields. All data must meet cosmetics filing compliance requirements.

Constraints During Deployment and Upgrade

High-frequency data updates per production batch or line change require deployed data source synchronization mechanisms to align with production rhythms, and avoid data delays. Mixed structured and unstructured storage for multiple document types requires matching configurations for different databases and object storage. Cosmetics production compliance requirements require strict access control for the ledger summary function, to ensure data is only accessible to authorized personnel. Integration with ERP/MES and laboratory systems requires stable connections, to prevent production processes from being disrupted by data synchronization interruptions.

Configuration Settings

Configuration ItemRecommended SettingRationale
MONGODB_URIPoints to the enterprise ERP/MES synchronized ledger database, with read and write permission parametersCosmetics production ledgers require high-frequency reading and writing of batch production data, requiring a stable database connection
PG_URLPoints to the formula and filing verification database, with a connection timeout set to 30 secondsFormula verification requires stable structured data queries; the timeout configuration prevents blocking production processes
REDIS_URLPoints to the production batch cache instance, with a memory quota set to 1000 MBCaches temporary ledger data after line changes, avoiding repeated queries to historical databases
STORAGE_S3_ENDPOINTPoints to the enterprise private object storage endpoint, with a chunked upload threshold set to 800–1200 charactersStores large volumes of documents such as cleaning records and inspection reports, adapting to upload requirements for multiple document types
DB_MAX_LINKSet to a maximum of 20 concurrent connectionsControls database connection count, preventing excessive occupation of database resources by production systems
ROOT_KEYConfigured as a key accessible only to authorized production management departmentsRestricts access to the ledger summary function, complying with cosmetics production compliance requirements

Three Common Misconfigurations

  • Symptom: After upgrading FastGPT v4.17.0, refreshing the production ledger conversation page shows empty summary records for historical batches, and only newly created conversations are displayed. Cause: REDIS_URL is not correctly configured to point to the production batch cache instance, resulting in loss of conversation context session data.
  • Symptom: A "database connection timeout" error occurs when calling the ledger summary function. Cause: The connection timeout configuration for PG_URL is too short, failing to adapt to batch data query delays from the ERP system.
  • Symptom: Uploaded cleaning and sanitization records cannot be correctly associated with the corresponding production batch. Cause: The encryption key for FILE_TOKEN_KEY is misconfigured, preventing correct binding of file metadata to ledger fields.

How to Verify Correct Configuration

  • Run the built-in database connection test tool to verify that the connection status of MONGODB_URI and PG_URL is normal, with no timeout or permission errors.
  • Upload a simulated cleaning and sanitization record to confirm that the file can be stored normally and associated with the specified production batch, verifying that STORAGE_S3_ENDPOINT and FILE_TOKEN_KEY configurations are valid.
  • Initiate a batch ledger summary request to confirm that the returned results include relevant document fields for this category, such as formula work orders and weighing and feeding records, verifying that the data source configuration is correct.
  • Check access permissions to confirm that only authorized production management department accounts can access the ledger summary function, verifying that the ROOT_KEY configuration takes effect.

The values provided here are common starting points, and should be evaluated against the user’s own specific samples.