feat: 多系统新增扫码中间件与 AGV 对接,优化拧紧与退库流程

新增扫码中间件支持网络型扫码枪键盘注入,AGV 对接从 WMS 迁至 MES 统一管理;新增拧紧不合格人工处置与 PLC 对账机制,优化退库单关联与工位终端功能,同时清理旧 AGV 任务表,完善数据库与配置项。
This commit is contained in:
SunYF
2026-10-14 17:24:59 +08:00
parent 8e6048c64b
commit f65a52d9e1
170 changed files with 15415 additions and 10572 deletions
+24 -9
View File
@@ -17,6 +17,9 @@ import (
"bj_power_workstation/internal/store"
"bj_power_workstation/internal/svc"
"bj_power_workstation/internal/syncer"
"bj_power_workstation/internal/tightening"
"bj_power_workstation/internal/scanbridge"
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/core/logx"
@@ -109,20 +112,32 @@ func main() {
}
}()
// 拧紧数据由「工艺步骤 + 人工拧枪」驱动:工件走到需要拧紧枪的工艺步骤时,界面聚焦拧紧输入框,
// 人工拧枪把扭矩值打入回车 → POST /api/tightening/record 落本地库并经同步器上报 MES。
// 故此处不再启动任何后台模拟拧紧数据源。
// 拧紧枪 OP 接入(阿特拉斯 Open Protocol):Enable=true 时后台长连接控制器,接收拧紧结果暂存,
// 操作工在界面点「完成」才经 POST /api/tightening/record 落本地库并上报 MES;Enable=false 时仍走人工录入。
tm := tightening.NewManager(c.Tightening)
go tm.Run(rootCtx)
// 扫码中间件(键盘 HID 注入):Enable=true 时后台监听 7757,接收网络型扫码枪(iData PAD / 新大陆手机)
// 推送并模拟键盘注入当前光标窗口(任意输入框自动填入,前端无需轮询)。7757 被占用时仅记日志、不影响主程序。
if c.Scanner.Enabled {
go func() {
if err := scanbridge.Start(rootCtx, scanbridge.Options{}); err != nil {
logx.Errorf("扫码中间件启动失败(不影响主程序): %v", err)
}
}()
}
// 工艺文件 PDF 本地预缓存
pdc := pdfcache.New(c.PdfCache.Dir)
ctx := &svc.ServiceContext{
Config: c,
Store: st,
Mes: mc,
Syncer: sy,
PdfCache: pdc,
WebFS: staticFS,
Config: c,
Store: st,
Mes: mc,
Syncer: sy,
PdfCache: pdc,
WebFS: staticFS,
Tightening: tm,
}
server := rest.MustNewServer(c.RestConf)