pre cutover push
This commit is contained in:
@ -59,7 +59,7 @@ $Insert WO_MAT_QA_EQUATES
|
||||
equ WOCust$ to 2
|
||||
|
||||
Declare function Error_Services, Database_Services, Logging_Services, Environment_Services
|
||||
Declare subroutine Error_Services, Database_Services, Logging_Services, Set_Status
|
||||
Declare subroutine Error_Services, Database_Services, Logging_Services, Set_Status, Reactor_Log_Services
|
||||
|
||||
If KeyID then GoSub Initialize_System_Variables
|
||||
|
||||
@ -257,6 +257,107 @@ WRITE_RECORD_PRE:
|
||||
return
|
||||
|
||||
WRITE_RECORD:
|
||||
|
||||
OrigServIds = OrigRecord<REACTOR_LOG_REACT_SERV_ID$>
|
||||
NewServIds = Record<REACTOR_LOG_REACT_SERV_ID$>
|
||||
If OrigServIds NE NewServIds then
|
||||
// Check if particular service IDs were added or removed.
|
||||
// ID 240 - ASM Tube Change
|
||||
// ID 1280 - HTR Tube Change
|
||||
// ID 1275 - PM - Semi Annual
|
||||
// ID 1260 - PM - Annual
|
||||
ReactType = {REACT_TYPE}
|
||||
|
||||
AsmTubeChangeAdded = ( (Index(OrigServIds, 240, 1) EQ 0) and (Index(NewServIds, 240, 1) GT 0) )
|
||||
AsmTubeChangeRemoved = ( (Index(OrigServIds, 240, 1) GT 0) and (Index(NewServIds, 240, 1) EQ 0) )
|
||||
HtrTubeChangeAdded = ( (Index(OrigServIds, 1280, 1) EQ 0) and (Index(NewServIds, 1280, 1) GT 0) )
|
||||
HtrTubeChangeRemoved = ( (Index(OrigServIds, 1280, 1) GT 0) and (Index(NewServIds, 1280, 1) EQ 0) )
|
||||
SemiannualAdded = ( (Index(OrigServIds, 1275, 1) EQ 0) and (Index(NewServIds, 1275, 1) GT 0) )
|
||||
SemiannualRemoved = ( (Index(OrigServIds, 1275, 1) GT 0) and (Index(NewServIds, 1275, 1) EQ 0) )
|
||||
AnnualAdded = ( (Index(OrigServIds, 1260, 1) EQ 0) and (Index(NewServIds, 1260, 1) GT 0) )
|
||||
AnnualRemoved = ( (Index(OrigServIds, 1260, 1) GT 0) and (Index(NewServIds, 1260, 1) EQ 0) )
|
||||
FiveYearAdded = ( (Index(OrigServIds, 1264, 1) EQ 0) and (Index(NewServIds, 1264, 1) GT 0) )
|
||||
FiveYearRemoved = ( (Index(OrigServIds, 1264, 1) GT 0) and (Index(NewServIds, 1264, 1) EQ 0) )
|
||||
TenYearAdded = ( (Index(OrigServIds, 1265, 1) EQ 0) and (Index(NewServIds, 1265, 1) GT 0) )
|
||||
TenYearRemoved = ( (Index(OrigServIds, 1265, 1) GT 0) and (Index(NewServIds, 1265, 1) EQ 0) )
|
||||
|
||||
If (FiveYearAdded or TenYearAdded) then
|
||||
// Create NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
Reactor_Log_Services('CreateReactorLogPMOrder', Name, 'ASM_HTR_FIVE_AND_TEN_YEAR_PM')
|
||||
end
|
||||
end
|
||||
|
||||
If (FiveYearRemoved or TenYearRemoved) then
|
||||
// Cancel NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
ChecklistTypes = Record<REACTOR_LOG_CHECKLIST_TYPE$>
|
||||
ChecklistOrderIds = Record<REACTOR_LOG_CHECKLIST_ORDER_ID$>
|
||||
Locate 'ASM_HTR_FIVE_AND_TEN_YEAR_PM' in ChecklistTypes using @VM setting vPos then
|
||||
OrderId = ChecklistOrderIds<0, vPos>
|
||||
Reactor_Log_Services('CancelReactorLogPMOrder', Name, OrderId)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
If (AsmTubeChangeAdded or HtrTubeChangeAdded) then
|
||||
// Create NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
Reactor_Log_Services('CreateReactorLogPMOrder', Name, 'ASM_HTR_TUBE_CHANGE')
|
||||
end
|
||||
end
|
||||
|
||||
If (AsmTubeChangeRemoved or HtrTubeChangeRemoved) then
|
||||
// Cancel NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
ChecklistTypes = Record<REACTOR_LOG_CHECKLIST_TYPE$>
|
||||
ChecklistOrderIds = Record<REACTOR_LOG_CHECKLIST_ORDER_ID$>
|
||||
Locate 'ASM_HTR_TUBE_CHANGE' in ChecklistTypes using @VM setting vPos then
|
||||
OrderId = ChecklistOrderIds<0, vPos>
|
||||
Reactor_Log_Services('CancelReactorLogPMOrder', Name, OrderId)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
If SemiannualAdded then
|
||||
// Create NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
Reactor_Log_Services('CreateReactorLogPMOrder', Name, 'ASM_HTR_SEMIANNUAL_PM')
|
||||
end
|
||||
end
|
||||
|
||||
If SemiannualRemoved then
|
||||
// Cancel NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
ChecklistTypes = Record<REACTOR_LOG_CHECKLIST_TYPE$>
|
||||
ChecklistOrderIds = Record<REACTOR_LOG_CHECKLIST_ORDER_ID$>
|
||||
Locate 'ASM_HTR_SEMIANNUAL_PM' in ChecklistTypes using @VM setting vPos then
|
||||
OrderId = ChecklistOrderIds<0, vPos>
|
||||
Reactor_Log_Services('CancelReactorLogPMOrder', Name, OrderId)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
If AnnualAdded then
|
||||
// Create NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
Reactor_Log_Services('CreateReactorLogPMOrder', Name, 'ASM_HTR_ANNUAL_PM')
|
||||
end
|
||||
end
|
||||
|
||||
If AnnualRemoved then
|
||||
// Cancel NICA order
|
||||
If ( (ReactType EQ 'ASM') or (ReactType EQ 'ASM+') or (ReactType EQ 'HTR') ) then
|
||||
ChecklistTypes = Record<REACTOR_LOG_CHECKLIST_TYPE$>
|
||||
ChecklistOrderIds = Record<REACTOR_LOG_CHECKLIST_ORDER_ID$>
|
||||
Locate 'ASM_HTR_ANNUAL_PM' in ChecklistTypes using @VM setting vPos then
|
||||
OrderId = ChecklistOrderIds<0, vPos>
|
||||
Reactor_Log_Services('CancelReactorLogPMOrder', Name, OrderId)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return
|
||||
|
||||
DELETE_RECORD_PRE:
|
||||
@ -336,3 +437,4 @@ return
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user