|
|
|
|
@ -41,6 +41,7 @@ from datetime import datetime, date
|
|
|
|
|
import asyncio
|
|
|
|
|
import json
|
|
|
|
|
# from src.utils import save_to_pastebin
|
|
|
|
|
from src.config import BASE_URL, REALIBILITY_SERVICE_API
|
|
|
|
|
|
|
|
|
|
client = httpx.AsyncClient(timeout=300.0)
|
|
|
|
|
|
|
|
|
|
@ -50,7 +51,7 @@ class OptimumCostModelWithSpareparts:
|
|
|
|
|
def __init__(self, token: str, last_oh_date: date, next_oh_date: date,
|
|
|
|
|
sparepart_manager,
|
|
|
|
|
time_window_months: Optional[int] = None,
|
|
|
|
|
base_url: str = "http://192.168.1.82:8000"):
|
|
|
|
|
base_url: str = f"{BASE_URL}"):
|
|
|
|
|
"""
|
|
|
|
|
Initialize the Optimum Cost Model with sparepart management
|
|
|
|
|
"""
|
|
|
|
|
@ -1152,7 +1153,7 @@ async def get_calculation_by_assetnum(
|
|
|
|
|
|
|
|
|
|
async def get_number_of_failures(location_tag, start_date, end_date, token, max_interval=24):
|
|
|
|
|
url_prediction = (
|
|
|
|
|
f"http://192.168.1.82:8000/reliability/main/number-of-failures/"
|
|
|
|
|
f"{REALIBILITY_SERVICE_API}/main/number-of-failures/"
|
|
|
|
|
f"{location_tag}/{start_date.strftime('%Y-%m-%d')}/{end_date.strftime('%Y-%m-%d')}"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
@ -1219,7 +1220,7 @@ async def get_equipment_foh(
|
|
|
|
|
token: str
|
|
|
|
|
):
|
|
|
|
|
url_mdt = (
|
|
|
|
|
f"http://192.168.1.82:8000/reliability/asset/mdt/{location_tag}"
|
|
|
|
|
f"{REALIBILITY_SERVICE_API}/asset/mdt/{location_tag}"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|