feat: 来料检处置项实体与复检、日排产达成对比、PLC/WMS 传输日志
- WMS 新增「检验处置项」实体(schema + ent 生成码),配套检验记录实体调整与复检接口,完善来料检/不良退货/入库检验前端 - MES 日排产:新增达成率统计与计划对比逻辑,调整日排产前端与流程卡/工序流 - 日志与传输:MES 新增 PLC 日志与 WMS 客户端传输日志,WMS 新增 MES 客户端传输日志 - MES 其他:扫码、工单/工件、AGV 客户端与告警、产品导入等逻辑完善及前端调整 - 工位终端:上线面板/作业面板、工件 handler 与 MES 客户端调整 - 配置与文档:更新 mes-api.yaml、三端构建产物与问题记录文档
This commit is contained in:
@@ -193,6 +193,7 @@ func (s *Service) SubmitAgv(ctx context.Context, req AgvSubmitRequest, operator
|
||||
}
|
||||
// 第一段不指定车(用户拍板):RCS 自由派车,到位后回写 agv_code 作为本链锁定车
|
||||
if _, aerr := s.ctx.Agv.SubmitTask(ctx, taskNo, source, r.phys, "", submitTmpl, ""); aerr != nil {
|
||||
s.agvRcsCommFail(ctx, "下发 "+source+"→"+r.phys, aerr)
|
||||
s.ctx.EntClient.AgvTask.UpdateOneID(t.ID).
|
||||
SetStatus("FAILED").SetRemark("RCS下发失败: " + aerr.Error()).Exec(ctx)
|
||||
failed = append(failed, target)
|
||||
@@ -282,6 +283,17 @@ func (s *Service) DispatchCallAgv(ctx context.Context, requestNo, operator strin
|
||||
return s.DispatchAgvForCall(ctx, mr, operator)
|
||||
}
|
||||
|
||||
// agvRcsCommFail AGV↔RCS 通讯失败统一落预警(2026-11-16):
|
||||
// 下发/查询/取消任一环节传输失败都算通讯异常,落「agv_rcs_fail」预警(10 分钟窗口去重防轮询风暴)。
|
||||
// target 固定 "AGV"(预警中心按对象归集);best-effort,落预警失败仅打日志不阻断主流程。
|
||||
func (s *Service) agvRcsCommFail(ctx context.Context, where string, err error) {
|
||||
_, aerr := s.CreateAlertDedup(ctx, "agv_rcs_fail", "警告", "AGV",
|
||||
"AGV 调度系统(RCS)通讯失败【"+where+"】:"+err.Error()+",请检查 RCS 服务与网络。", 10)
|
||||
if aerr != nil {
|
||||
fmt.Println("AGV 通讯失败落预警异常:", aerr)
|
||||
}
|
||||
}
|
||||
|
||||
// DispatchAgvForCall 业务配送单派车(2026-11-13 拍板:独立「手动派车/叫料派车」入口下线,
|
||||
// 只由仓库备料完成等业务配送链路触发;前端不再有可直调的手动派车路由):
|
||||
// 由库管在 WMS 叫料队列点「送货」(DispatchCallAgv)调用——生成「空车前往装货点(JBT21)」段
|
||||
@@ -441,6 +453,8 @@ func (s *Service) RefreshAgvTasks(ctx context.Context) (int, error) {
|
||||
for _, t := range list {
|
||||
st, agvCode, qerr := s.ctx.Agv.QueryTask(ctx, t.TaskNo)
|
||||
if qerr != nil {
|
||||
// 2026-11-16:查询失败不再静默,落通讯预警(去重窗口防轮询风暴)
|
||||
s.agvRcsCommFail(ctx, "查询任务 "+t.TaskNo, qerr)
|
||||
continue
|
||||
}
|
||||
// 工位专用接驳台取货:GO_LOAD 到工位后直接装车并送回库房,工位侧零确认。
|
||||
@@ -587,6 +601,7 @@ func (s *Service) RetryAgvTask(ctx context.Context, taskNo, operator string) err
|
||||
// 指定车重试(同段同车):任务行已回写 agv_code 时沿用,未回写传空由 RCS 自由派
|
||||
_, aerr := s.ctx.Agv.SubmitTask(ctx, taskNo, t.SourceDock, t.TargetDock, "", submitTmpl, t.AgvCode)
|
||||
if aerr != nil {
|
||||
s.agvRcsCommFail(ctx, "重试下发 "+t.SourceDock+"→"+t.TargetDock, aerr)
|
||||
s.ctx.EntClient.AgvTask.UpdateOneID(t.ID).
|
||||
SetStatus("FAILED").SetRemark("RCS重试下发失败: " + aerr.Error()).Exec(ctx)
|
||||
return fmt.Errorf("RCS 重试下发失败: %w", aerr)
|
||||
@@ -804,6 +819,7 @@ func (s *Service) dispatchAgvSegment(ctx context.Context, in agvSegInput) (strin
|
||||
if tmpl == "LIFT" { submitTmpl = s.CfgStr(ctx, CfgAgvTaskTypLift, "B01") } else { submitTmpl = s.CfgStr(ctx, CfgAgvTaskTypPlain, "B02") }
|
||||
_, aerr := s.ctx.Agv.SubmitTask(ctx, taskNo, in.Source, in.Target, "", submitTmpl, in.AgvCode)
|
||||
if aerr != nil {
|
||||
s.agvRcsCommFail(ctx, "下发 "+in.Source+"→"+in.Target, aerr)
|
||||
s.ctx.EntClient.AgvTask.UpdateOneID(t.ID).
|
||||
SetStatus("FAILED").SetRemark("RCS下发失败: " + aerr.Error()).Exec(ctx)
|
||||
return "", aerr
|
||||
|
||||
Reference in New Issue
Block a user