Files
svc-hall-service/sql/20260920_flow_callback_starter_migration.sql
chenxing b08d076f0b
build / build-push (push) Failing after 8s
feat(flow): 回调链路迁平台 flow-callback starter + 表单级流程绑定
- 回调迁 starter(2026-09-20):删本地实现 FlowCallbackService/Controller/
  FilterConfiguration 及旧测试,X-Flw 验签/幂等/乱序门由 starter 承担,
  业务映射入 SvcFlowCallbackHandler(biz-type svc_item);端点仍 /callback/flow,
  存量注册 callback_url 不变、secret 零轮换,镜像表 flow_callback_reg
  由 sql/20260920_flow_callback_starter_migration.sql 迁移
- 表单级流程绑定:ServiceForm 增 flowGuid,事项未绑流程时回退取绑定表单
  最新版本(effectiveFlowGuid),绑定校验/在线办理口径同步
- FlowReconcileJob/FlowCenterClient/OpenApiAuthEnforceConfiguration 等
  SDK 适配微调;补 .gitignore(target/、日志)
- 全量 mvn test 本地绿(含新增 SvcFlowCallbackHandlerTest/
  ServiceItemEffectiveFlowTest)
2026-09-21 09:37:33 +08:00

29 lines
1.7 KiB
SQL
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-09-20 流程回调迁 yh-flow-callback-spring-boot-starter 数据迁移(svc-hall)
-- 前置:应用完成升级并以 yh.flow-callback.store.auto-create-table=true 启动过一次
--(starter 自动建 flow_callback_event / flow_callback_reg 两表),或已按 starter 的
-- flow-callback-schema.sql 手工建表。本脚本幂等,可重复执行。
-- 1. 登记镜像:service_flow_reg 的 secret 平移到 starter 镜像表(X-Flw 验签改从它取密钥,
-- 保留存量 secret = 存量注册不轮换、推送零中断)
INSERT INTO flow_callback_reg (sch_id, flow_guid, callback_url, event_types, secret, status, update_time)
SELECT r.sch_id, r.flow_guid, r.callback_url, r.event_types, r.secret,
IFNULL(r.status, 0), NOW()
FROM service_flow_reg r
WHERE r.secret IS NOT NULL AND r.secret <> ''
ON DUPLICATE KEY UPDATE
callback_url = VALUES(callback_url),
event_types = VALUES(event_types),
secret = VALUES(secret),
status = VALUES(status),
update_time = NOW();
-- 2. 幂等播种:已消费的 eventId 灌入 starter 幂等表,封死"迁移窗口内 flow-center 重推旧事件
-- 被当成新事件二次消费"的口子。biz_id/instance_version 旧表没有,置 NULL——
-- 只参与 eventId 去重,不参与乱序门(MAX 忽略 NULL)。
INSERT IGNORE INTO flow_callback_event
(event_id, event, sch_id, biz_type, biz_id, instance_id, instance_version, receive_time, payload_json)
SELECT e.event_id, e.event, e.sch_id, 'svc_item', NULL, e.instance_id, NULL, e.receive_time, e.payload_json
FROM service_flow_event e;
-- 3. 历史表保留:service_flow_reg / service_flow_event 不删(存档),代码不再读写。