1. 通用优化: - 统一系统标题为"库房客户端"/"MES产线控制",移除北自所前缀 - 调整内置账号密码为统一123456,优化密码校验逻辑 - 新增数据库自动创建逻辑,简化部署流程 - 修复日志时间格式配置,优化日志输出 - 新增纯数字密码安全提示 2. MES系统优化: - 新增日排产管理功能,支持增删改查与自动算料生成备料单 - 重构BOM模块,改为按产品编码维护而非工单维度 - 新增工艺参数模板配置与手动报工页面 - 新增产品类型自动编码功能 - 优化菜单结构,调整工单管理、扫码报工等页面名称与路由 - 新增删除日排产接口与权限保护 - 修复物料清单查询逻辑,适配新BOM结构 - 新增refreshToken支持,优化登录会话管理 3. WMS系统优化: - 新增基础数据维护页面,支持区域与物料档案管理 - 新增工单列表下拉接口,对接MES获取未完成工单优先展示 - 优化入库管理提示文案,替换英文提示为中文 - 修复精密件入库校验逻辑,优化错误提示 - 优化Excel导入功能,新增备注字段支持 - 优化登录页面与菜单文案,统一备料台账名称 - 新增自动打开浏览器功能,优化客户端启动体验 - 修复备料出库页面查询提示文案 - 新增WMS与MES对接配置,完善内部API调用逻辑 4. 其他优化: - 删除冗余的旧版静态资源文件,更新资源引用路径 - 新增帮助文档,完善基础数据模块说明 - 修复多处文案不统一、英文残留问题
135 lines
5.2 KiB
Go
135 lines
5.2 KiB
Go
package handler
|
||
|
||
import (
|
||
"net/http"
|
||
|
||
"bj_power_wms/internal/svc"
|
||
|
||
"github.com/zeromicro/go-zero/rest"
|
||
)
|
||
|
||
func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodGet, Path: "/api/health", Handler: healthHandler(ctx)},
|
||
{Method: http.MethodPost, Path: "/api/auth/login", Handler: loginHandler(ctx)},
|
||
{Method: http.MethodPost, Path: "/api/auth/register", Handler: registerHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
server.Use(authInterceptor(ctx))
|
||
|
||
// 物料档案
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodPost, Path: "/api/material/create", Handler: createMaterialHandler(ctx)},
|
||
{Method: http.MethodPost, Path: "/api/material/update", Handler: updateMaterialHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/material/query", Handler: queryMaterialsHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/material/list", Handler: listMaterialsHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/material/detail", Handler: getMaterialHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
// 入库
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodPost, Path: "/api/inbound/create", Handler: createInboundHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/inbound/query", Handler: queryInboundHandler(ctx)},
|
||
{Method: http.MethodPost, Path: "/api/inbound/batch-excel", Handler: excelInboundHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
// 出库
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodPost, Path: "/api/outbound/create", Handler: createOutboundHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/outbound/query", Handler: queryOutboundHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
// 库存
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodGet, Path: "/api/stock/query", Handler: queryStockHandler(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)},
|
||
},
|
||
)
|
||
|
||
// 检验
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodPost, Path: "/api/inspection/create", Handler: createInspectionHandler(ctx)},
|
||
{Method: http.MethodPost, Path: "/api/inspection/batch-flip", Handler: batchFlipInspectionHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/inspection/query", Handler: queryInspectionHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
// 区域
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodPost, Path: "/api/zone/create", Handler: createZoneHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/zone/list", Handler: listZonesHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
// 盘点
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodPost, Path: "/api/stocktake/start", Handler: startStocktakeHandler(ctx)},
|
||
{Method: http.MethodPost, Path: "/api/stocktake/record", Handler: recordStocktakeHandler(ctx)},
|
||
{Method: http.MethodPost, Path: "/api/stocktake/finish", Handler: finishStocktakeHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/stocktake/query", Handler: queryStocktakeHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
// 半成品
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{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)},
|
||
},
|
||
)
|
||
|
||
// 包装
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodPost, Path: "/api/package/bind", Handler: packageBindHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/package/query", Handler: queryPackageHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
// 工单物料台账(WMS 侧)
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodGet, Path: "/api/ledger/query", Handler: queryLedgerHandler(ctx)},
|
||
{Method: http.MethodGet, Path: "/api/orders", Handler: ordersHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
// 大屏展示数据(免登录)
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodGet, Path: "/api/display/overview", Handler: internalDisplayHandler(ctx)},
|
||
},
|
||
)
|
||
|
||
// 项目间内部 API(X-API-TOKEN 写死 token 保护)
|
||
// 与 JWT 侧业务接口同实现,仅供 MES(B)/工位终端(D) 等服务间调用
|
||
server.AddRoutes(
|
||
[]rest.Route{
|
||
{Method: http.MethodPost, Path: "/api/internal/ledger/sync", Handler: wrapInternal(ctx)(ledgerSyncHandler(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))},
|
||
{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))},
|
||
},
|
||
)
|
||
}
|