feat: 新增工序签字功能,移除移料指令模块

新增操作工/检验员工序签字功能,支持工艺步骤配置签字要求;删除移料指令相关代码,将移料页签重命名为产线点位(上料/下料);新增成品入库功能及相关权限;优化备料单状态、质量状态逻辑,新增批次序号字段;修复AGV取消后备料单回退状态问题。
This commit is contained in:
SunYF
2026-10-05 20:15:38 +08:00
parent c33acab9c8
commit f1cf57e9b2
181 changed files with 9785 additions and 9699 deletions
+34 -8
View File
@@ -28,13 +28,22 @@ func CreateInspectionHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
"ALARM": "sys.inspect:alarm",
}
// 质量检验三类(过程检 QC_PROCESS / 完工检 FINAL / 来料检 INCOMING)与 PAD 巡检共用本接口,
// 持有质量检验录入权限 produce.quality:edit 即放行,避免被巡检按钮权限误拦截。
// 注:PAD 巡检「过程巡检」仍用 PROCESS(走下方 categoryPerm 的 sys.inspect:process),与质检隔离(P1-8)。
// 必须持有质量检验录入权限 produce.quality:edit 方可提交(质检员专属,操作工仅做完工确认)。
// 注:PAD 巡检「过程巡检」仍用 PROCESS(走 categoryPerm 的 sys.inspect:process),与质检隔离(P1-8)。
qualityCats := map[string]bool{"QC_PROCESS": true, "FINAL": true, "INCOMING": true}
if qualityCats[req.Category] && userHasPerm(r, svcCtx, "produce.quality:edit") {
// 质检录入已校验,跳过巡检按钮权限
} else if code, ok := categoryPerm[req.Category]; ok && !userHasPerm(r, svcCtx, code) {
httpx.FailHTTP(w, http.StatusForbidden, "无操作权限:"+code)
if qualityCats[req.Category] {
if !userHasPerm(r, svcCtx, "produce.quality:edit") {
httpx.FailHTTP(w, http.StatusForbidden, "无操作权限:produce.quality:edit")
return
}
} else if code, ok := categoryPerm[req.Category]; ok {
if !userHasPerm(r, svcCtx, code) {
httpx.FailHTTP(w, http.StatusForbidden, "无操作权限:"+code)
return
}
} else {
// 未识别的检验类型,拒绝提交,避免越权放行
httpx.FailHTTP(w, http.StatusBadRequest, "未知的检验类型:"+req.Category)
return
}
msg, err := logic.New(svcCtx).CreateInspection(r.Context(), req, operator(r, ""))
@@ -91,6 +100,22 @@ func UploadPhotoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
}
}
// FinishedPendingHandler GET /quality/finished-pending?page=&pageSize=
// 待完工检成品:完工确认(DONE)后尚无对应完工检记录的成品 SN,只读分页(完工时间倒序)
func FinishedPendingHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
q := r.URL.Query()
page := atoiDefault(q.Get("page"), 1)
pageSize := atoiDefault(q.Get("pageSize"), 20)
list, total, err := logic.New(svcCtx).FinishedPendingList(r.Context(), page, pageSize)
if err != nil {
httpx.Fail(w, 2308, err.Error())
return
}
httpx.Ok(w, map[string]any{"list": list, "total": total})
}
}
// InspectionDisposalHandler POST /quality/disposal 质量检验处置(退货/返修/退换)
func InspectionDisposalHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
@@ -103,11 +128,12 @@ func InspectionDisposalHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
httpx.BadRequest(w, "缺少 id")
return
}
if err := logic.New(svcCtx).SetInspectionDisposal(r.Context(), req.Id, req.DisposalType, req.DisposalRemark, operator(r, "")); err != nil {
msg, err := logic.New(svcCtx).SetInspectionDisposal(r.Context(), req.Id, req.DisposalType, req.DisposalRemark, operator(r, ""))
if err != nil {
httpx.Fail(w, 2305, err.Error())
return
}
httpx.OkMessage(w, "处置已记录", nil)
httpx.OkMessage(w, msg, nil)
}
}