feat: 完成WMS系统权限体系与业务功能迭代

本提交完成了WMS系统的多维度优化升级:
1. 新增RBAC权限系统,支持角色/菜单/按钮三级权限管控
2. 重构库存盘点、物料管理、区域维护等模块的查询筛选与展示逻辑
3. 优化入库/出库/质检等业务流程,完善数据冗余与业务闭环
4. 移除旧装箱表,将装箱逻辑合并到出库主表
5. 新增前端权限判断工具、导出工具与端到端测试用例
6. 补充完善各类注释与数据库字段说明
This commit is contained in:
SunYF
2026-09-03 14:20:37 +08:00
parent 665ff257dc
commit 572fa975bc
101 changed files with 14531 additions and 4692 deletions
+26 -16
View File
@@ -30,6 +30,18 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
},
)
// 角色与权限(RBAC 数据化,取代 rbac.go 中的硬编码权限 map
server.AddRoutes(
[]rest.Route{
{Method: http.MethodPost, Path: "/api/rbac/seed", Handler: seedRbacHandler(ctx)},
{Method: http.MethodGet, Path: "/api/roles", Handler: listRolesHandler(ctx)},
{Method: http.MethodPost, Path: "/api/roles", Handler: createRoleHandler(ctx)},
{Method: http.MethodPost, Path: "/api/roles/update", Handler: updateRoleHandler(ctx)},
{Method: http.MethodPost, Path: "/api/roles/delete", Handler: deleteRoleHandler(ctx)},
{Method: http.MethodGet, Path: "/api/permissions", Handler: listPermissionsHandler(ctx)},
},
)
// 物料档案
server.AddRoutes(
[]rest.Route{
@@ -41,20 +53,24 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
},
)
// 入库
server.AddRoutes(
[]rest.Route{
{Method: http.MethodPost, Path: "/api/inbound/create", Handler: createInboundHandler(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.MethodGet, Path: "/api/inbound/details", Handler: inboundDetailsHandler(ctx)},
{Method: http.MethodGet, Path: "/api/inbound/export", Handler: exportInboundHandler(ctx)},
{Method: http.MethodPost, Path: "/api/inbound/batch-excel", Handler: excelInboundHandler(ctx)},
},
)
},
)
// 出库
// 出库(统一主表:备料出库 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)},
},
)
@@ -62,6 +78,8 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{Method: http.MethodGet, Path: "/api/stock/query", Handler: queryStockHandler(ctx)},
{Method: http.MethodGet, Path: "/api/stock/details", Handler: stockDetailsHandler(ctx)},
{Method: http.MethodGet, Path: "/api/stock/export", Handler: exportStockHandler(ctx)},
{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)},
@@ -76,6 +94,7 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
{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)},
{Method: http.MethodGet, Path: "/api/inspection/export", Handler: exportInspectionHandler(ctx)},
},
)
@@ -108,15 +127,6 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
},
)
// 包装
server.AddRoutes(
[]rest.Route{
{Method: http.MethodPost, Path: "/api/package/bind", Handler: packageBindHandler(ctx)},
{Method: http.MethodPost, Path: "/api/package/update", Handler: packageUpdateHandler(ctx)},
{Method: http.MethodGet, Path: "/api/package/query", Handler: queryPackageHandler(ctx)},
},
)
// 工单物料台账(WMS 侧)
server.AddRoutes(
[]rest.Route{