feat: 完成多模块迭代更新

- 新增过程巡检按步骤上报、数量不符上报、工位退料功能
- 增加工单工程编号三级归属字段
- 新增物料安全库存与缺货预警
- 新增附件管理、退库单管理模块
- 优化生产看板展示逻辑与前端页面文案
- 清理冗余的工艺路线相关代码与备份文件
This commit is contained in:
SunYF
2026-09-15 16:37:39 +08:00
parent 951f3dfecd
commit 4a5e2d7bac
494 changed files with 24702 additions and 139223 deletions
+31 -4
View File
@@ -16,6 +16,13 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
},
)
// 附件静态文件(图纸 PDF / 图片预览):免鉴权,供 <a target=_blank> / 新窗口直接打开
server.AddRoutes(
[]rest.Route{
{Method: http.MethodGet, Path: "/uploads/:name", Handler: serveUploadFileHandler()},
},
)
server.Use(authInterceptor(ctx))
// 当前登录用户(JWT 鉴权)
@@ -102,6 +109,7 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
{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)},
},
)
@@ -110,6 +118,7 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
[]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.MethodPost, Path: "/api/inspection/dispose", Handler: disposeInspectionHandler(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)},
@@ -145,6 +154,14 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
},
)
// 退库单(工位退料回库房,WMS 库管确认收货后库存加回)
server.AddRoutes(
[]rest.Route{
{Method: http.MethodPost, Path: "/api/return-order/confirm", Handler: confirmReturnOrderHandler(ctx)},
{Method: http.MethodGet, Path: "/api/return-order/query", Handler: queryReturnOrdersHandler(ctx)},
},
)
// 工单物料台账(WMS 侧)
server.AddRoutes(
[]rest.Route{
@@ -153,6 +170,15 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
},
)
// 附件(下沉到各业务页内嵌使用:入库/物料/检验/半成品/出库)
server.AddRoutes(
[]rest.Route{
{Method: http.MethodPost, Path: "/api/attachments/upload", Handler: uploadAttachmentHandler(ctx)},
{Method: http.MethodGet, Path: "/api/attachments", Handler: listAttachmentsHandler(ctx)},
{Method: http.MethodPost, Path: "/api/attachments/delete", Handler: deleteAttachmentHandler(ctx)},
},
)
// 大屏展示数据(免登录)
server.AddRoutes(
[]rest.Route{
@@ -178,8 +204,9 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
{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))},
{Method: http.MethodPost, Path: "/api/internal/material/exists", Handler: wrapInternal(ctx)(materialExistsHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/dock/pallet-sync", Handler: syncDockPalletHandler(ctx)},
},
)
{Method: http.MethodPost, Path: "/api/internal/material/exists", Handler: wrapInternal(ctx)(materialExistsHandler(ctx))},
{Method: http.MethodPost, Path: "/api/internal/dock/pallet-sync", Handler: syncDockPalletHandler(ctx)},
{Method: http.MethodPost, Path: "/api/internal/return-order", Handler: wrapInternal(ctx)(createReturnOrderInternalHandler(ctx))},
},
)
}