LMES Outbound Collection Logic Detailed Explanation
1. Overview
Outbound collection (Outbound) refers to the data collection and processing operations performed when a product completes the processing of a certain process and leaves the workstation. It is a key node for production progress tracking and quality control.
2. Logical Flow
2.1 Trigger Method
- Manual Trigger: The worker clicks the "Complete" button on the screen.
- Scan Trigger: Scan the product barcode or tray barcode.
- Signal Trigger: The PLC sends the processing completion signal.
2.2 Processing Steps
- Status Check: Check if the current product status is "Processing".
- Data Collection:
- Read equipment parameters (temperature, pressure, torque, etc.).
- Read material consumption information (batch number, quantity).
- Read quality inspection results (OK/NG).
- Business Logic Execution:
- Pass: Update the product process status to "Completed", write the pass record, and release the next process.
- Fail: Trigger the defect handling process (repair/scrap), lock the routing.
- Data Persistence: Save the collection data to
T_MES_ProcessDataandT_MES_Trace. - Output Control: Send the release or intercept instruction to the PLC.
3. Code Implementation
The core logic is located in OutboundDomainService.
public async Task ProcessOutboundAsync(OutboundInput input)
{
// 1. Validation
var product = await _productRepository.GetAsync(input.ProductId);
ValidateStatus(product);
// 2. Collect Data
var processData = MapToProcessData(input.Data);
await _processDataRepository.InsertAsync(processData);
// 3. Quality Check
if (input.IsNg)
{
await HandleNgAsync(product, input);
}
else
{
await HandleOkAsync(product);
}
// 4. Save
await _unitOfWork.SaveChangesAsync();
}
4. Precautions
- Data Integrity: Ensure that all mandatory collection items have been obtained before submission.
- Concurrency Control: Use optimistic locking to prevent repeated outbound operations for the same product.
- Timeout Handling: If the equipment data collection times out, a retry or manual input mechanism should be provided.