重构排产/叫料配送/时钟/终端事件驱动,清理 SHIPPED 废弃状态
时钟与 JWT:验签按「谁签发谁的时间为准」,向签发方取 /api/server-time, 对端地址由既有 BaseURL 自动推导;不再要求现场人工 w32tm 对时。 排产 C 方案:工单状态不再回写排产,排产只表示启用开关;启用排产是唯一 开工开关,未启用不允许建档上件;完工/取消后工单进度从工单派生、叫料池 按工单状态重算;逐日手改后合计为准;日期筛选默认空=全部日期。 叫料配送 B 方案:新增 DELIVERED 待签收态,货真到工位才从 PREPARED 转 DELIVERED、工人签收再转 DONE;PREPARED 在途不可签收/退库;叫料队列一屏 显示 PENDING+PREPARED、支持批量完成备料;配送链改按工位凑车,一张配送单 =一个托盘=一个工位,只在配送单页新建,未派车可删可改;新建弹窗直列有货 工位;派车硬门禁要求接驳台传感器检测到托盘;删除改为事务内复核状态、 带 PENDING 条件删单头,防止并发派车时误删。 装配记账:新增已装量 installedQty 与追溯绑定 traceBind,落实「总账=分账 之和」;追溯件绑定/撤销回补、非序列号件报工按单台用量自动扣已装;报工前 按工位×物料核对累计已签收 ≥ 已消耗,不够拦下。 工件与工位终端:建档/重上线增加上料位可达性校验与 PLC 送件、半截补齐防 重复扣库;终端去轮询改事件驱动(报警/工件到位/点位/停单即时推送),铃铛 只挂消息类预警、与待办角标分家;刷新保留拧紧录入;跨服务连线失败不再 误报成数据库故障;新增 BJ_POWER_DEV=1 单进程调试模式(不起守护/托盘)。 告警:新增处置字段 resolved_at/resolved_by,红点=待处置数,确认关闭才消。 清理:删除 migrate 中 SHIPPED→DELIVERED 兼容补丁;场景1测试断言改为 现行 PREPARED / DELIVERED;同步更新案例.md、现场对时操作卡.md 与 ent 生成代码。
This commit is contained in:
@@ -128,9 +128,9 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
// 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))},
|
||||
// 2026-11-26:批量完成备料(同包多条一次扣库,整包预检+逐单复用单条逻辑,不改底层出库)
|
||||
{Method: http.MethodPost, Path: "/api/call/complete-batch", Handler: requirePerm(ctx, "call:manage", callBatchCompleteHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/call/reject", Handler: requirePerm(ctx, "call:manage", callRejectHandler(ctx))},
|
||||
// 库管人工派车(2026-11-03 定论:废除备料完成自动派车):点「送货」AGV 才出发
|
||||
{Method: http.MethodPost, Path: "/api/call/dispatch", Handler: requirePerm(ctx, "call:manage", DispatchCallHandler(ctx))},
|
||||
// 托盘工作台(2026-11-03):接驳台台账列表 + 手动派 AGV 回收空托盘(单点步进、到位待令)
|
||||
{Method: http.MethodGet, Path: "/api/pallet/docks", Handler: PalletDocksHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/pallet/station-docks", Handler: StationDocksProxyHandler(ctx)},
|
||||
@@ -141,12 +141,15 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
{Method: http.MethodGet, Path: "/api/pallet/jbt21-free", Handler: Jbt21FreeHandler(ctx)},
|
||||
// 人工清台(2026-11-05 兜底:托盘被人工卸走后台账卡死;仅清台账不碰账)
|
||||
{Method: http.MethodPost, Path: "/api/pallet/clear", Handler: requirePerm(ctx, "call:manage", palletClearHandler(ctx))},
|
||||
// 配送单(2026-11-05 拍板:叫料与送料拆开——一包可拆多张配送单,一单=一次托盘配送)
|
||||
// 配送单(2026-11-26 按工位凑车+配送锁定稿:一单=一托盘=一工位;锁=库房接货台同时一张活跃单)
|
||||
{Method: http.MethodGet, Path: "/api/delivery/list", Handler: requirePerm(ctx, "call:view", deliveryListHandler(ctx))},
|
||||
{Method: http.MethodGet, Path: "/api/delivery/detail", Handler: requirePerm(ctx, "call:view", deliveryDetailHandler(ctx))},
|
||||
{Method: http.MethodGet, Path: "/api/delivery/package", Handler: requirePerm(ctx, "call:view", deliveryPackageHandler(ctx))},
|
||||
{Method: http.MethodGet, Path: "/api/delivery/workstations", Handler: requirePerm(ctx, "call:view", deliveryWorkstationsHandler(ctx))},
|
||||
{Method: http.MethodGet, Path: "/api/delivery/station", Handler: requirePerm(ctx, "call:view", deliveryStationHandler(ctx))},
|
||||
{Method: http.MethodGet, Path: "/api/delivery/active", Handler: requirePerm(ctx, "call:view", deliveryActiveHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/delivery/create", Handler: requirePerm(ctx, "call:manage", deliveryCreateHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/delivery/cancel", Handler: requirePerm(ctx, "call:manage", deliveryCancelHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/delivery/update", Handler: requirePerm(ctx, "call:manage", deliveryUpdateHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/delivery/delete", Handler: requirePerm(ctx, "call:manage", deliveryDeleteHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/delivery/dispatch", Handler: requirePerm(ctx, "call:manage", deliveryDispatchHandler(ctx))},
|
||||
// WMS 代叫料(2026-11-05 拍板:与工位终端同一套叫料包逻辑)
|
||||
{Method: http.MethodPost, Path: "/api/call/create", Handler: requirePerm(ctx, "call:manage", callCreateProxyHandler(ctx))},
|
||||
@@ -342,8 +345,8 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{Method: http.MethodGet, Path: "/api/alerts", Handler: listAlertsHandler(ctx)},
|
||||
{Method: http.MethodPost, Path: "/api/alerts/:id/read", Handler: readAlertHandler(ctx)},
|
||||
{Method: http.MethodPost, Path: "/api/alerts/read-all", Handler: readAllAlertsHandler(ctx)},
|
||||
{Method: http.MethodPost, Path: "/api/alerts/:id/resolve", Handler: resolveAlertHandler(ctx)},
|
||||
{Method: http.MethodPost, Path: "/api/alerts/resolve-all", Handler: resolveAllAlertsHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/alert-rules", Handler: listAlertRulesHandler(ctx)},
|
||||
{Method: http.MethodPost, Path: "/api/alert-rules/update", Handler: updateAlertRuleHandler(ctx)},
|
||||
},
|
||||
@@ -376,6 +379,8 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
{Method: http.MethodGet, Path: "/api/internal/stock/query", Handler: wrapInternal(ctx)(queryStockHandler(ctx))},
|
||||
// 可用批次/SN 查询(MES 物料存在性校验等内部调用)
|
||||
{Method: http.MethodGet, Path: "/api/internal/stock/batches", Handler: wrapInternal(ctx)(listStockBatchesInternalHandler(ctx))},
|
||||
// 装机绑定值校验(2026-11-26 定稿:SN 必须是发到本工位的出库明细 SN;批次件放开不校验)
|
||||
{Method: http.MethodGet, Path: "/api/internal/inventory/bind-values-check", Handler: wrapInternal(ctx)(bindValuesCheckInternalHandler(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))},
|
||||
{Method: http.MethodPost, Path: "/api/internal/finished/inbound", Handler: wrapInternal(ctx)(finishedInboundHandler(ctx))},
|
||||
|
||||
Reference in New Issue
Block a user