Files
zyt/deployment/im-chat-archive-cron/README.md
T
Your NameandClaude Opus 5 (1M context) dfe5768cd2 「已开处方」新增作废、医生电子签署身份两个按钮权限,按角色勾选
- 作废(tcm.prescription/void):未勾选的角色看不到按钮、接口也拒绝;开方/删除/审核权限不再隐含作废。
  勾选后仍只能作废本人开具的处方,具备审核角色的可作废数据范围内他人的处方;审核驳回作废不受影响
- 医生电子签署身份(tcm.prescription/esignDoctor):医生角色未勾选时,顶部下拉入口与签署面板「签署身份与证书」隐藏,
  服务端认证、快捷签授权一并拒绝(即不能签署处方);药师审核签署身份不受影响。桌面端入口同步按此权限判断
- 迁移 2026_11_27_prescription_void_esign_doctor_menu.sql:挂在「已开处方」下,默认不授予任何角色
- 重新构建管理后台
- 记录诊单 IM 聊天补拉改为独立系统 cron 的部署说明(原串行调度会被其阻塞数小时)

Co-Authored-By: Claude Opus 5 (1M context) <[EMAIL]>
2026-11-27 15:45:58 +08:00

18 lines
1.2 KiB
Markdown
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.
# 诊单 IM 聊天记录补拉的独立定时任务
`sync_im_chat_archive` 按患者逐个、对每个医生/医助账号分页拉取腾讯 IM 漫游消息,单轮(200 个患者)可达 2~3 小时。
`php think crontab` 是串行调度器(BT 面板每分钟一次,`flock -xn` 防重入),若由它执行该任务,
运行期间其他每分钟任务(企微推广补偿、复诊到期、签署件归档补传等)全部停摆。
因此线上改为系统 cron 独立运行,`zyt_dev_crontab` 中的同名任务(id 1)已停用,请勿在后台重新启用:
```
# /etc/cron.d/zyt-im-chat-archive(root 所有,权限 644)
SHELL=/bin/bash
*/20 * * * * www cd /www/wwwroot/zyt/server && /usr/bin/flock -xn /tmp/zyt-im-chat-archive.lock /www/server/php/82/bin/php think sync_im_chat_archive --since-days=0 --limit=200 >> /www/wwwroot/zyt/server/runtime/im_chat_archive_cron.log 2>&1
```
- 进度游标按诊单保存(缓存键 `im_chat_archive_batch_cursor:0`),中途终止后下一轮从断点继续。
- 上一轮未结束时 `flock -xn` 直接跳过本轮,不会重叠。
- 排查:`tail -f /www/wwwroot/zyt/server/runtime/im_chat_archive_cron.log`。