15 lines
632 B
Go
15 lines
632 B
Go
package logic
|
|||
|
|
|
||
|
|
import "bj_power_mes/internal/syncfailure"
|
||
|
|
|
||
|
|
// recordSyncFailure 跨系统通知失败落台账(MES→WMS 方向)。
|
||
|
|
// 口径:① 本地事务已提交才记;② best-effort,表未建/写失败只打日志,绝不阻断业务;
|
||
|
|
// ③ 不自动重试,由「同步失败台账」页人工点击重试;④ 重试只重放 endpoint+payload,不重跑本地业务。
|
||
|
|
func (s *Service) recordSyncFailure(bizType, bizKey, endpoint string, payload any, err error) {
|
||
|
|
msg := ""
|
||
|
|
if err != nil {
|
||
|
|
msg = err.Error()
|
||
|
|
}
|
||
|
|
syncfailure.Record(s.ctx.SQLDB, "MES→WMS", bizType, bizKey, endpoint, payload, msg)
|
||
|
|
}
|