FTV_M2M_EVENTS.PARAMETERS: номер ответа НРД (MS010 BizMsgIdr) для BJ_ORDER_ACCEPTED/BJ_EXECUTED/BJ_ORDER_REJECTED, в т.ч. при выгрузке истории

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014FsEKyJrYF69Cj9ZXzFLRi
This commit is contained in:
zuevav
2026-09-29 15:56:19 +03:00
parent 0c42691d59
commit a62db0aa0e
4 changed files with 44 additions and 14 deletions
+15 -4
View File
@@ -319,10 +319,11 @@ func orderWatchCheck(ctx context.Context, rc *RuntimeConfig, guid, direction str
w.Rejected = true
}
})
no := orderRespNo(resps)
if rejected {
go depoOnOrderLineResult(rc, guid, ln.Ref, "rejected", text)
go depoOnOrderLineResult(rc, guid, ln.Ref, "rejected", text, no)
} else {
go depoOnOrderLineResult(rc, guid, ln.Ref, "accepted", "")
go depoOnOrderLineResult(rc, guid, ln.Ref, "accepted", "", no)
}
}
w = globalOrderWatch.Get(guid)
@@ -351,7 +352,7 @@ func orderWatchCheck(ctx context.Context, rc *RuntimeConfig, guid, direction str
globalOrderWatch.update(guid, func(w *OrderWatch) { w.LateAt = now })
for _, ln := range lines {
if !w.Lines[ln.ContrDID].lineDone() {
go depoOnOrderLineResult(rc, guid, ln.Ref, "late", "")
go depoOnOrderLineResult(rc, guid, ln.Ref, "late", "", "")
}
}
if fresh {
@@ -381,7 +382,7 @@ func orderWatchCheck(ctx context.Context, rc *RuntimeConfig, guid, direction str
}
w.Lines[ln.ContrDID] = &OrderLineWatch{Ref: ln.Ref, ISIN: ln.ISIN, ExpiredAt: now}
})
go depoOnOrderLineResult(rc, guid, ln.Ref, "expired", "")
go depoOnOrderLineResult(rc, guid, ln.Ref, "expired", "", "")
if direction == "out" {
for _, l := range globalQuikLinks.ForGUID(guid) {
if l.State == "registered" && (ln.ISIN == "" || strings.EqualFold(l.ISIN, ln.ISIN)) {
@@ -571,3 +572,13 @@ func findMatchedNotice(contrDID string) (time.Time, bool) {
}
return time.Time{}, false
}
// orderRespNo — номер ответа НРД (BizMsgIdr) из отчёта MS010 по строке.
func orderRespNo(resps []orderResponse) string {
for _, r := range resps {
if r.Done && r.No != "" {
return r.No
}
}
return ""
}