optimized get nica orders services
This commit is contained in:
parent
f9573b518c
commit
49f61982de
@ -54,21 +54,27 @@ Options ORDER_STATUSES = 'new','creating','not-started','in-progress','cancelled
|
|||||||
// SERVICES
|
// SERVICES
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
Service GetOrderIds(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES, OrderStatus=ORDER_STATUSES, IsComplete=BOOLEAN)
|
Service GetOrderIds(EntityType=ENTITY_TYPES, EntityID, OrderTypes=ORDER_TYPES, OrderStatus=ORDER_STATUSES, IsComplete=BOOLEAN)
|
||||||
|
|
||||||
OrderKeys = ''
|
OrderKeys = ''
|
||||||
ErrorMsg = ''
|
ErrorMsg = ''
|
||||||
If ( (EntityType NE '') or (EntityID NE '') or (OrderType NE '') or (OrderStatus NE '') or (IsComplete NE '') ) then
|
If ( (EntityType NE '') or (EntityID NE '') or (OrderTypes NE '') or (OrderStatus NE '') or (IsComplete NE '') ) then
|
||||||
Open 'DICT.NICA_ORDERS' to hDict then
|
Open 'DICT.NICA_ORDERS' to hDict then
|
||||||
Query = ''
|
Query = ''
|
||||||
Table = 'NICA_ORDERS'
|
Table = 'NICA_ORDERS'
|
||||||
Option = 'E'
|
Option = 'E'
|
||||||
Flag = ''
|
Flag = ''
|
||||||
If EntityType NE '' then Query := 'ENTITY_TYPE' : @VM : EntityType : @FM
|
If EntityType NE '' then Query := 'ENTITY_TYPE' : @VM : EntityType : @FM
|
||||||
If EntityID NE '' then Query := 'ENTITY_ID' : @VM : EntityID : @FM
|
If EntityID NE '' then Query := 'ENTITY_ID' : @VM : EntityID : @FM
|
||||||
If OrderType NE '' then Query := 'ORDER_TYPE' : @VM : OrderType : @FM
|
If OrderTypes NE '' then
|
||||||
If OrderStatus NE '' then Query := 'ORDER_STATUS' : @VM : OrderStatus : @FM
|
Query := 'ORDER_TYPE'
|
||||||
If IsComplete NE '' then Query := 'IS_COMPLETE' : @VM : IsComplete : @FM
|
For each OrderType in OrderTypes using @VM
|
||||||
|
Query := @VM : OrderType
|
||||||
|
Next OrderType
|
||||||
|
Query := @FM
|
||||||
|
end
|
||||||
|
If OrderStatus NE '' then Query := 'ORDER_STATUS' : @VM : OrderStatus : @FM
|
||||||
|
If IsComplete NE '' then Query := 'IS_COMPLETE' : @VM : IsComplete : @FM
|
||||||
Btree.Extract(Query, Table, hDict, OrderKeys, Option, Flag)
|
Btree.Extract(Query, Table, hDict, OrderKeys, Option, Flag)
|
||||||
If Flag NE 0 then
|
If Flag NE 0 then
|
||||||
ErrorMsg = 'Error in ':Service:' service. Btree.Extract call failed.'
|
ErrorMsg = 'Error in ':Service:' service. Btree.Extract call failed.'
|
||||||
@ -103,9 +109,9 @@ Service GetOrderUpdates()
|
|||||||
end service
|
end service
|
||||||
|
|
||||||
|
|
||||||
Service GetActiveOrders(EntityType=ENTITY_TYPES, EntityId, OrderType=ORDER_TYPES)
|
Service GetActiveOrders(EntityType=ENTITY_TYPES, EntityId, OrderTypes=ORDER_TYPES)
|
||||||
|
|
||||||
Response = Nica_Orders_Services('GetOrderIds', EntityType, EntityID, OrderType, '#cancelled', False$)
|
Response = Nica_Orders_Services('GetOrderIds', EntityType, EntityID, OrderTypes, '#cancelled', False$)
|
||||||
|
|
||||||
end service
|
end service
|
||||||
|
|
||||||
@ -563,3 +569,4 @@ end service
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -903,11 +903,9 @@ end service
|
|||||||
Service GetRlChecklistActive(RLKey)
|
Service GetRlChecklistActive(RLKey)
|
||||||
|
|
||||||
If RLKey NE '' then
|
If RLKey NE '' then
|
||||||
ActiveTubeChangeIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR_LOG', RLKey, 'ASM_HTR_TUBE_CHANGE')
|
OrderTypes = 'ASM_HTR_TUBE_CHANGE' : @VM : 'ASM_HTR_ANNUAL_PM' : @VM : 'ASM_HTR_SEMIANNUAL_PM' : @VM : 'ASM_HTR_FIVE_AND_TEN_YEAR_PM'
|
||||||
ActiveAnnualPmIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR_LOG', RLKey, 'ASM_HTR_ANNUAL_PM')
|
ActiveRlOrderIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR_LOG', RLKey, OrderTypes)
|
||||||
ActiveSemiannualPmIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR_LOG', RLKey, 'ASM_HTR_SEMIANNUAL_PM')
|
Response = ( ActiveRlOrderIds NE '' )
|
||||||
ActiveFiveAndTenPmIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR_LOG', RLKey, 'ASM_HTR_FIVE_AND_TEN_YEAR_PM')
|
|
||||||
Response = ( (ActiveTubeChangeIds NE '') or (ActiveAnnualPmIds NE '') or (ActiveSemiannualPmIds NE '') or (ActiveFiveAndTenPmIds NE '') )
|
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', 'Error in ':Service:' service. Null ReactNo passed into service.')
|
Error_Services('Add', 'Error in ':Service:' service. Null ReactNo passed into service.')
|
||||||
end
|
end
|
||||||
@ -948,3 +946,4 @@ ClearCursors:
|
|||||||
|
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
@ -3614,11 +3614,10 @@ end service
|
|||||||
|
|
||||||
Service GetProveInActive(ReactNo)
|
Service GetProveInActive(ReactNo)
|
||||||
|
|
||||||
If ReactNo NE '' then
|
If ReactNo NE '' then
|
||||||
ActiveChangeoverIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'CHANGEOVER')
|
OrderTypes = 'CHANGEOVER' : @VM : 'INITIATE_IDLE' : @VM : 'IDLE'
|
||||||
ActiveInitIdleIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'INITIATE_IDLE')
|
ActiveProveInIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, OrderTypes)
|
||||||
ActiveIdleIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'IDLE')
|
Response = (ActiveProveInIds NE '')
|
||||||
Response = ( (ActiveChangeoverIds NE '') or (ActiveInitIdleIds NE '') or (ActiveIdleIds NE '') )
|
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', 'Error in ':Service:' service. Null ReactNo passed into service.')
|
Error_Services('Add', 'Error in ':Service:' service. Null ReactNo passed into service.')
|
||||||
end
|
end
|
||||||
@ -3642,13 +3641,9 @@ end service
|
|||||||
|
|
||||||
Service GetActiveProveInOrderIds(ReactNo)
|
Service GetActiveProveInOrderIds(ReactNo)
|
||||||
|
|
||||||
If ReactNo NE '' then
|
If ReactNo NE '' then
|
||||||
ActiveChangeoverIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'CHANGEOVER')
|
OrderTypes = 'CHANGEOVER' : @VM : 'INITIATE_IDLE' : @VM : 'IDLE'
|
||||||
ActiveInitIdleIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'INITIATE_IDLE')
|
Response = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, OrderTypes)
|
||||||
ActiveIdlesIds = Nica_Orders_Services('GetActiveOrders', 'REACTOR', ReactNo, 'IDLE')
|
|
||||||
If (ActiveChangeoverIds NE '') then Response<0, -1> = ActiveChangeoverIds
|
|
||||||
If (ActiveInitIdleIds NE '') then Response<0, -1> = ActiveInitIdleIds
|
|
||||||
If (ActiveIdlesIds NE '') then Response<0, -1> = ActiveInitIdleIds
|
|
||||||
end else
|
end else
|
||||||
Error_Services('Add', 'Error in ':Service:' service. Null ReactNo passed into service.')
|
Error_Services('Add', 'Error in ':Service:' service. Null ReactNo passed into service.')
|
||||||
end
|
end
|
||||||
@ -3693,3 +3688,4 @@ ClearCursors:
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user