|
@@ -1,21 +1,28 @@
|
|
|
from hub import methods, Global
|
|
|
|
|
|
+save_dir = r'C:\logs' # sri内网测试环境
|
|
|
|
|
|
async def code3001(**sources):
|
|
|
"""
|
|
|
查询驾驶人员操作记录列表
|
|
|
"""
|
|
|
- # --- get file name list ---
|
|
|
- # cfg = config['default']()
|
|
|
- # upload_file_list = methods.get_file_path_list(cfg.STATIC_PATH)
|
|
|
- # upload_file_name_list = [i.split('\\')[-1] for i in upload_file_list]
|
|
|
- # upload_file_uuid_list = [i.split('.')[0] for i in upload_file_name_list]
|
|
|
+ # --- check ---
|
|
|
+ if not sources.get('page'):
|
|
|
+ return dict(code=1, details=f"something is wrong.")
|
|
|
+ elif not sources.get('size'):
|
|
|
+ return dict(code=2, details=f"something is wrong.")
|
|
|
+
|
|
|
+ # --- get log_file_uuid_list ---
|
|
|
+ log_file_list = methods.get_file_path_list(save_dir)
|
|
|
+ log_file_name_list = [i.split('\\')[-1] for i in upload_file_list]
|
|
|
+ log_file_uuid_list = [i.split('.')[0] for i in upload_file_name_list]
|
|
|
+
|
|
|
+
|
|
|
+ # --- fill d1 ---
|
|
|
+ for item in Global.mdb.get_all('UserWorkRecordList', sort_field=[('start_at', -1)]):
|
|
|
+ if str(item.get('_id')) not in log_file_uuid_list:
|
|
|
+ continue
|
|
|
|
|
|
- # # --- check ---
|
|
|
- # if not sources.get('page'):
|
|
|
- # return dict(code=1, details=f"something is wrong.")
|
|
|
- # elif not sources.get('size'):
|
|
|
- # return dict(code=2, details=f"something is wrong.")
|
|
|
|
|
|
# # --- fill d1 ---
|
|
|
# """
|