增加后台接口
This commit is contained in:
parent
80316e8223
commit
f8eb207880
@ -176,8 +176,9 @@ class AddUserModel(UserModel):
|
||||
"""
|
||||
新增用户模型
|
||||
"""
|
||||
|
||||
role_ids: Optional[List] = Field(default=[], description='角色ID信息')
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True, populate_by_name=True)
|
||||
|
||||
role_ids: Optional[List[int]] = Field(default=[], description='角色ID信息')
|
||||
post_ids: Optional[List] = Field(default=[], description='岗位ID信息')
|
||||
type: Optional[str] = Field(default=None, description='操作类型')
|
||||
|
||||
@ -186,6 +187,7 @@ class EditUserModel(AddUserModel):
|
||||
"""
|
||||
编辑用户模型
|
||||
"""
|
||||
model_config = ConfigDict(alias_generator=to_camel, from_attributes=True, populate_by_name=True)
|
||||
|
||||
role: Optional[List] = Field(default=[], description='角色信息')
|
||||
|
||||
|
||||
@ -36,6 +36,8 @@ class Identification_recordService:
|
||||
t = query_object.page_size
|
||||
query_object.page_size = query_object.page_size//2
|
||||
identification_record_list_result = await Identification_recordDao.get_identification_record_list(query_db, query_object, is_page)
|
||||
# 根据分页模式统一 rows 数据结构
|
||||
rows = identification_record_list_result.rows if is_page else identification_record_list_result
|
||||
|
||||
# 这里也要获取海康的识别记录, 查询时间需要满足ISO8601标准
|
||||
start_time = cls.time_2_iso8601(query_object.begin_create_time) if query_object.begin_create_time else None
|
||||
@ -44,19 +46,22 @@ class Identification_recordService:
|
||||
# 获取门禁点列表, 获取机器人添加的门禁设备列表,有权限的.
|
||||
door_index_code_list = await DoorDao.get_door_index_code_list(query_db, permission='1')
|
||||
try:
|
||||
haikang_record_list = await HaikangUtil.query_door_events_v2(door_index_code_list
|
||||
,pageNo=query_object.page_num
|
||||
, pageSize=max(t-query_object.page_size, t-len(identification_record_list_result.rows))
|
||||
,startTime=start_time, endTime=end_time
|
||||
,personName=query_object.person_name)
|
||||
return identification_record_list_result.rows + cls.parse_haikang_record_list(haikang_record_list[1]["list"])
|
||||
haikang_record_list = await HaikangUtil.query_door_events_v2(
|
||||
door_index_code_list,
|
||||
pageNo=query_object.page_num,
|
||||
pageSize=max(t - query_object.page_size, t - len(rows)),
|
||||
startTime=start_time,
|
||||
endTime=end_time,
|
||||
personName=query_object.person_name,
|
||||
)
|
||||
return rows + cls.parse_haikang_record_list(haikang_record_list[1]["list"])
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# print(identification_record_list_result.rows)
|
||||
# print("*"*100)
|
||||
# print(haikang_record_list[1])
|
||||
return identification_record_list_result.rows
|
||||
# # print(identification_record_list_result.rows)
|
||||
# # print("*"*100)
|
||||
# # print(haikang_record_list[1])
|
||||
return rows
|
||||
# return None
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user