modified service to dispatch a single job at a time to avoid clogging up the SRP Engine Server
This commit is contained in:
@ -8,7 +8,7 @@ COMPILE FUNCTION Comm_WO_Rec(Instruction, Parm1,Parm2)
|
|||||||
|
|
||||||
DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, obj_Notes, Print_RX_Voucher, obj_Tables
|
DECLARE SUBROUTINE Set_Property, Set_Status, ErrMsg, Set_Property, obj_AppWindow, obj_Notes, Print_RX_Voucher, obj_Tables
|
||||||
DECLARE SUBROUTINE Btree.Extract, Send_Event, Security_Err_Msg, Forward_Event, End_Window, obj_WO_Log, obj_WO_Mat
|
DECLARE SUBROUTINE Btree.Extract, Send_Event, Security_Err_Msg, Forward_Event, End_Window, obj_WO_Log, obj_WO_Mat
|
||||||
DECLARE SUBROUTINE Logging_Services, Post_Event, Work_Order_Services, Error_Services, Database_Services
|
DECLARE SUBROUTINE Logging_Services, Post_Event, Work_Order_Services, Error_Services, Database_Services, Service_Services
|
||||||
DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, RowExists, obj_Prod_Spec
|
DECLARE FUNCTION Get_Property, Get_Status, Popup, Send_Message, Msg, Security_Check, Dialog_Box, RowExists, obj_Prod_Spec
|
||||||
DECLARE FUNCTION obj_Schedule, Dialog_Box, obj_WO_Log, obj_Order_Det, FindWindow,ShowWindow, obj_Tables, obj_WO_Mat, MemberOf
|
DECLARE FUNCTION obj_Schedule, Dialog_Box, obj_WO_Log, obj_Order_Det, FindWindow,ShowWindow, obj_Tables, obj_WO_Mat, MemberOf
|
||||||
DECLARE FUNCTION Logging_Services, Environment_Services, Work_Order_Services, Error_Services, Service_Services
|
DECLARE FUNCTION Logging_Services, Environment_Services, Work_Order_Services, Error_Services, Service_Services
|
||||||
@ -647,6 +647,8 @@ Scan:
|
|||||||
end
|
end
|
||||||
Logging_Services('AppendLog', objReceiveLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objReceiveLog, LogData, @RM, @FM)
|
||||||
|
|
||||||
|
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateWorkOrderData':SD$:WONo)
|
||||||
|
|
||||||
Post_Event(@Window, 'READ')
|
Post_Event(@Window, 'READ')
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -931,4 +933,3 @@ AddLeftover:
|
|||||||
|
|
||||||
RETURN
|
RETURN
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ Declare subroutine obj_WO_Mat, obj_Post_Log
|
|||||||
Declare function SRP_Array, Work_Order_Services, Memory_Services, Database_Services, SRP_Sort_Array, SRP_JSON
|
Declare function SRP_Array, Work_Order_Services, Memory_Services, Database_Services, SRP_Sort_Array, SRP_JSON
|
||||||
Declare function Company_Services, obj_Prod_Spec, Schedule_Services, obj_WO_Log, obj_WO_Step, Memberof, Datetime
|
Declare function Company_Services, obj_Prod_Spec, Schedule_Services, obj_WO_Log, obj_WO_Step, Memberof, Datetime
|
||||||
Declare function Environment_Services, Logging_Services, Hold_Services, Signature_Services, Lot_Services
|
Declare function Environment_Services, Logging_Services, Hold_Services, Signature_Services, Lot_Services
|
||||||
Declare function SRP_Datetime, RTI_CreateGUID, RDS_Services
|
Declare function SRP_Datetime, RTI_CreateGUID, RDS_Services, UCase
|
||||||
|
|
||||||
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
|
LogPath = Environment_Services('GetApplicationRootPath') : '\LogFiles\WO_LOG'
|
||||||
LogDate = Oconv(Date(), 'D4/')
|
LogDate = Oconv(Date(), 'D4/')
|
||||||
@ -2100,16 +2100,35 @@ Service UpdateOpenWorkOrderData()
|
|||||||
Extract_Si_Keys('WO_LOG', 'CLOSE_DATE', '', OpenWoLogKeys)
|
Extract_Si_Keys('WO_LOG', 'CLOSE_DATE', '', OpenWoLogKeys)
|
||||||
If Not(Get_Status(ErrCode)) then
|
If Not(Get_Status(ErrCode)) then
|
||||||
If OpenWoLogKeys NE '' then
|
If OpenWoLogKeys NE '' then
|
||||||
For each OpenWoLogKey in OpenWoLogKeys using @VM
|
OpenWoLogKeys = SRP_Array('SortSimpleList', OpenWoLogKeys, 'AscendingNumbers', @VM)
|
||||||
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateWorkOrderData':SD$:OpenWOLogKey)
|
LastOpenWoUpdated = ''
|
||||||
If Error_Services('HasError') then
|
ServiceKey = UCase(Service)
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
If RowExists('APP_INFO', ServiceKey) then
|
||||||
ErrorMsg = Error_Services('GetMessage')
|
LastOpenWoUpdated = Database_Services('ReadDataRow', 'APP_INFO', ServiceKey)
|
||||||
LogData<4> = ErrorMsg
|
end
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
If (LastOpenWoUpdated NE '') then
|
||||||
MonaStatus = 'critical'
|
Locate LastOpenWoUpdated in OpenWoLogKeys using @VM setting vPos then
|
||||||
end
|
vPos += 1
|
||||||
Next OpenWoLogKey
|
end else
|
||||||
|
vPos = 1
|
||||||
|
end
|
||||||
|
end else
|
||||||
|
vPos = 1
|
||||||
|
end
|
||||||
|
NextOpenWoLogKey = OpenWoLogKeys<0, vPos>
|
||||||
|
Database_Services('WriteDataRow', 'APP_INFO', ServiceKey, NextOpenWoLogKey, True$, False$, False$)
|
||||||
|
|
||||||
|
If NextOpenWoLogKey NE '' then
|
||||||
|
Service_Services('PostProcedure', 'WORK_ORDER_SERVICES', 'UpdateWorkOrderData':SD$:NextOpenWoLogKey)
|
||||||
|
end
|
||||||
|
|
||||||
|
If Error_Services('HasError') then
|
||||||
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
|
ErrorMsg = Error_Services('GetMessage')
|
||||||
|
LogData<4> = ErrorMsg
|
||||||
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
|
MonaStatus = 'critical'
|
||||||
|
end
|
||||||
end else
|
end else
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
LogData<4> = 'No open work orders to update.'
|
LogData<4> = 'No open work orders to update.'
|
||||||
@ -2136,7 +2155,7 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
Service UpdateWorkOrderData(WONo)
|
Service UpdateWorkOrderData(WONo)
|
||||||
|
|
||||||
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
hSysLists = Database_Services('GetTableHandle', 'SYSLISTS')
|
||||||
Lock hSysLists, ServiceKeyID:'*':WONo then
|
Lock hSysLists, ServiceKeyID:'*':WONo then
|
||||||
|
|
||||||
@ -2175,52 +2194,34 @@ Service UpdateWorkOrderData(WONo)
|
|||||||
For CassNo = 1 to MAX_NUM_CASS$
|
For CassNo = 1 to MAX_NUM_CASS$
|
||||||
WOMatKey = WONo:'*':CassNo
|
WOMatKey = WONo:'*':CassNo
|
||||||
If RowExists('WO_MAT', WOMatKey) then
|
If RowExists('WO_MAT', WOMatKey) then
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
RDSNo = Xlate('WO_MAT', WOMatKey, 'RDS_NO', 'X')
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' exists...'
|
If (RDSNo NE '') then
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
RDS_Services('VerifyWOLogRDSKeyIndex', RDSNo)
|
||||||
Voided = Xlate('WO_MAT', WOMatKey, 'VOID', 'X')
|
RDS_Services('VerifyWOMatRDSNoIndex', RDSNo)
|
||||||
|
RDS_Services('VerifyWOStepRDSKeyIndex', RDSNo)
|
||||||
|
end
|
||||||
|
Voided = Xlate('WO_MAT', WOMatKey, 'VOID', 'X')
|
||||||
If Not(Voided) then
|
If Not(Voided) then
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
Locate WOMatKey in OrigWOLogWOMatKeys using @VM setting vPos else
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' not voided. Checking if it needs to be added to column...'
|
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
|
||||||
Locate WOMatKey in OrigWOLogWOMatKeys using @VM setting vPos then
|
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' found in WO_LOG record. Nothing to update.'
|
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
|
||||||
end else
|
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' not found in WO_LOG record. Adding WOMatKey to column.'
|
LogData<4> = 'WOMatKey ':WOMatKey:' exists and was not found in WO_LOG record. Adding to column.'
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
NewWOLogWOMatKeys<0, -1> = WOMatKey
|
NewWOLogWOMatKeys<0, -1> = WOMatKey
|
||||||
end
|
end
|
||||||
end else
|
end else
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' has been voided...'
|
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
|
||||||
Locate WOMatKey in NewWOLogWOMatKeys using @VM setting vPos then
|
Locate WOMatKey in NewWOLogWOMatKeys using @VM setting vPos then
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' found in WO_LOG record. Removing from column.'
|
LogData<4> = 'WOMatKey ':WOMatKey:' is voided and was found in WO_LOG record. Removing from column.'
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
NewWOLogWOMatKeys = Delete(NewWOLogWOMatKeys, 0, vPos, 0)
|
NewWOLogWOMatKeys = Delete(NewWOLogWOMatKeys, 0, vPos, 0)
|
||||||
end else
|
end
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
end
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' not found in WO_LOG record. Nothing to update.'
|
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end else
|
end else
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' does not exist. Checking if WOMatKey ':WOMatKey:' needs to be removed from column...'
|
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
|
||||||
Locate WOMatKey in NewWOLogWOMatKeys using @VM setting vPos then
|
Locate WOMatKey in NewWOLogWOMatKeys using @VM setting vPos then
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
LogData<1> = OConv(Datetime(), 'DT/^S')
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' found in WO_LOG record. Removing from column.'
|
LogData<4> = 'WOMatKey ':WOMatKey:' does not exist and was found in WO_LOG record. Removing from column.'
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
||||||
NewWOLogWOMatKeys = Delete(NewWOLogWOMatKeys, 0, vPos, 0)
|
NewWOLogWOMatKeys = Delete(NewWOLogWOMatKeys, 0, vPos, 0)
|
||||||
end else
|
|
||||||
LogData<1> = OConv(Datetime(), 'DT/^S')
|
|
||||||
LogData<4> = 'WOMatKey ':WOMatKey:' not found in WO_LOG record. Nothing to update.'
|
|
||||||
Logging_Services('AppendLog', objVerifyWOMatKeysLog, LogData, @RM, @FM)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Next CassNo
|
Next CassNo
|
||||||
|
Reference in New Issue
Block a user