|
@@ -1,6 +1,7 @@
|
|
|
from hub import methods, Global
|
|
|
|
|
|
import threading
|
|
|
+import traceback
|
|
|
import time
|
|
|
import json
|
|
|
import os
|
|
@@ -73,20 +74,26 @@ def method_c001(client, userdata, message):
|
|
|
"""
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
+ try:
|
|
|
+ log_dict = json.loads(message.payload)
|
|
|
+ except Exception as exception:
|
|
|
+ methods.debug_log("method_c001|79", f"#message.payload: {message.payload}")
|
|
|
+ methods.debug_log("method_c001|79", f"#exception: {exception.__class__.__name__}")
|
|
|
+ methods.debug_log("method_c001|79", f"#traceback: {traceback.format_exc()}")
|
|
|
+ return
|
|
|
|
|
|
-
|
|
|
- log_dict = json.loads(message.payload)
|
|
|
+
|
|
|
+
|
|
|
log_time = int(log_dict.get('timeStamp')) / 1000
|
|
|
user_uuid = log_dict.get('userID')
|
|
|
vehicle_id = log_dict.get('vehicleID')
|
|
|
cockpit_id = log_dict.get('cockpitID')
|
|
|
log_uuid = UserWorkRecord.get_log_uuid(user_uuid, log_time, vehicle_id, cockpit_id)
|
|
|
+ methods.debug_log(f"method_c001|92", f"user_uuid: {user_uuid}, log_time: {log_time}")
|
|
|
+ if not log_uuid:
|
|
|
+ return
|
|
|
+
|
|
|
+
|
|
|
log_list = [
|
|
|
|
|
|
f"timeStamp: {methods.ts_to_string(log_time)}",
|