#ifndef QUALITYRECORD_H #define QUALITYRECORD_H #include "order.h" #include "workpiece.h" #include #include #include struct InspectionRecord { int id = 0; int orderId = 0; int workpieceId = 0; QString orderNo; QString barcode; int trayId = 0; QString trayCode; int trayPos = 0; QString inspectionSide; QString inspectionMode; int attemptNo = 0; int rawResult = -1; QString resultState; QString inspectionState; QString source; int plcStep = 0; QString message; QDateTime startedAt; QDateTime completedAt; int durationMs = -1; QDateTime createdAt; }; struct QualityStatistics { int planNum = 0; int completedCount = 0; int pendingCount = 0; int okCount = 0; int ngCount = 0; int inspectionCount = 0; int frontOkCount = 0; int frontNgCount = 0; int backOkCount = 0; int backNgCount = 0; double qualifiedRate = 0.0; }; struct QualityProcessRecord { QString processStep; int attemptNo = 0; QString processState; QString resultState; int plcStep = 0; QString source; int durationMs = -1; QDateTime startedAt; QDateTime completedAt; }; struct QualityStateHistory { QString fromState; QString toState; QString processStep; QString source; QString reason; QString message; int elapsedMs = -1; QDateTime changedAt; }; #endif // QUALITYRECORD_H