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:
SunYF
2026-11-23 17:00:00 +08:00
parent 9aaa768e6c
commit 5d9140bbd5
30 changed files with 1099 additions and 630 deletions
+5 -28
View File
@@ -83,13 +83,6 @@
size="small"
@click="openDelivery(row)"
>建配送单</el-button>
<el-button
v-if="can('call:manage') && row.status === 'SHIPPED'"
type="success"
size="small"
:loading="loadingLoad === row.requestNo"
@click="confirmLoad(row)"
>确认装车并送货</el-button>
<el-button
v-if="can('call:manage')"
type="warning"
@@ -291,41 +284,25 @@ async function doComplete(row) {
completingNo.value = ''
}
// 确认装车并送货(2026-11-03 三层机制·装卸强制确认):AGV 空车已到位待令(ARRIVED),
// 库管把托盘装上 AGV 后点此按钮 → MES 生成重载运输段发往工位接驳台。
// 送货(2026-11-03 定论:废除备料完成自动派车):库管人工触发,AGV 才出发去库房装货点。
// 送货(2026-11-03 定论:废除备料完成自动派车;2026-11-20 一段式裁决):
// 库管人工触发,确认时托盘已备好在库房接驳台(JBT21)台上 → MES 直接下发 B01 两点段
// (JBT21→叫料接驳台),车到位即举升拉走,**无需再点「确认装车并送货」**(该环节已删)。
const dispatchingNo = ref('')
async function dispatchAgv(row) {
if (!row?.requestNo) return
try {
await ElMessageBox.confirm(
`请确认接驳台物资已放好,车到达后将直接拉走。\n\n确认派 AGV 前往库房装货点取「${row.requestNo}」的托盘?\n\nAGV 到位后进入「到位待令」,需再点「确认装车并送货」发往工位。`,
`请确认「${row.requestNo}」的托盘已放好到库房接驳台(JBT21)台上。\n\n确认后 AGV 将直接前往 JBT21 举升托盘,送达工位接驳台(途中不再需要确认)。`,
'送货(人工派车)', { type: 'warning', confirmButtonText: '派车出发' })
} catch { return }
dispatchingNo.value = row.requestNo
try {
await request.post('/call/dispatch', { requestNo: row.requestNo })
ElMessage.success('已派车,AGV 前往装货点')
ElMessage.success('已派车,AGV 前往 JBT21 拉运托盘')
} catch { /* 拦截器已提示 */ }
dispatchingNo.value = ''
}
const loadingLoad = ref('')
async function confirmLoad(row) {
if (!row?.requestNo) return
try {
await ElMessageBox.confirm(
`确认已将「${row.requestNo}」的托盘装上 AGV?\n\nAGV 将从仓库接驳台出发送至工位 ${row.stationNo};到达后进入「到位待令」,由工位确认卸货放行。`,
'确认装车并送货', { type: 'warning', confirmButtonText: '确认装车' })
} catch { return }
loadingLoad.value = row.requestNo
try {
await request.post('/call/confirm-load', { requestNo: row.requestNo })
ElMessage.success('已确认装车,AGV 出发送货')
} catch { /* 拦截器已提示 */ }
loadingLoad.value = ''
}
function openReject(row) {
rejectDlg.row = row
rejectDlg.reason = row?.crossDay ? '非当日排产' : ''
@@ -13,34 +13,6 @@ import (
// 库管在 WMS 侧的 AGV 交互入口:装货确认(叫料队列行内)与托盘回收派车(托盘工作台)。
// 所有确认动作都在 MES「到位待令(ARRIVED)」闸门后执行;空车段由 MES 业务自动触发免弹窗。
// ConfirmCallLoadHandler POST /call/confirm-load {requestNo}
// 库管在叫料队列对「到位待令」的空车段点「确认装车并送货」→ MES 生成重载运输段发往工位接驳台。
func ConfirmCallLoadHandler(ctx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req struct {
RequestNo string `json:"requestNo"`
Operator string `json:"operator"`
}
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
fail(w, http.StatusBadRequest, "参数错误: "+err.Error())
return
}
if req.RequestNo == "" {
fail(w, http.StatusBadRequest, "requestNo 必填")
return
}
op := r.Header.Get("X-Username")
if op == "" {
op = req.Operator
}
if err := ctx.Mes.AgvConfirm(r.Context(), req.RequestNo, "load_go", "", op); err != nil {
fail(w, http.StatusBadGateway, err.Error())
return
}
ok(w, map[string]any{"ok": true})
}
}
// DispatchCallHandler POST /call/dispatch {requestNo}
// 库管人工派车(2026-11-03 定论:废除备料完成自动派车)——叫料队列点「送货」,AGV 才出发去装货点。
func DispatchCallHandler(ctx *svc.ServiceContext) http.HandlerFunc {
-2
View File
@@ -126,8 +126,6 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
{Method: http.MethodGet, Path: "/api/call/pending", Handler: requirePerm(ctx, "call:view", callPendingHandler(ctx))},
{Method: http.MethodPost, Path: "/api/call/complete", Handler: requirePerm(ctx, "call:manage", callCompleteHandler(ctx))},
{Method: http.MethodPost, Path: "/api/call/reject", Handler: requirePerm(ctx, "call:manage", callRejectHandler(ctx))},
// AGV 三段链装货确认(2026-11-03 三层机制):到位待令 → 库管「确认装车并送货」
{Method: http.MethodPost, Path: "/api/call/confirm-load", Handler: requirePerm(ctx, "call:manage", ConfirmCallLoadHandler(ctx))},
// 库管人工派车(2026-11-03 定论:废除备料完成自动派车):点「送货」AGV 才出发
{Method: http.MethodPost, Path: "/api/call/dispatch", Handler: requirePerm(ctx, "call:manage", DispatchCallHandler(ctx))},
// 托盘工作台(2026-11-03):接驳台台账列表 + 手动派 AGV 回收空托盘(单点步进、到位待令)
@@ -613,15 +613,6 @@ func (c *Client) ListDocks(ctx context.Context) ([]DockRow, error) {
return env.Data.List, nil
}
// AgvConfirm AGV 三段链确认(2026-11-03 三层机制):库管「确认装车并送货」等动作
// 经 MES internal /api/internal/agv/confirm;bizNo=叫料单号(MES 按 ARRIVED GO_LOAD 段定位)。
func (c *Client) AgvConfirm(ctx context.Context, bizNo, action, nextDock, operator string) error {
body, _ := json.Marshal(map[string]any{
"bizNo": bizNo, "action": action, "nextDock": nextDock, "operator": operator,
})
return c.postInternal(ctx, "/api/internal/agv/confirm", body, "AGV 确认动作失败")
}
// AgvDispatch 库管人工派车(2026-11-03 定论:废除备料完成自动派车):
// 叫料队列点「送货」→ MES internal /api/internal/agv/dispatch-call 下发空车去程段。
func (c *Client) AgvDispatch(ctx context.Context, requestNo, operator string) error {
+1 -1
View File
@@ -6,7 +6,7 @@
<title>WMS库房管理</title>
<!-- 系统图标:库房箱体(内联 SVG,避免依赖外部文件) -->
<link rel="icon" type="image/svg+xml" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><rect width='32' height='32' rx='6' fill='%231668dc'/><path d='M16 7l9 4.5v9L16 25l-9-4.5v-9L16 7z' fill='none' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/><path d='M7 11.5L16 16l9-4.5M16 16v9' fill='none' stroke='%23fff' stroke-width='2' stroke-linejoin='round'/></svg>">
<script type="module" crossorigin src="/assets/index-DMewD8Kc.js"></script>
<script type="module" crossorigin src="/assets/index-CrqriC7a.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D211lfNk.css">
</head>
<body>