|
@@ -533,7 +533,6 @@ class AiView(View):
|
|
uid_set_id = uid_set_qs.id
|
|
uid_set_id = uid_set_qs.id
|
|
|
|
|
|
qs_data['detect_status'] = status # ai开关状态
|
|
qs_data['detect_status'] = status # ai开关状态
|
|
- ai_service_qs.update(**qs_data)
|
|
|
|
thing_name = CommonService.query_serial_with_uid(uid) # 存在序列号则为使用序列号作为物品名
|
|
thing_name = CommonService.query_serial_with_uid(uid) # 存在序列号则为使用序列号作为物品名
|
|
topic_name = 'ansjer/generic/{}'.format(thing_name)
|
|
topic_name = 'ansjer/generic/{}'.format(thing_name)
|
|
|
|
|
|
@@ -543,6 +542,7 @@ class AiView(View):
|
|
req_success = CommonService.req_publish_mqtt_msg(thing_name, topic_name, msg)
|
|
req_success = CommonService.req_publish_mqtt_msg(thing_name, topic_name, msg)
|
|
if not req_success:
|
|
if not req_success:
|
|
return response.json(10044)
|
|
return response.json(10044)
|
|
|
|
+ ai_service_qs.update(**qs_data)
|
|
return response.json(0)
|
|
return response.json(0)
|
|
elif status == 1: # 开启
|
|
elif status == 1: # 开启
|
|
# 更新或创建uid_push数据
|
|
# 更新或创建uid_push数据
|
|
@@ -587,6 +587,7 @@ class AiView(View):
|
|
req_success = CommonService.req_publish_mqtt_msg(thing_name, topic_name, msg)
|
|
req_success = CommonService.req_publish_mqtt_msg(thing_name, topic_name, msg)
|
|
if not req_success:
|
|
if not req_success:
|
|
return response.json(10044)
|
|
return response.json(10044)
|
|
|
|
+ ai_service_qs.update(**qs_data)
|
|
return response.json(0, {'aiIdentificationUrl': aiIdentificationUrl, 'endTime': endTime, 'etk': etk})
|
|
return response.json(0, {'aiIdentificationUrl': aiIdentificationUrl, 'endTime': endTime, 'etk': etk})
|
|
except Exception as e:
|
|
except Exception as e:
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|
|
return response.json(500, 'error_line:{}, error_msg:{}'.format(e.__traceback__.tb_lineno, repr(e)))
|