From d4ed44ac2adc35829911f4df4f79fe28d13473d3 Mon Sep 17 00:00:00 2001 From: zuevav Date: Fri, 18 Sep 2026 14:23:14 +0300 Subject: [PATCH] =?UTF-8?q?=D0=96=D1=83=D1=80=D0=BD=D0=B0=D0=BB:=20=D0=BE?= =?UTF-8?q?=D1=82=D0=B2=D0=B5=D1=82=D1=8B=20=D0=9D=D0=A0=D0=94=20=D0=B8?= =?UTF-8?q?=D1=89=D1=83=D1=82=D1=81=D1=8F=20=D1=82=D0=BE=D0=BB=D1=8C=D0=BA?= =?UTF-8?q?=D0=BE=20=D0=BF=D0=BE=20=D1=81=D0=B4=D0=B5=D0=BB=D0=BA=D0=B0?= =?UTF-8?q?=D0=BC=20=D0=B2=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D0=B5;=20?= =?UTF-8?q?=D0=B7=D0=B0=D0=B2=D0=B5=D1=80=D1=88=D1=91=D0=BD=D0=BD=D1=8B?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=BE=D0=BC=D0=B5=D1=87=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=C2=AB=D0=BD=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D1=8F?= =?UTF-8?q?=D0=B5=D1=82=D1=81=D1=8F=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_01Q4YVo4UMopqT5DzicqpPjL --- internal/lkgateway/livestatus.go | 10 ++++++++-- internal/lkgateway/outgoing_order.go | 11 ++++++++++- internal/lkgateway/web/templates/admin_claim.html | 2 +- internal/lkgateway/web/templates/admin_claims.html | 2 +- internal/lkgateway/web/templates/admin_incoming.html | 2 +- .../web/templates/admin_incoming_detail.html | 2 +- internal/lkgateway/web/templates/admin_journal.html | 2 +- 7 files changed, 23 insertions(+), 8 deletions(-) diff --git a/internal/lkgateway/livestatus.go b/internal/lkgateway/livestatus.go index 0807e31..0e0ab00 100644 --- a/internal/lkgateway/livestatus.go +++ b/internal/lkgateway/livestatus.go @@ -41,7 +41,7 @@ func form16Snapshot() map[string]*OutgoingDeal { } m := map[string]*OutgoingDeal{} if globalOutgoingStore != nil { - for _, d := range scanForm16Drafts(globalOutgoingStore) { + for _, d := range scanForm16DraftsOpt(globalOutgoingStore, false) { // ответы — только по сделкам в работе, ниже m[d.GUID] = d } } @@ -54,7 +54,13 @@ func liveOutgoing(c ClaimView) LiveStatus { guid := string(c.M2MGUID) var depo *OutgoingDeal if guid != "" && c.Status == "confirmed" { // каталог нужен только на этапе депо-исполнения - depo = form16Snapshot()[guid] + if d := form16Snapshot()[guid]; d != nil { + cp := *d + if cp.Submitted && len(cp.Responses) == 0 && !cp.Done { + cp.Responses, cp.Done = outgoingResponses(cp.ContrDIDs) // ответы ищем только для этой, живой сделки + } + depo = &cp + } } var watch *OrderWatch if guid != "" && globalOrderWatch != nil { diff --git a/internal/lkgateway/outgoing_order.go b/internal/lkgateway/outgoing_order.go index 37304d2..7c3e00b 100644 --- a/internal/lkgateway/outgoing_order.go +++ b/internal/lkgateway/outgoing_order.go @@ -188,6 +188,13 @@ func mf010Text(p string, info os.FileInfo) (string, bool) { } func scanForm16Drafts(store *OutgoingStore) []*OutgoingDeal { + return scanForm16DraftsOpt(store, true) +} + +// scanForm16DraftsOpt — то же, но ответы НРД (MS010 и др.) собираются только при withResponses: +// поиск ответов по номерам поручений — самая дорогая часть, и для журнала она нужна лишь +// по сделкам в работе, а не по всем, что когда-либо были. +func scanForm16DraftsOpt(store *OutgoingStore, withResponses bool) []*OutgoingDeal { byGUID := map[string]*OutgoingDeal{} _ = filepath.Walk(igwInboxDir, func(p string, info os.FileInfo, err error) error { if err != nil || info.IsDir() { @@ -238,7 +245,9 @@ func scanForm16Drafts(store *OutgoingStore) []*OutgoingDeal { d.OrderAt = sub.OrderAt d.OrderXML = sub.OrderXML d.ContrDIDs = sub.ContrDIDs - d.Responses, d.Done = outgoingResponses(sub.ContrDIDs) + if withResponses { + d.Responses, d.Done = outgoingResponses(sub.ContrDIDs) + } } } out = append(out, d) diff --git a/internal/lkgateway/web/templates/admin_claim.html b/internal/lkgateway/web/templates/admin_claim.html index 62160c7..6b169dc 100644 --- a/internal/lkgateway/web/templates/admin_claim.html +++ b/internal/lkgateway/web/templates/admin_claim.html @@ -31,7 +31,7 @@ {{if .Flash}}
{{.Flash}}
{{end}}

Заявка {{slice .Claim.ID 0 8}} · {{ruState .Claim.Status}}

- {{$l := liveOut .Claim}}
{{$l.Text}}
+ {{$l := liveOut .Claim}}
{{$l.Text}}
diff --git a/internal/lkgateway/web/templates/admin_claims.html b/internal/lkgateway/web/templates/admin_claims.html index fe671c3..2a8bfee 100644 --- a/internal/lkgateway/web/templates/admin_claims.html +++ b/internal/lkgateway/web/templates/admin_claims.html @@ -14,7 +14,7 @@ - + {{end}} diff --git a/internal/lkgateway/web/templates/admin_incoming.html b/internal/lkgateway/web/templates/admin_incoming.html index 9368b91..ede3dbd 100644 --- a/internal/lkgateway/web/templates/admin_incoming.html +++ b/internal/lkgateway/web/templates/admin_incoming.html @@ -16,7 +16,7 @@ - + {{end}} diff --git a/internal/lkgateway/web/templates/admin_incoming_detail.html b/internal/lkgateway/web/templates/admin_incoming_detail.html index 837239f..35b8965 100644 --- a/internal/lkgateway/web/templates/admin_incoming_detail.html +++ b/internal/lkgateway/web/templates/admin_incoming_detail.html @@ -21,7 +21,7 @@

Входящий перевод {{short 8 .It.GUID}} {{if $answered}}отвечено{{else}}ждёт решения{{end}}

- {{$l := liveIn .It}}
{{$l.Text}}
+ {{$l := liveIn .It}}
{{$l.Text}}
Создана{{.Claim.CreatedAt.Format "02.01.2006 15:04:05"}}
Обновлена{{.Claim.UpdatedAt.Format "02.01.2006 15:04:05"}}
{{len .Securities}} {{$f := m2mParty .TransferringDepositoryINN}}{{if $f}}{{$f}}
{{end}}{{.TransferringDepositoryINN}}
{{$t := m2mParty .ReceivingDepositoryINN}}{{if $t}}{{$t}}
{{end}}{{.ReceivingDepositoryINN}}
{{$l := liveOut .}}{{ruState .Status}}
{{$l.Text}}
{{$l := liveOut .}}{{ruState .Status}}
{{$l.Text}}
детали →
{{short 8 .GUID}} {{$nm := m2mParty .SenderCode}}{{if not $nm}}{{$nm = m2mParty .SenderINN}}{{end}}{{if $nm}}{{$nm}}
{{end}}{{.SenderCode}}{{if .SenderINN}} · ИНН {{.SenderINN}}{{end}}
{{len .Securities}}{{$s := inStatus .}}{{$s.Text}}{{if $s.Outcome}} {{$s.Outcome}}{{end}}{{if .DepoSummary}}
сверка: {{.DepoSummary}}{{end}}{{$l := liveIn .}}
{{$l.Text}}
{{$s := inStatus .}}{{$s.Text}}{{if $s.Outcome}} {{$s.Outcome}}{{end}}{{if .DepoSummary}}
сверка: {{.DepoSummary}}{{end}}{{$l := liveIn .}}
{{$l.Text}}
{{if eq .Status "answered"}}просмотр{{else}}ответить{{end}} →
diff --git a/internal/lkgateway/web/templates/admin_journal.html b/internal/lkgateway/web/templates/admin_journal.html index c805346..82cc9ae 100644 --- a/internal/lkgateway/web/templates/admin_journal.html +++ b/internal/lkgateway/web/templates/admin_journal.html @@ -12,7 +12,7 @@ - + {{end}}
Запрос сформирован (отправитель){{msk .It.RequestCreated}}
Забрали из шлюза (получено нами){{msk .It.ReceivedAt}}{{if not .It.RequestCreated.IsZero}} · прохождение: {{transit .It.RequestCreated .It.ReceivedAt}}{{end}}
{{if eq .DirKind "out"}}↗ Исходящий{{else}}↘ Входящий{{end}} {{.Party}} {{.SecN}}{{.StatusText}}{{if .Outcome}} {{.Outcome}}{{end}}
{{.Live.Text}}
{{.StatusText}}{{if .Outcome}} {{.Outcome}}{{end}}
{{.Live.Text}}
открыть →