36 lines
1006 B
Python
36 lines
1006 B
Python
from utils.haikang_util import HaikangUtil
|
|
|
|
class HaiKangService:
|
|
"""
|
|
康达服务
|
|
"""
|
|
|
|
# 查询门禁状态
|
|
@classmethod
|
|
async def get_door_status_service(cls, door_index_codes):
|
|
"""查询门禁状态
|
|
|
|
Args:
|
|
door_index_codes (list): 门禁点唯一标识
|
|
"""
|
|
|
|
result = await HaikangUtil.get_door_status(door_index_codes)
|
|
|
|
if result[0]:
|
|
noAuthDoorIndexCodeList = result[1]
|
|
if door_index_codes in noAuthDoorIndexCodeList:
|
|
return False, '无门禁权限'
|
|
else:
|
|
return True, result[1]
|
|
else:
|
|
return False, result[1]
|
|
|
|
# 门禁点反控
|
|
# @classmethod
|
|
# async def door_do_control_service(cls, door_index_code: list, control_type: int):
|
|
# """门禁点反控服务
|
|
|
|
# Args:
|
|
# door_index_code (list): _description_
|
|
# control_type (int): _description_
|
|
# """ |