feat: 完成附件存储重构与磁盘监控功能,同步物料档案与入库单规则更新
1. 新增跨平台磁盘空间监控能力,每日7点自动检测附件目录剩余空间,触发阈值告警 2. 重构附件存储方案为年/月/日/文件类型分层结构,统一MES与WMS的附件管理逻辑 3. 对齐物料档案与入库单的质量状态校验规则,仅合格品计入库存与出库 4. 实现入库单作废功能与区域库位的多级父子结构管理 5. 删除物料简称字段,补充规格型号与单位必填项,统一系统数据口径 6. 新增附件中心与磁盘状态查询接口,完善权限控制与操作日志
This commit is contained in:
@@ -19,7 +19,7 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
// 附件静态文件(图纸 PDF / 图片预览):免鉴权,供 <a target=_blank> / 新窗口直接打开
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{Method: http.MethodGet, Path: "/uploads/:name", Handler: serveUploadFileHandler()},
|
||||
{Method: http.MethodGet, Path: "/uploads/:name", Handler: serveUploadFileHandler(ctx)},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -73,6 +73,10 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
{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)},
|
||||
// 入库库位联动:选物料后回填最近一次入库库位
|
||||
{Method: http.MethodGet, Path: "/api/inbound/last-location", Handler: lastInboundLocationHandler(ctx)},
|
||||
// 入库作废:填原因 + 回滚库存(结构件按批次、电气件按 SN 精确回滚)
|
||||
{Method: http.MethodPost, Path: "/api/inbound/void", Handler: requirePerm(ctx, "inbound:void", voidInboundHandler(ctx))},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -138,14 +142,15 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
},
|
||||
)
|
||||
|
||||
// 区域
|
||||
// 区域(多级父子结构:区域/货架/层/位置号 4 个 Tab)
|
||||
server.AddRoutes(
|
||||
[]rest.Route{
|
||||
{Method: http.MethodPost, Path: "/api/zone/create", Handler: createZoneHandler(ctx)},
|
||||
{Method: http.MethodPost, Path: "/api/zone/update", Handler: updateZoneHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/zone/grouped", Handler: listZonesGroupedHandler(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/zone/list", Handler: requirePerm(ctx, "zone:view", listZonesHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/zone/node/create", Handler: requirePerm(ctx, "zone:create", createZoneNodeHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/zone/node/update", Handler: requirePerm(ctx, "zone:edit", updateZoneNodeHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/zone/batch-generate", Handler: requirePerm(ctx, "zone:create", batchGenerateHandler(ctx))},
|
||||
// 下拉(兼容旧调用 + 层级级联),原样保留无权限包裹
|
||||
{Method: http.MethodGet, Path: "/api/zone/picker", Handler: listZonesForPicker(ctx)},
|
||||
{Method: http.MethodGet, Path: "/api/zone/recommend", Handler: zoneRecommendHandler(ctx)},
|
||||
},
|
||||
)
|
||||
|
||||
@@ -191,6 +196,10 @@ func RegisterHandlers(server *rest.Server, ctx *svc.ServiceContext) {
|
||||
{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)},
|
||||
// 附件中心(系统管理 → 附件中心)
|
||||
{Method: http.MethodGet, Path: "/api/attachments/all", Handler: requirePerm(ctx, "attachment:view", listAllAttachmentsHandler(ctx))},
|
||||
{Method: http.MethodGet, Path: "/api/attachments/disk-status", Handler: requirePerm(ctx, "attachment:view", diskStatusHandler(ctx))},
|
||||
{Method: http.MethodPost, Path: "/api/attachments/archive", Handler: requirePerm(ctx, "attachment:manage", archiveAttachmentsHandler(ctx))},
|
||||
},
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user