Fixed a bug in obj_WO_Mat_Log('Post') function that would fail to properly process transactions out of order
This commit is contained in:
@ -30,8 +30,7 @@ $Insert NICA_ORDERS_EQUATES
|
|||||||
$Insert NICA_CHECKLISTS_EQUATES
|
$Insert NICA_CHECKLISTS_EQUATES
|
||||||
$Insert NICA_ORDERS_CHECKLISTS_EQUATES
|
$Insert NICA_ORDERS_CHECKLISTS_EQUATES
|
||||||
$Insert RLIST_EQUATES
|
$Insert RLIST_EQUATES
|
||||||
|
$Insert TIME_INSERTS
|
||||||
Equ SECONDS_IN_DAY$ to 86400
|
|
||||||
|
|
||||||
Declare function Environment_Services, Database_Services, Error_Services, Logging_Services, Nica_Orders_Services
|
Declare function Environment_Services, Database_Services, Error_Services, Logging_Services, Nica_Orders_Services
|
||||||
Declare function Httpclient_Services, SRP_JSON, Reactor_Services, Reactor_Log_Services, SRP_Array, Datetime
|
Declare function Httpclient_Services, SRP_JSON, Reactor_Services, Reactor_Log_Services, SRP_Array, Datetime
|
||||||
|
@ -1258,10 +1258,11 @@ AddInvTrans:
|
|||||||
END
|
END
|
||||||
END
|
END
|
||||||
|
|
||||||
OtParms = FieldStore(OtParms,@RM,4,0,WOMatRec) ;* Put record in 4th field of OtParms
|
OtParms = FieldStore(OtParms,@RM,4,0,WOMatRec) ;* Put record in 4th field of OtParms
|
||||||
|
LogPos = ''
|
||||||
Done = False$
|
ThisEntryAction = ''
|
||||||
NumAttempts = 0
|
Done = False$
|
||||||
|
NumAttempts = 0
|
||||||
Loop
|
Loop
|
||||||
NumAttempts += 1
|
NumAttempts += 1
|
||||||
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, False$)
|
Database_Services('WriteDataRow', 'WO_MAT', WOMatKey, WOMatRec, True$, False$, False$)
|
||||||
@ -1310,27 +1311,39 @@ AddInvTrans:
|
|||||||
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objLogInvTransError, LogData, @RM, @FM)
|
||||||
end
|
end
|
||||||
WOMatRecVerify = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
|
WOMatRecVerify = Database_Services('ReadDataRow', 'WO_MAT', WOMatKey)
|
||||||
LastEntryIndex = DCount(WOMatRecVerify<WO_MAT_INV_WH$>, @VM)
|
If Pos EQ -1 then
|
||||||
LastEntryAction = WOMatRecVerify<WO_MAT_INV_ACTION$, LastEntryIndex>
|
LastEntryIndex = DCount(WOMatRecVerify<WO_MAT_INV_WH$>, @VM)
|
||||||
LastEntryLocCd = WOMatRecVerify<WO_MAT_INV_LOCATION$, LastEntryIndex>
|
LogPos = LastEntryIndex
|
||||||
If LastEntryAction EQ InvAction AND LastEntryLocCd = LocCd then
|
ThisEntryAction = WOMatRecVerify<WO_MAT_INV_ACTION$, LastEntryIndex>
|
||||||
Done = True$
|
ThisEntryLocCd = WOMatRecVerify<WO_MAT_INV_LOCATION$, LastEntryIndex>
|
||||||
|
If ThisEntryAction EQ InvAction AND ThisEntryLocCd = LocCd then
|
||||||
|
Done = True$
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
LogPos = Pos
|
||||||
|
ThisEntryAction = WOMatRecVerify<WO_MAT_INV_ACTION$, Pos>
|
||||||
|
ThisEntryLocCd = WOMatRecVerify<WO_MAT_INV_LOCATION$, Pos>
|
||||||
|
If ThisEntryAction EQ InvAction AND ThisEntryLocCd = LocCd then
|
||||||
|
Done = True$
|
||||||
|
end
|
||||||
end
|
end
|
||||||
Until ( (Done EQ True$) or (NumAttempts EQ 10) )
|
Until ( (Done EQ True$) or (NumAttempts EQ 10) )
|
||||||
Repeat
|
Repeat
|
||||||
|
|
||||||
|
If LogPos EQ '' then LogPos = DCount(WOMatRecVerify<WO_MAT_INV_DTM$>, @VM)
|
||||||
|
|
||||||
LogData = ''
|
LogData = ''
|
||||||
LogData<1> = WOMatRecVerify<WO_MAT_INV_DTM$, LastEntryIndex>
|
LogData<1> = WOMatRecVerify<WO_MAT_INV_DTM$, LogPos>
|
||||||
LogData<2> = WONo
|
LogData<2> = WONo
|
||||||
LogData<3> = CassNo
|
LogData<3> = CassNo
|
||||||
LogData<4> = WOMatRecVerify<WO_MAT_INV_USER$, LastEntryIndex>
|
LogData<4> = WOMatRecVerify<WO_MAT_INV_USER$, LogPos>
|
||||||
LogData<5> = LastEntryIndex
|
LogData<5> = LogPos
|
||||||
LogData<6> = WOMatRecVerify<WO_MAT_INV_TAG$, LastEntryIndex>
|
LogData<6> = WOMatRecVerify<WO_MAT_INV_TAG$, LogPos>
|
||||||
LogData<7> = WOMatRecVerify<WO_MAT_INV_WH$, LastEntryIndex>
|
LogData<7> = WOMatRecVerify<WO_MAT_INV_WH$, LogPos>
|
||||||
LogData<8> = WOMatRecVerify<WO_MAT_INV_LOCATION$, LastEntryIndex>
|
LogData<8> = WOMatRecVerify<WO_MAT_INV_LOCATION$, LogPos>
|
||||||
LogData<9> = LastEntryAction
|
LogData<9> = ThisEntryAction
|
||||||
LogData<10> = WOMatRecVerify<WO_MAT_INV_TOOL_ID$, LastEntryIndex>
|
LogData<10> = WOMatRecVerify<WO_MAT_INV_TOOL_ID$, LogPos>
|
||||||
LogData<11> = WOMatRecVerify<WO_MAT_INV_SCAN_ENTRY$, LastEntryIndex>
|
LogData<11> = WOMatRecVerify<WO_MAT_INV_SCAN_ENTRY$, LogPos>
|
||||||
LogData<12> = NumAttempts
|
LogData<12> = NumAttempts
|
||||||
Logging_Services('AppendLog', WOMatObjLog3, LogData, @RM, @FM)
|
Logging_Services('AppendLog', WOMatObjLog3, LogData, @RM, @FM)
|
||||||
|
|
||||||
@ -5735,6 +5748,3 @@ ExpCOA:
|
|||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,9 +41,11 @@ Function OI_Wizard_Actions(Action, CalcColName, FSList, Handle, Name, FMC, Recor
|
|||||||
***********************************************************************************************************************/
|
***********************************************************************************************************************/
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
|
|
||||||
$insert LOGICAL
|
$Insert LOGICAL
|
||||||
$insert FILE.SYSTEM.EQUATES
|
$Insert FILE.SYSTEM.EQUATES
|
||||||
$insert ACTION_SETUP
|
$Insert ACTION_SETUP
|
||||||
|
$Insert OI_WIZARD_EQUATES
|
||||||
|
$Insert TIME_INSERTS
|
||||||
|
|
||||||
Declare function UCase, Utility_DotNet, Database_Services, Error_Services, Datetime
|
Declare function UCase, Utility_DotNet, Database_Services, Error_Services, Datetime
|
||||||
|
|
||||||
@ -140,12 +142,10 @@ VALID:
|
|||||||
LastDate = {CREATED_DATE}
|
LastDate = {CREATED_DATE}
|
||||||
LastTime = {CREATED_TIME}
|
LastTime = {CREATED_TIME}
|
||||||
end
|
end
|
||||||
lastDateTime = Iconv(Oconv(LastDate, 'D4/') : ' ' : Oconv(LastTime, 'MTS'), 'DTS')
|
LastDateTime = Iconv(Oconv(LastDate, 'D4/') : ' ' : Oconv(LastTime, 'MTS'), 'DTS')
|
||||||
SessionAge = (Datetime() - lastDateTime) * 86400
|
SessionAge = (Datetime() - LastDateTime) * SECONDS_IN_DAY$
|
||||||
// 600 seconds = 10 minutes
|
MaxAge = HOUR_IN_SECONDS$ * 12
|
||||||
If SessionAge LT 600 then
|
If SessionAge LT MaxAge then Valid = True$
|
||||||
Valid = True$
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
ActionFlow = Valid
|
ActionFlow = Valid
|
||||||
|
|
||||||
@ -164,8 +164,9 @@ EXPIRY:
|
|||||||
LastTime = {CREATED_TIME}
|
LastTime = {CREATED_TIME}
|
||||||
end
|
end
|
||||||
lastDateTime = Iconv(Oconv(LastDate, 'D4/') : ' ' : Oconv(LastTime, 'MTS'), 'DTS')
|
lastDateTime = Iconv(Oconv(LastDate, 'D4/') : ' ' : Oconv(LastTime, 'MTS'), 'DTS')
|
||||||
// Set expiry to last updated datetime (i.e. last time the session was updated/validated) plus 10 minutes
|
// Set expiry to last updated datetime (i.e. last time the session was updated/validated)
|
||||||
Expiry = lastDateTime + (600 / 86400)
|
// plus 12 hours (0.5 of a day).
|
||||||
|
Expiry = lastDateTime + 0.5
|
||||||
end
|
end
|
||||||
ActionFlow = Expiry
|
ActionFlow = Expiry
|
||||||
|
|
||||||
@ -288,3 +289,4 @@ Restore_System_Variables:
|
|||||||
@FILE.ERROR = OrigFileError
|
@FILE.ERROR = OrigFileError
|
||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
Compile function OI_Wizard_Services(@Service, @Params)
|
Compile function OI_Wizard_Services(@Service, @Params)
|
||||||
#pragma precomp SRP_PreCompiler
|
#pragma precomp SRP_PreCompiler
|
||||||
$insert LOGICAL
|
$Insert LOGICAL
|
||||||
$insert OI_WIZARD_EQUATES
|
$Insert OI_WIZARD_EQUATES
|
||||||
$insert OI_WIZARD_TRANSACTIONS_EQUATES
|
$Insert OI_WIZARD_TRANSACTIONS_EQUATES
|
||||||
$Insert REACT_MODE_NG_EQUATES
|
$Insert REACT_MODE_NG_EQUATES
|
||||||
|
$Insert TIME_INSERTS
|
||||||
|
|
||||||
Declare function RTI_CreateGUID, Database_Services, Error_Services, SRP_Json, MemberOf
|
Declare function RTI_CreateGUID, Database_Services, Error_Services, SRP_Json, MemberOf
|
||||||
Declare function OI_Wizard_Services, Reactor_Services, Reactor_Modes_Services, Datetime
|
Declare function OI_Wizard_Services, Reactor_Services, Reactor_Modes_Services, Datetime
|
||||||
@ -198,9 +199,9 @@ Service ValidateSession(OIWizardID)
|
|||||||
LastTime = OIWizardRec<OI_WIZARD.CREATED_TIME$>
|
LastTime = OIWizardRec<OI_WIZARD.CREATED_TIME$>
|
||||||
end
|
end
|
||||||
lastDateTime = Iconv(Oconv(LastDate, 'D4/') : ' ' : Oconv(LastTime, 'MTS'), 'DTS')
|
lastDateTime = Iconv(Oconv(LastDate, 'D4/') : ' ' : Oconv(LastTime, 'MTS'), 'DTS')
|
||||||
SessionAge = (Datetime() - lastDateTime) * 86400
|
SessionAge = (Datetime() - lastDateTime) * SECONDS_IN_DAY$
|
||||||
// 600 seconds = 10 minutes
|
MaxAge = HOUR_IN_SECONDS$ * 12
|
||||||
If SessionAge LT 600 then
|
If SessionAge LT MaxAge then
|
||||||
OIWizardRec<OI_WIZARD.UPDATED_DATES$, -1> = Date()
|
OIWizardRec<OI_WIZARD.UPDATED_DATES$, -1> = Date()
|
||||||
OIWizardRec<OI_WIZARD.UPDATED_TIMES$, -1> = Time()
|
OIWizardRec<OI_WIZARD.UPDATED_TIMES$, -1> = Time()
|
||||||
Database_Services('WriteDataRow', 'OI_WIZARD', OIWizardID, OIWizardRec)
|
Database_Services('WriteDataRow', 'OI_WIZARD', OIWizardID, OIWizardRec)
|
||||||
@ -498,11 +499,3 @@ Service ConvertMVTransactionToJSON(TransactionID, mvTransaction, itemURL)
|
|||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,9 +58,9 @@ $Insert NICA_ORDERS_EQUATES
|
|||||||
$Insert REACTOR_INJECTOR_SETTINGS_EQUATES
|
$Insert REACTOR_INJECTOR_SETTINGS_EQUATES
|
||||||
$Insert REACTOR_RATIOS_EQUATES
|
$Insert REACTOR_RATIOS_EQUATES
|
||||||
$Insert REACT_STATE_EQUATES
|
$Insert REACT_STATE_EQUATES
|
||||||
|
$Insert TIME_INSERTS
|
||||||
|
|
||||||
Equ WOCust$ to 2
|
Equ WOCust$ to 2
|
||||||
Equ SECONDS_IN_DAY$ to 86400
|
|
||||||
|
|
||||||
// Uptime Percentage Equates
|
// Uptime Percentage Equates
|
||||||
Equ PRODUCTIVE$ to 1
|
Equ PRODUCTIVE$ to 1
|
||||||
@ -4515,4 +4515,3 @@ ClearCursors:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
17
LSL2/STPROCINS/TIME_INSERTS.txt
Normal file
17
LSL2/STPROCINS/TIME_INSERTS.txt
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
Compile Insert TIME_INSERTS
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
#IFNDEF _TIME_INSERTS_
|
||||||
|
#DEFINE _TIME_INSERTS_
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
Equ SECONDS_IN_DAY$ to 86400
|
||||||
|
Equ HOUR_IN_SECONDS$ to 3600
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
#ENDIF
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Reference in New Issue
Block a user