feat(cryptotail): 尾盘 TG 改为轮询实现并修复自调用

- 新增 notification_sent 字段与 V36 迁移,轮询未发 TG 的 trigger
- 新增 CryptoTailOrderNotificationPollingService:每 5 秒轮询,CLOB getOrder 后发 TG,与跟单一致
- 通过 ApplicationContextAware + getSelf() 解决 @Transactional 自调用问题
- 删除 CryptoTailOrderNotificationSubscriber,移除 WS 推送方式
- Repository 新增 findByStatusAndOrderIdIsNotNullAndNotificationSentFalseOrderByCreatedAtAsc

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
WrBug
2026-02-14 13:11:21 +08:00
co-authored by Cursor
parent 9413507997
commit 1f6cf1ecaf
5 changed files with 156 additions and 82 deletions
@@ -0,0 +1,8 @@
-- ============================================
-- V36: 尾盘策略触发记录 - TG 通知已发标记(与跟单轮询发 TG 一致)
-- ============================================
ALTER TABLE crypto_tail_strategy_trigger
ADD COLUMN notification_sent TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否已发送 TG 通知: 0=未发送, 1=已发送';
CREATE INDEX idx_trigger_notification ON crypto_tail_strategy_trigger (status, notification_sent);