fix liazo priority

master
Johan Le Baut 2 months ago
parent 39bec33217
commit 2f5dddde8b

@ -4,16 +4,22 @@ import json
import time
import traceback
class Liazo:
def __init__(self):
pass
def getAreaBuildings(
self, narrow_coordinates: AreaCoordinates(), existing_buildings: dict
) -> dict:
nc=narrow_coordinates
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="",
@ -57,11 +64,15 @@ class Liazo:
codePostal="",
commune="",
bat_info="",
found_in = ["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

Loading…
Cancel
Save