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
+5 -9
View File
@@ -84,7 +84,6 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
// 出库(统一主表:备料出库 workorder / 通用出库 general,装箱信息落在同一张表)
server.AddRoutes(
[]rest.Route{
{Method: http.MethodPost, Path: "/api/outbound/create", Handler: createOutboundHandler(ctx)},
{Method: http.MethodPost, Path: "/api/outbound/general", Handler: generalOutboundHandler(ctx)},
{Method: http.MethodGet, Path: "/api/outbound/query", Handler: queryOutboundHandler(ctx)},
{Method: http.MethodGet, Path: "/api/outbound/export", Handler: exportOutboundHandler(ctx)},
@@ -92,6 +91,10 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
{Method: http.MethodGet, Path: "/api/outbound/location-hint", Handler: outboundLocationHintHandler(ctx)},
// 目标工位下拉选项(需求20:来自 MES 工位列表,不允许手输)
{Method: http.MethodGet, Path: "/api/outbound/stations", Handler: listStationOptionsHandler(ctx)},
// B5 叫料队列(仓库端):待备料列表 / 完成备料(WMS 扣库存+通知 MES)/ 驳回
{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))},
},
)
@@ -118,7 +121,6 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
{Method: http.MethodGet, Path: "/api/stock/zone-summary", Handler: zoneSummaryHandler(ctx)},
{Method: http.MethodPost, Path: "/api/stock/lock", Handler: lockStockHandler(ctx)},
{Method: http.MethodPost, Path: "/api/stock/unlock", Handler: unlockStockHandler(ctx)},
{Method: http.MethodPost, Path: "/api/stock/deduct", Handler: deductStockHandler(ctx)},
{Method: http.MethodPost, Path: "/api/stock/check", Handler: checkStockHandler(ctx)},
{Method: http.MethodGet, Path: "/api/stock/shortage", Handler: shortageHandler(ctx)},
{Method: http.MethodGet, Path: "/api/stock/material-demand", Handler: materialDemandHandler(ctx)},
@@ -198,7 +200,6 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
{Method: http.MethodPost, Path: "/api/return-order/confirm", Handler: confirmReturnOrderHandler(ctx)},
{Method: http.MethodGet, Path: "/api/return-order/query", Handler: queryReturnOrdersHandler(ctx)},
{Method: http.MethodGet, Path: "/api/return-order/suggest-location", Handler: suggestReturnLocationHandler(ctx)},
{Method: http.MethodGet, Path: "/api/return-order/ledger", Handler: queryReturnLedgerHandler(ctx)},
},
)
@@ -214,7 +215,6 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
// 工单物料台账(WMS 侧)
server.AddRoutes(
[]rest.Route{
{Method: http.MethodGet, Path: "/api/ledger/query", Handler: queryLedgerHandler(ctx)},
{Method: http.MethodGet, Path: "/api/orders", Handler: ordersHandler(ctx)},
},
)
@@ -246,14 +246,11 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
// 与 JWT 侧业务接口同实现,仅供 MES(B)/工位终端(D) 等服务间调用
server.AddRoutes(
[]rest.Route{
{Method: http.MethodPost, Path: "/api/internal/ledger/sync", Handler: wrapInternal(ctx)(ledgerSyncHandler(ctx))},
{Method: http.MethodGet, Path: "/api/internal/ledger/progress", Handler: wrapInternal(ctx)(ledgerProgressInternalHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/stock/check", Handler: wrapInternal(ctx)(checkStockHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/stock/lock", Handler: wrapInternal(ctx)(lockStockHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/stock/unlock", Handler: wrapInternal(ctx)(unlockStockHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/stock/deduct", Handler: wrapInternal(ctx)(deductStockHandler(ctx))},
{Method: http.MethodGet, Path: "/api/internal/stock/query", Handler: wrapInternal(ctx)(queryStockHandler(ctx))},
// 备料自动出库:MES 侧按此接口取可用批次/SN 后,逐笔调 stock/deduct 完成自动领料
// 可用批次/SN 查询(MES 物料存在性校验等内部调用)
{Method: http.MethodGet, Path: "/api/internal/stock/batches", Handler: wrapInternal(ctx)(listStockBatchesInternalHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/semi/inbound", Handler: wrapInternal(ctx)(semiInboundHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/semi/outbound", Handler: wrapInternal(ctx)(semiOutboundHandler(ctx))},
@@ -269,7 +266,6 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
{Method: http.MethodGet, Path: "/api/internal/materials", Handler: wrapInternal(ctx)(queryMaterialsHandler(ctx))},
{Method: http.MethodGet, Path: "/api/internal/material/list-all", Handler: wrapInternal(ctx)(listMaterialsHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/return-order", Handler: wrapInternal(ctx)(createReturnOrderInternalHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/material/backflush", Handler: wrapInternal(ctx)(backflushInternalHandler(ctx))},
// MES 质量检验(过程检/完工检)判不合格 → 联动 WMS 在库处置(按物料+SN/批次定位库存行)
{Method: http.MethodPost, Path: "/api/internal/inventory/dispose", Handler: wrapInternal(ctx)(internalInventoryDisposeHandler(ctx))},
},