|
@@ -5,8 +5,8 @@ import sys
|
|
|
def floor_sort_cmp(x, y):
|
|
|
positive = 1
|
|
|
negative = -1
|
|
|
- x_name = x.get('name')[0:len(x.get('name'))-5]
|
|
|
- y_name = y.get('name')[0:len(y.get('name'))-5]
|
|
|
+ x_name = x.get('floor_name')[0:len(x.get('floor_name'))-5]
|
|
|
+ y_name = y.get('floor_name')[0:len(y.get('floor_name'))-5]
|
|
|
# x 夹层号
|
|
|
x_m_num = 1
|
|
|
# y 夹层号
|
|
@@ -78,14 +78,9 @@ def floor_sort_cmp(x, y):
|
|
|
return 1
|
|
|
|
|
|
|
|
|
-def check_level_reasonable(model_list, level_data):
|
|
|
- levels = []
|
|
|
- for model_id, level_rows in level_data.items():
|
|
|
- if level_rows is not None and len(level_rows) == 1:
|
|
|
- levels.append(level_rows[0])
|
|
|
+def check_level_reasonable(model_list):
|
|
|
|
|
|
-
|
|
|
- sorted_arr = sorted(levels, key=functools.cmp_to_key(floor_sort_cmp))
|
|
|
+ sorted_arr = sorted(model_list, key=functools.cmp_to_key(floor_sort_cmp))
|
|
|
|
|
|
last_height = -999999999
|
|
|
last_model_id = ''
|
|
@@ -93,10 +88,10 @@ def check_level_reasonable(model_list, level_data):
|
|
|
group = 0
|
|
|
elevations = {}
|
|
|
for row in sorted_arr:
|
|
|
- current_height = row.get('elevation')
|
|
|
- current_model_id = row.get('model_id')
|
|
|
+ current_height = row.get('level')
|
|
|
+ current_model_id = row.get('fid')
|
|
|
elevations[current_model_id] = current_height
|
|
|
- if current_height > last_height:
|
|
|
+ if current_height is not None and current_height > last_height:
|
|
|
last_height = current_height
|
|
|
last_model_id = current_model_id
|
|
|
continue
|
|
@@ -117,10 +112,6 @@ def check_level_reasonable(model_list, level_data):
|
|
|
else:
|
|
|
floor_row['has_error'] = False
|
|
|
floor_row['error'] = None
|
|
|
- if model_id in elevations:
|
|
|
- floor_row['elevation'] = elevations[model_id]
|
|
|
- else:
|
|
|
- floor_row['elevation'] = None
|
|
|
if len(error) == 0:
|
|
|
return True
|
|
|
return False
|