Changes to add progress percentage to WIP Status.

This commit is contained in:
Infineon\StieberD
2024-12-12 13:24:48 -07:00
committed by Infineon\Mitchem
parent 63979bb757
commit 36f600c0c6
8 changed files with 453 additions and 8 deletions

View File

@ -245,6 +245,11 @@ Service CreateNewOrder(EntityType=ENTITY_TYPES, EntityID, OrderType=ORDER_TYPES)
NicaOrderRec<NICA_ORDERS.ENTITY_TYPE$> = EntityType
NicaOrderRec<NICA_ORDERS.ENTITY_ID$> = EntityID
NicaOrderRec<NICA_ORDERS.IS_COMPLETE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'isComplete')
If NicaOrderRec<NICA_ORDERS.IS_COMPLETE$> EQ False$ then
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'progressPercentage')
end else
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = 100
end
Database_Services('WriteDataRow', 'NICA_ORDERS', OrderId, NicaOrderRec, True$, False$, False$)
If Error_Services('NoError') then
If ( (OrderType _EQC 'INITIATE_IDLE') and (EntityType _EQC 'REACTOR') ) then
@ -390,6 +395,11 @@ Service CancelOrder(OrderId)
IsComplete = SRP_JSON(ObjResponseJson, 'GetValue', 'pendingUpdate')
NicaOrderRec<NICA_ORDERS.ORDER_STATUS$> = SRP_JSON(ObjResponseJson, 'GetValue', 'state')
NicaOrderRec<NICA_ORDERS.IS_COMPLETE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'isComplete')
If IsComplete EQ False$ then
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'progressPercentage')
end else
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = 100
end
Database_Services('WriteDataRow', 'NICA_ORDERS', OrderId, NicaOrderRec, True$, False$, False$)
If Error_Services('NoError') then
OrderType = NicaOrderRec<NICA_ORDERS.ORDER_TYPE$>
@ -546,6 +556,11 @@ Service GetOrderStatusUpdate(OrderId)
NicaOrderRec<NICA_ORDERS.ORDER_TYPE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'type')
NicaOrderRec<NICA_ORDERS.ORDER_STATUS$> = SRP_JSON(ObjResponseJson, 'GetValue', 'state')
NicaOrderRec<NICA_ORDERS.IS_COMPLETE$> = IsComplete
If IsComplete EQ False$ then
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = SRP_JSON(ObjResponseJson, 'GetValue', 'progressPercentage')
end else
NicaOrderRec<NICA_ORDERS.PROGRESS_PERCENTAGE$> = 100
end
Database_Services('WriteDataRow', 'NICA_ORDERS', OrderId, NicaOrderRec, True$, False$, False$)
If Error_Services('NoError') then
If IsComplete EQ True$ then