feat(scheduler): 添加定时任务功能并集成前端配置界面

- 引入 node-cron 依赖以支持定时任务调度
- 新增定时任务相关 API 接口:获取配置、更新配置、查询状态、手动触发任务
- 前端新增“定时任务”标签页,支持 Cron 表达式配置与友好时间展示
- 支持通过 Web 界面启用/禁用定时任务、设置执行计划和金额阈值
- 定时任务可自动采集数据并发送邮件报告,无需重启服务即可生效新配置
- 优化配置保存逻辑,避免敏感信息泄露
```
This commit is contained in:
2025-12-15 15:22:42 +08:00
parent 3aee6af9ae
commit b4afc1ce5a
9 changed files with 1188 additions and 5 deletions

10
package-lock.json generated
View File

@@ -14,6 +14,7 @@
"docx": "^9.5.1",
"express": "^5.2.1",
"iconv-lite": "^0.6.3",
"node-cron": "^4.2.1",
"nodemailer": "^7.0.11",
"pdf-parse": "^2.4.5"
}
@@ -1169,6 +1170,15 @@
"node": ">= 0.6"
}
},
"node_modules/node-cron": {
"version": "4.2.1",
"resolved": "https://registry.npmmirror.com/node-cron/-/node-cron-4.2.1.tgz",
"integrity": "sha512-lgimEHPE/QDgFlywTd8yTR61ptugX3Qer29efeyWw2rv259HtGBNn1vZVmp8lB9uo9wC0t/AT4iGqXxia+CJFg==",
"license": "ISC",
"engines": {
"node": ">=6.0.0"
}
},
"node_modules/nodemailer": {
"version": "7.0.11",
"resolved": "https://registry.npmmirror.com/nodemailer/-/nodemailer-7.0.11.tgz",