fix(操作统计): 上传备注改为按任务负责人归因,历史数据可回溯
- 备注统计不用 task_logs(历史无record日志),改为 task_records 按任务 assignee 归因 - 排除系统自动生成的备注(以'['开头的接收/转交/撤回等),只计手动上传 - 移除 add_task_record 冗余的 record 日志(不再用于统计) - 不改数据库,历史182条备注也能正确归属到人
This commit is contained in:
@ -1049,16 +1049,6 @@ async def add_task_record(
|
||||
db.add(record)
|
||||
await db.flush()
|
||||
|
||||
# 🔧 操作日志:记录一次「上传备注」操作(供人员操作统计)
|
||||
if current_user:
|
||||
from app.models.task_log import TaskLog
|
||||
db.add(TaskLog(
|
||||
task_id=task_id,
|
||||
operator_id=current_user.get("username") or current_user.get("sub") or "",
|
||||
action_type="record",
|
||||
remark=f"上传备注: {(data.remark or '')[:100]}",
|
||||
))
|
||||
|
||||
# 🚀 留言通知:给任务当前负责人发送提醒(不给自己发)
|
||||
if (
|
||||
current_user
|
||||
|
||||
Reference in New Issue
Block a user