feat: 两库对等物料管理及产品工号贯通全流程
- 新增 MES 本地物料表及双向同步接口,WMS 物料变更自动同步 - 全流程新增产品工号字段,贯通入库/库存/出库/检验环节 - 工单管理支持多工单混产,移除单工单互斥限制 - 新增批次号/SN 字段支持质量检验联动 WMS 库存处置 - 修复权限规则,仅内置管理员账号不允许修改删除 - 工位终端新增 SN 扫码自动切换所属工单功能
This commit is contained in:
@@ -129,7 +129,11 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
[]rest.Route{
|
||||
{Method: http.MethodPost, Path: "/api/inspection/batch-flip", Handler: batchFlipInspectionHandler(ctx)},
|
||||
{Method: http.MethodPost, Path: "/api/inspection/dispose", Handler: disposeInspectionHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/inspection/query", Handler: queryInspectionHandler(ctx)},
|
||||
// 在库处置:从在库库存行直接发起不合格处置(JWT 登录即可,与同组检验接口权限一致)
|
||||
{Method: http.MethodPost, Path: "/api/inspection/inventory-dispose", Handler: inventoryDisposeHandler(ctx)},
|
||||
// 复检(换修闭环):针对「在库 + 不合格」库存行重新判定,闭合换修 / 不合格处置后续
|
||||
{Method: http.MethodPost, Path: "/api/inspection/reinspect", Handler: reinspectHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/inspection/query", Handler: queryInspectionHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/inspection/export", Handler: exportInspectionHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/inspection/stats", Handler: statsInspectionHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/inspection/pending", Handler: pendingInspectionHandler(ctx)},
|
||||
@@ -173,6 +177,8 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
{Method: http.MethodPost, Path: "/api/semi/inbound", Handler: semiInboundHandler(ctx)},
|
||||
{Method: http.MethodPost, Path: "/api/semi/outbound", Handler: semiOutboundHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/semi/query", Handler: querySemiHandler(ctx)},
|
||||
// A2 半成品入库继承产线工单:前端凭工单号只读带出合同号(归属)
|
||||
{Method: http.MethodGet, Path: "/api/workorder/contract", Handler: workOrderContractHandler(ctx)},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -182,7 +188,15 @@ 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)},
|
||||
{Method: http.MethodGet, Path: "/api/return-order/ledger", Handler: queryReturnLedgerHandler(ctx)},
|
||||
},
|
||||
)
|
||||
|
||||
// 生产退不良(产线使用中发现的不良品退回库房隔离,质量异常处置入口)
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{Method: http.MethodPost, Path: "/api/production-return", Handler: createProductionReturnHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/production-return/query", Handler: queryProductionReturnHandler(ctx)},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -233,20 +247,19 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
{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))},
|
||||
{Method: http.MethodGet, Path: "/api/internal/product-types", Handler: wrapInternal(ctx)(listProductTypesInternalHandler(ctx))},
|
||||
// 型号导出(MES 型号维护已本地化 M3/M6,列表/增改删内部接口随调用方消亡移除,仅保留导出)
|
||||
{Method: http.MethodGet, Path: "/api/internal/product-types/export", Handler: wrapInternal(ctx)(exportProductTypesInternalHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/internal/product-types", Handler: wrapInternal(ctx)(createProductTypeInternalHandler(ctx))},
|
||||
{Method: http.MethodPut, Path: "/api/internal/product-types", Handler: wrapInternal(ctx)(updateProductTypeInternalHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/internal/product-types/delete", Handler: wrapInternal(ctx)(deleteProductTypeInternalHandler(ctx))},
|
||||
// 物料两库对等(需求一 M3/M5):MES→WMS 推送落点,按 code 幂等 upsert(删除=停用 isActive=false)
|
||||
{Method: http.MethodPost, Path: "/api/internal/materials/upsert", Handler: wrapInternal(ctx)(upsertMaterialInternalHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/internal/material/exists", Handler: wrapInternal(ctx)(materialExistsHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/internal/material/types", Handler: wrapInternal(ctx)(materialTypesHandler(ctx))},
|
||||
// MES 物料档案代理:WMS 是物料主数据源,MES 前端通过 X-API-TOKEN 直接增改查 WMS 物料表
|
||||
// 物料分页查询(需求一 M7:MES 冷启动全量拉取用;MES 推送走上方 /upsert)
|
||||
{Method: http.MethodGet, Path: "/api/internal/materials", Handler: wrapInternal(ctx)(queryMaterialsHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/internal/materials", Handler: wrapInternal(ctx)(createMaterialHandler(ctx))},
|
||||
{Method: http.MethodPut, Path: "/api/internal/materials", Handler: wrapInternal(ctx)(updateMaterialHandler(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))},
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user