结果中添加level隐患等级与class列表
This commit is contained in:
parent
5de4531e1a
commit
41573ac5c7
|
|
@ -456,6 +456,14 @@ def hazard_inspection(
|
|||
all_bases.append(base)
|
||||
temp_obj["base_id"] = all_bases.index(base)
|
||||
|
||||
# 隐患等级
|
||||
if get_hazard_level_from_rule(rule_dict, class_list[track_info["class_id"]], tag) == "重大隐患":
|
||||
temp_obj["level"] = 1
|
||||
elif get_hazard_level_from_rule(rule_dict, class_list[track_info["class_id"]], tag) == "一般隐患":
|
||||
temp_obj["level"] = 0
|
||||
else:
|
||||
temp_obj["level"] = -1,
|
||||
|
||||
# 其他字段
|
||||
temp_obj["track_id"] = track_id
|
||||
temp_obj["hazard_track_id"] = hazard_count
|
||||
|
|
@ -477,6 +485,7 @@ def hazard_inspection(
|
|||
|
||||
# 构建最终结果
|
||||
final_result = {
|
||||
"class_list": class_list,
|
||||
"tag": all_tags,
|
||||
"base": all_bases,
|
||||
"objects": all_objects
|
||||
|
|
|
|||
Loading…
Reference in New Issue