fix liazo priority

This commit is contained in:
Johan Le Baut 2023-01-11 16:57:07 +01:00
parent 39bec33217
commit 2f5dddde8b

View file

@ -4,6 +4,7 @@ import json
import time
import traceback
class Liazo:
def __init__(self):
pass
@ -13,7 +14,12 @@ class Liazo:
) -> dict:
nc = narrow_coordinates
c = httplib.HTTPSConnection("vador.fdn.fr")
api_params = "etape=gps_batiments&lat1=%f&lat2=%f&lon1=%f&lon2=%f" % (nc['swy'], nc['ney'], nc['swx'], nc['nex'])
api_params = "etape=gps_batiments&lat1=%f&lat2=%f&lon1=%f&lon2=%f" % (
nc["swy"],
nc["ney"],
nc["swx"],
nc["nex"],
)
req = f"/souscription/gps-batiments.cgi?{api_params}"
req = req.replace(" ", "%20")
r = None
@ -39,17 +45,18 @@ class Liazo:
ftthStatus="DEPLOYE", # Pas de status donc on dit que c'est ok mais on check avec l'arcep si axione KO cote front
reasonNotEligible=None,
)
idImm=building.get('ref')
idImm = building.get("ref")
if buildings.get(idImm):
buildings[idImm]["fdnEligStatus"] = fdnEligStatus
if buildings[idImm].get('found_in'):
buildings[idImm]['found_in'].append("liazo")
buildings[idImm]["etat_imm_priority"] = 4
if buildings[idImm].get("found_in"):
buildings[idImm]["found_in"].append("liazo")
else:
buildings[idImm]['found_in'] = ["liazo"]
buildings[idImm]["found_in"] = ["liazo"]
if not buildings.get(idImm):
building = Building(
y=building.get('lat'),
x=building.get('lon'),
y=building.get("lat"),
x=building.get("lon"),
idImm=idImm,
numVoieImm="",
typeVoieImm="",
@ -60,8 +67,12 @@ class Liazo:
found_in=["liazo"],
etat_imm_priority=4,
fdnEligStatus=fdnEligStatus,
aquilenetEligStatus=FAIEligibilityStatus(isEligible=False, reasonNotEligible="", ftthStatus=""),
othersEligStatus=FAIEligibilityStatus(isEligible=False, reasonNotEligible="", ftthStatus=""),
aquilenetEligStatus=FAIEligibilityStatus(
isEligible=False, reasonNotEligible="", ftthStatus=""
),
othersEligStatus=FAIEligibilityStatus(
isEligible=False, reasonNotEligible="", ftthStatus=""
),
)
buildings[idImm] = building