feat:换为人工过滤meetingRoomName和meetingRoomTypeName
This commit is contained in:
@@ -185,21 +185,15 @@ def query_avali_room(data: dict, params: dict) -> str:
|
|||||||
# return json.dumps(result, ensure_ascii=False)
|
# return json.dumps(result, ensure_ascii=False)
|
||||||
new_list = []
|
new_list = []
|
||||||
# 字典中只要key存在,哪怕对应的value是'',也能取出来空字符串 data.get('capacity', 0)可能是空字符串
|
# 字典中只要key存在,哪怕对应的value是'',也能取出来空字符串 data.get('capacity', 0)可能是空字符串
|
||||||
capacity = data.get('capacity', 0)
|
|
||||||
capacity_limit = int(capacity) if capacity not in [None, ''] else 0
|
if Region and Region != 'None':
|
||||||
logger.info("capacity limit {0} {1}".format(capacity_limit, type(capacity_limit)))
|
|
||||||
if data.get('Region') and data.get('Region') != 'None':
|
|
||||||
region = data.get('Region')
|
|
||||||
for b in result:
|
for b in result:
|
||||||
logger.info("b.capacity {0} {1}".format(b.get('capacity', 0), type(b.get('capacity', 0))))
|
logger.info("b.capacity {0} {1}".format(b.get('capacity', 0), type(b.get('capacity', 0))))
|
||||||
if ((region in b.get('name', 'default') or region in b.get('typeName', 'default')) and b.get('capacity',
|
if (Region in b.get('name', 'default') or Region in b.get('typeName', 'default')):
|
||||||
0) >= capacity_limit):
|
|
||||||
new_list.append(b)
|
new_list.append(b)
|
||||||
return json.dumps(new_list, ensure_ascii=False)
|
return json.dumps(new_list, ensure_ascii=False)
|
||||||
else:
|
else:
|
||||||
for b in result:
|
new_list = result
|
||||||
if b.get('capacity', 0) >= capacity_limit:
|
|
||||||
new_list.append(b)
|
|
||||||
return json.dumps(new_list, ensure_ascii=False)
|
return json.dumps(new_list, ensure_ascii=False)
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
logger.exception("location: query_avali_room=> {0}".format(str(ex)))
|
logger.exception("location: query_avali_room=> {0}".format(str(ex)))
|
||||||
|
|||||||
Reference in New Issue
Block a user