feat(mes/wms): AGV回调全量接入与人工派车交互重构 + 台账人工纠正 + 断网容灾(2026-11-20 现场整改)
【MES · AGV 回调与派车】 - 海康回调 method 全量显式枚举(3 套模板 32 方法),禁通配/正则;带前缀 cancel 与裸 cancel 同口径=终态取消,修复落 default 变僵尸任务 - 终态任务忽略迟到回调(只留痕不改状态);回调日志补全本机IP+远端IP+URL+body - 人工派车交互重构:目的地强制弹窗选「送货/取货+有无托盘」,关闭则不生效;删除「无托盘无货可送」错误提示;删除 load_go / finish_return 一段式动作 - 人工段到站立即 continueTask(修复上一站任务永远执行中),不放 freeRobot、车原地待命 - 新增运维入口 POST /agv/free-robot:仅空车可释放,二次确认;与异常处置严格区分 - 异常处置安全红线:按 taskCode 逐单 cancel + 清本地状态 + 释放点位锁,绝不发 freeRobot;UI 逐条标红风险 - 点位举升属性按 IsDock/前缀判定(非接驳台间不举升);本次已走节点补模板与时间 【MES · 台账与容灾】 - 接驳台托盘台账口径改为「业务回调+人工声明+人工纠正,系统不猜」;新增 POST /docks/ledger-fix 人工双向纠正(四路状态源不一致时用) - 任务取消时清理载货台账:仅 RCS 实时可读且 podCode=0 才清,报有货保留+预警,不可达保留+留痕 - WS 车辆状态刷新断网熔断:连续 3 次失败后降频试探,避免对 RCS 死连接雪崩重试 - 本机 IP 过滤 169.254.*(APIPA),修复日志误把链路本地地址当内网 IP 【WMS】 - 叫料队列删除「确认装车并送货」环节,托盘备好后 MES 直接下发 B01 两点直达;删除对应确认装车接口(agv_pallet.go / mesclient) - PLC 手动下发路径指令增加源位置校验(无货直接拒绝) 【文档】 - AGV海康litev1.5.md、部署手册.md、问题临时.md 同步更新
This commit is contained in:
@@ -351,6 +351,31 @@ func (s *Service) ClearDockLedger(ctx context.Context, dockCode, operator, reaso
|
||||
return nil
|
||||
}
|
||||
|
||||
// SetDockLedgerManual 接驳台台账人工纠正(2026-11-20 哲学定稿:系统不猜,接驳台物理状态以人工纠正为准)。
|
||||
// 四路状态源(接驳台维护/PLC 传感器/AGV 管理/点位管理)不一致且无法自动裁决时,库管按现场实物双向纠正:
|
||||
// 置空=托盘已不在台上;置有=台上确有托盘(可填托盘关联号,如托盘编号;空=未知仅记状态)。
|
||||
// 纠正动作 event_log 留痕;不碰任何库存/池账/工件账。
|
||||
func (s *Service) SetDockLedgerManual(ctx context.Context, dockCode string, hasPallet bool, palletRef, operator, reason string) error {
|
||||
d, err := s.ctx.EntClient.Dock.Query().Where(dock.DockCodeEQ(dockCode)).First(ctx)
|
||||
if err != nil || d == nil {
|
||||
return fmt.Errorf("接驳台 %s 不存在", dockCode)
|
||||
}
|
||||
stateCn := map[bool]string{true: "有托盘", false: "无托盘"}
|
||||
if d.HasPallet == hasPallet {
|
||||
return fmt.Errorf("接驳台 %s 台账已是「%s」,无需纠正", dockCode, stateCn[hasPallet])
|
||||
}
|
||||
ref := palletRef
|
||||
if !hasPallet {
|
||||
ref = ""
|
||||
}
|
||||
if uerr := s.ctx.EntClient.Dock.UpdateOneID(d.ID).SetHasPallet(hasPallet).SetPalletRef(ref).Exec(ctx); uerr != nil {
|
||||
return uerr
|
||||
}
|
||||
s.ctx.EventLog.Write(ctx, "dock.manual_fix", operator, "", "dock", dockCode,
|
||||
"人工纠正接驳台台账:"+stateCn[hasPallet]+"(原值 "+stateCn[d.HasPallet]+");原因:"+reason, nil)
|
||||
return nil
|
||||
}
|
||||
|
||||
// DeliveryAgvItem 配送单物料行(WMS 派车时传入)
|
||||
type DeliveryAgvItem struct {
|
||||
RequestNo string `json:"requestNo"`
|
||||
@@ -380,9 +405,11 @@ func (s *Service) DispatchDeliveryAgv(ctx context.Context, deliveryNo, targetDoc
|
||||
MaterialName: it.MaterialName, Unit: it.Unit, Qty: it.Qty, TargetDock: targetDock})
|
||||
}
|
||||
s.checkSensorVsLedger(ctx, dockStoreCode, true, deliveryNo)
|
||||
// 2026-11-20 用户业务裁决(叫料/配送链一段式):货已备好在 JBT21,直接 B01 两点段
|
||||
// (JBT21→配送接驳台),废除空车 GO_LOAD 段与「确认装车并送货」到位待令环节。
|
||||
taskNo, err := s.dispatchAgvSegment(ctx, agvSegInput{
|
||||
Kind: "GO_LOAD", BizType: "CALL", BizNo: deliveryNo,
|
||||
Source: "", Target: dockStoreCode,
|
||||
Kind: "TRANSPORT", BizType: "CALL", BizNo: deliveryNo,
|
||||
Source: dockStoreCode, Target: targetDock,
|
||||
Materials: rows, Operator: operator,
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user