1
0
forked from erp-dev/erp
Files
erpnew/docs/2026-01-21_summary.md

13 lines
989 B
Markdown
Raw Permalink 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.
### 2026-01-21 工作记录
#### 1) MDY明道云PlateOrder 同步任务/命令梳理
- 确认 `PlateOrder`(开版数据表)同步能力已存在:既有 Celery task`api_v1.tasks.sync_mdy_plate_orders`)也有 management command`sync_mdy_plate_orders`
- 确认当前 `CELERY_BEAT_SCHEDULE` 未配置 PlateOrder 同步定时(已配置的仅有 mdy 产品/客户同步)
- 补充独立说明文档:`docs/mdy_plate_order_sync.md`
- 包含:同步目标表/增量 checkpoint、是否定时、手动 command 用法、Celery task 触发方式、以及暂存查询 API 入口
- 修复同步时偶发 `django.db.utils.IntegrityError: duplicate key value violates unique constraint "api_mdy_plate_order_staging_pkey"`
- 根因PostgreSQL 暂存表 `api_mdy_plate_order_staging` 的自增序列与现有最大 `id` 不一致
- 处理:在同步 service 中检测该类主键冲突后自动重置 sequence 并重试一次(避免任务/命令直接失败)