历史记录/操作日志与作业按次登记改进
1. 历史记录:批次合并视图新增"批量反撤销"(需反撤销权限);单条/批量撤销与反撤销提示更明确(说明记录去向,不会删除);操作列权限门控补充 restore_records 2. 操作日志:批量撤销/反撤销写入日志;单条撤销/反撤销/加减分日志详情补充学生姓名(学号)、分值变动、原因;新增"详情关键词"筛选(学生姓名/原因等) 3. 节假日接口:证书校验失败自动回退重试,提高服务器兼容性 4. 作业按次登记:默认列出全部学生、缺交次数默认0(0=已交),支持全员已交登记;后端允许空缺交名单
This commit is contained in:
1 parent
dbf70f602e
commit
d0cdb5b928
13 files changed
+192
-52
No files matched your search
+10
-4
@@ -69,7 +69,8 @@ class OperationLogModel:
|
||||
operation_type: str = None,
|
||||
operator: str = None,
|
||||
start_date: str = None,
|
||||
end_date: str = None
|
||||
end_date: str = None,
|
||||
keyword: str = None
|
||||
):
|
||||
conditions = ["1=1"]
|
||||
params = []
|
||||
@@ -79,6 +80,9 @@ class OperationLogModel:
|
||||
if operator:
|
||||
conditions.append("(operator_name LIKE %s OR operator_role LIKE %s)")
|
||||
params.extend([f"%{operator}%", f"%{operator}%"])
|
||||
if keyword:
|
||||
conditions.append("details LIKE %s")
|
||||
params.append(f"%{keyword}%")
|
||||
if start_date:
|
||||
conditions.append("DATE(created_at) >= %s")
|
||||
params.append(start_date)
|
||||
@@ -93,12 +97,13 @@ class OperationLogModel:
|
||||
operator: str = None,
|
||||
start_date: str = None,
|
||||
end_date: str = None,
|
||||
keyword: str = None,
|
||||
limit: int = 20,
|
||||
offset: int = 0
|
||||
) -> List[Dict[str, Any]]:
|
||||
"""查询操作日志(分页)"""
|
||||
where, params = OperationLogModel._build_filters(
|
||||
operation_type, operator, start_date, end_date
|
||||
operation_type, operator, start_date, end_date, keyword
|
||||
)
|
||||
sql = f"""
|
||||
SELECT log_id, operator_id, operator_name, operator_role,
|
||||
@@ -116,11 +121,12 @@ class OperationLogModel:
|
||||
operation_type: str = None,
|
||||
operator: str = None,
|
||||
start_date: str = None,
|
||||
end_date: str = None
|
||||
end_date: str = None,
|
||||
keyword: str = None
|
||||
) -> int:
|
||||
"""统计操作日志数量"""
|
||||
where, params = OperationLogModel._build_filters(
|
||||
operation_type, operator, start_date, end_date
|
||||
operation_type, operator, start_date, end_date, keyword
|
||||
)
|
||||
result = await execute_one(
|
||||
f"SELECT COUNT(*) AS total FROM operation_logs WHERE {where}",
|
||||
|
||||
Reference in new issue
Block a user