feat: 新增 AgvPoint 点位表及客户端,支持点位编码与接驳台绑定

This commit is contained in:
SunYF
2026-11-03 10:17:49 +08:00
parent fd2f0e2767
commit 2ccf9bb9ca
62 changed files with 5501 additions and 238 deletions
+5 -3
View File
@@ -755,11 +755,13 @@ func (s *Service) buildAlarms(ctx context.Context, today time.Time) []AlarmItem
Status: "active",
})
}
// 在途未完成下发(2026-11-03 断头路收口):原统计 status=TIMEOUT 但全项目无人写入 TIMEOUT,恒为 0。
// 改统计 SENT(已下发未收到完成信号)——超 1 条即说明产线有指令挂起,需在「工位下发」页撤回或人工完成。
if n, err := s.ctx.EntClient.PlcSendLog.Query().
Where(plcsendlog.Status("TIMEOUT")).Count(ctx); err == nil && n > 0 {
Where(plcsendlog.Status("SENT")).Count(ctx); err == nil && n > 0 {
items = append(items, AlarmItem{
ID: "plc-timeout", Level: "critical", Type: "equipment",
Target: "PLC", Message: "存在 PLC 下发超时 " + itoa(n) + " 条", Time: fmtDashboardTime(time.Now()),
ID: "plc-intransit", Level: "critical", Type: "equipment",
Target: "PLC", Message: "存在在途未完成的工位下发 " + itoa(n) + " 条,请在「工位下发」页收口", Time: fmtDashboardTime(time.Now()),
Status: "active",
})
}