Production tracing bug fix II.
This commit is contained in:
parent
bdf3d155f4
commit
cc88308513
@ -406,6 +406,7 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
///
|
||||
IList<object[]> records = session.QueryOver<ReferenceRecord>(() => refRecord)
|
||||
.Where(rr => (rr.Code == wm.SerialNr))
|
||||
.OrderBy(rr => rr.TimeStamp).Asc
|
||||
.JoinQueryOver<Workstep>(rr => rr.Workstep, () => workstep)
|
||||
.And(ws => (ws.Name != WorkstepName))
|
||||
.Select(projections)
|
||||
@ -425,7 +426,6 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
/// Get processId of the last record
|
||||
///
|
||||
int lastProcessId = 0;
|
||||
int lastResult = 0;
|
||||
DateTime lastTimeStamp = DateTime.MinValue;
|
||||
foreach (var rcrd in records)
|
||||
{
|
||||
@ -433,7 +433,6 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
{
|
||||
lastTimeStamp = (DateTime)rcrd[3];
|
||||
lastProcessId = (int)rcrd[2];
|
||||
lastResult = (int)rcrd[4];
|
||||
}
|
||||
}
|
||||
|
||||
@ -478,10 +477,11 @@ namespace TBF.Rig.Output.DB.ProductionTracing
|
||||
wm.LastRecordIsNok = true; /// NOK (=default if no matching record found)
|
||||
foreach (var rcrd in records)
|
||||
{
|
||||
if ((verifiedWorkstep.Id == (int)rcrd[1]) && (lastProcessId == (int)rcrd[2]) && (int)rcrd[4] == WorkstepRsltOK)
|
||||
if ((verifiedWorkstep.Id == (int)rcrd[1]) && (lastProcessId == (int)rcrd[2]))
|
||||
{
|
||||
/// This record fits verification requirements
|
||||
wm.LastRecordIsNok = false; /// OK
|
||||
/// This record fits verification requirements.
|
||||
/// As records are ordered by time, the result of the last one determines the verification result.
|
||||
wm.LastRecordIsNok = ((int)rcrd[4] != WorkstepRsltOK);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user