Files
alert-contract-expiring-hr/.env.example
taojianmin 06c053d7d7 v1.1.0: 实现核心业务逻辑(扫描/任务书/派发/状态机)
新增(scripts/ 分层完整实现):
- scripts/util/{constants,date_util,runtime_paths,logging_setup}.py
- scripts/db/{connection,seed_data,repository}.py(SQLite + 5 张表 + 50 份样例合同)
- scripts/service/{scanner,task_generator,dispatcher,html_renderer}.py
- scripts/cli/app.py(argparse 子命令)
- scripts/templates/task.html.j2(Jinja2 渲染,无 jinja2 时降级到 str.replace)
- examples/{contracts_sample,performance_sample}.csv(本地样例数据)

修改:
- scripts/main.py:argparse + jiangchang_skill_core 降级
- SKILL.md:version 1.0.1 → 1.1.0
- CHANGELOG.md:加 v1.1.0 条目
- .env.example:加 DB_PATH / HTML_OUTPUT_DIR / JIANGCHANG_DATA_DIR

本地验证(9 个 CLI 命令全部 exit code = 0):
- health / version / config-path / init-db:基础 4 命令
- scan-expiring-contracts --thresholds 90,60,30:42 份可续聘 → 红 10 / 橙 10 / 黄 10,生成 30 任务
- render-html:写 output/<task_id>.html(4.9 KB)
- generate-renewal-task:单份合同任务书生成
- mark-contract-renewed:状态机更新 + 关闭 open alerts
- dispatch-task-notice:按单位/月份派发 payload(dry-run 模式)

业务规则(AI 续聘建议本地版,规则顺序判断):
1. 师德 < 60 → non_renew
2. 近 3 年考核有不合格(< 60)→ observe
3. 全部 >= 80 且逐年上升 → renew
4. 其他 → observe

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-09-14 14:17:43 +08:00

42 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 合同到期智能预警与续聘辅助 - 配置示例
# 行头说明「是什么」;行尾说明「怎么填」;进程环境变量 > 用户 .env > 本文件
# 本地路径配置(宿主环境由 jiangchang_skill_core 提供)
# SQLite DB 文件路径(默认 {skill_root}/data/alert-contract-expiring-hr.db)
DB_PATH=
# HTML 输出目录(默认 {skill_root}/output)
HTML_OUTPUT_DIR=
# 数据根(默认 {skill_root}/data)
JIANGCHANG_DATA_DIR=
# 人事系统 API 入口,例如 https://hr.example.edu/api/v1
HR_API_BASE_URL=
# 人事系统 API 调用凭证(Bearer Token),由人事处统一发放
HR_API_TOKEN=
# 党委教师工作部 API 入口,例如 https://teacher-affairs.example.edu/api/v1
TEACHER_AFFAIRS_API_BASE_URL=
# 党委教师工作部 API 调用凭证
TEACHER_AFFAIRS_API_TOKEN=
# 企业微信 API 入口,用于推送个人版任务书和单位版清单
WECOM_API_BASE_URL=https://qyapi.weixin.qq.com/cgi-bin
# 企业微信 API 调用凭证
WECOM_API_TOKEN=
# 扫描阈值(天),距到期日小于等于此值触发对应等级预警;逗号分隔黄/橙/红
ALERT_THRESHOLDS=90,60,30
# 每日扫描时间(HH:MM,24h 制),cron 启用时使用
DAILY_SCAN_AT=02:00
# 全校扫描超时(秒),默认 120
SCAN_TIMEOUT_SEC=120
# 日志级别
LOG_LEVEL=INFO