# pipe **Repository Path**: creasson/pipe ## Basic Information - **Project Name**: pipe - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-12-24 - **Last Updated**: 2026-08-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # pipe(派铂)工程应用 Streamlit 多页面应用,用于工艺电子化审批、图纸盖章签名、PDF文字添加、报检资料汇总、工序模板组装、每日排产(APS)、每日在制状态等业务。 ## systemd 服务管理(推荐) 应用已配置为用户级 systemd 服务 `pipe-app.service`(开机自启 + 崩溃自动恢复): ```bash # 查看状态 systemctl --user status pipe-app.service # 启动 / 停止 / 重启 systemctl --user start pipe-app.service systemctl --user stop pipe-app.service systemctl --user restart pipe-app.service # 开机自启开关 systemctl --user enable pipe-app.service systemctl --user disable pipe-app.service # 跟踪日志 journalctl --user -u pipe-app.service -f ``` - 服务文件:`~/.config/systemd/user/pipe-app.service` - 应用地址:`http://:8505` - 服务特性:`Restart=on-failure`(崩溃 5 秒后自动拉起)、`RestartSec=5s`、可选加载仓库根 `.env` 环境变量 ### 报检日期更新任务(update-inspection-date) `app/aps/update_inspection_date.py`(报检验收计划 → 产品报检验收总表,回填报检完成日期)已配置为每日 **07:30 与 23:30** 自动执行的 systemd 服务 + 定时器: ```bash # 查看定时器状态与下次执行时间 systemctl --user list-timers update-inspection-date.timer # 手动立即执行一次 systemctl --user start update-inspection-date.service # 查看执行结果 systemctl --user status update-inspection-date.service # 查看执行日志 journalctl --user -u update-inspection-date.service ``` - 服务文件:`~/.config/systemd/user/update-inspection-date.service` - 定时器文件:`~/.config/systemd/user/update-inspection-date.timer` - 定时规则:每日 07:30 与 23:30 各运行一次(`Persistent=true`:错过执行时间时,开机后自动补执行一次) - 脚本会根据**当前系统时间**自动获取月份并转换为中文月份名称(如“八月”)作为筛选条件,不再硬编码月份 ## 手动运行 ```bash python3.12 -m venv .venv .venv/bin/pip install -r requirements.txt export LARK_APP_ID="你的_app_id" export LARK_APP_SECRET="你的_app_secret" .venv/bin/python st_app.py ``` ## 测试 ```bash .venv/bin/pip install pytest .venv/bin/python -m pytest tests/ ``` ## 环境配置 完整的环境配置说明(Python 版本要求、平台差异、版本约束、环境变量)见 [ENVIRONMENT.md](ENVIRONMENT.md)。 ## 导出依赖包 `pipreqs ./ --encoding=utf8 --ignore .venv --force`