feat: 新增工序签字功能,移除移料指令模块
新增操作工/检验员工序签字功能,支持工艺步骤配置签字要求;删除移料指令相关代码,将移料页签重命名为产线点位(上料/下料);新增成品入库功能及相关权限;优化备料单状态、质量状态逻辑,新增批次序号字段;修复AGV取消后备料单回退状态问题。
This commit is contained in:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -61,78 +61,6 @@ func ListPointsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// IssueMoveHandler POST /line/move(上位机下发移料指令:起点位 → 目标点位)
|
||||
func IssueMoveHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req struct {
|
||||
Sn string `json:"sn"`
|
||||
FromPoint string `json:"fromPoint"`
|
||||
ToPoint string `json:"toPoint"`
|
||||
OrderNo string `json:"orderNo"`
|
||||
}
|
||||
if err := httpx.ParseJSON(r, &req); err != nil {
|
||||
httpx.BadRequest(w, "请求体解析失败")
|
||||
return
|
||||
}
|
||||
data, err := logic.New(svcCtx).IssueMove(r.Context(), req.Sn, req.FromPoint, req.ToPoint, req.OrderNo, operator(r, ""))
|
||||
if err != nil {
|
||||
httpx.Fail(w, 2402, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OkMessage(w, "移料指令已下发", data)
|
||||
}
|
||||
}
|
||||
|
||||
// AckMoveHandler POST /line/move/ack(PLC 应答)
|
||||
func AckMoveHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req struct {
|
||||
CmdNo string `json:"cmdNo"`
|
||||
}
|
||||
if err := httpx.ParseJSON(r, &req); err != nil {
|
||||
httpx.BadRequest(w, "请求体解析失败")
|
||||
return
|
||||
}
|
||||
if err := logic.New(svcCtx).AckMove(r.Context(), req.CmdNo); err != nil {
|
||||
httpx.Fail(w, 2403, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OkMessage(w, "已应答", nil)
|
||||
}
|
||||
}
|
||||
|
||||
// ArriveMoveHandler POST /line/move/arrive(工件到位:回写台账并闭环指令)
|
||||
func ArriveMoveHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req struct {
|
||||
CmdNo string `json:"cmdNo"`
|
||||
}
|
||||
if err := httpx.ParseJSON(r, &req); err != nil {
|
||||
httpx.BadRequest(w, "请求体解析失败")
|
||||
return
|
||||
}
|
||||
if err := logic.New(svcCtx).ArriveMove(r.Context(), req.CmdNo); err != nil {
|
||||
httpx.Fail(w, 2404, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OkMessage(w, "到位已记账", nil)
|
||||
}
|
||||
}
|
||||
|
||||
// ListMoveCmdsHandler GET /line/moves?status=&sn=&limit=
|
||||
func ListMoveCmdsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
q := r.URL.Query()
|
||||
data, err := logic.New(svcCtx).ListMoveCmds(r.Context(), q.Get("status"), q.Get("sn"),
|
||||
atoiDefault(q.Get("limit"), 50))
|
||||
if err != nil {
|
||||
httpx.Fail(w, 2405, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Ok(w, data)
|
||||
}
|
||||
}
|
||||
|
||||
// CallMaterialHandler POST /line/call-material(工位终端叫料:选接驳台)
|
||||
func CallMaterialHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
@@ -36,10 +36,10 @@ var pathPermMap = map[string]string{
|
||||
"PUT:/api/v1/settings": "sys.settings:edit",
|
||||
// 过程巡检汇总生成《工序间检验记录》(巡检终端操作域)
|
||||
"POST:/api/v1/inspections/generate-inter-process": "sys.inspect:process",
|
||||
// 拧紧待签任务集中签字(巡检终端操作域,检验员第二签)
|
||||
"POST:/api/v1/torque/audit-group": "sys.inspect:sign",
|
||||
// 质量检验处置(过程检/完工检不合格处置 退货/返修/退换)
|
||||
"POST:/api/v1/quality/disposal": "produce.quality:edit",
|
||||
// 检验员签字确认(需求B 第二签,巡检终端「待签任务」)
|
||||
"POST:/api/v1/signs/inspector": "sys.inspect:sign",
|
||||
// 附件中心(sys.attachment 菜单下):删除 / 归档清理属管理动作;
|
||||
// 列表/预览/下载不设按钮门槛(有菜单权限即可查阅)
|
||||
"POST:/api/v1/attachment/delete": "sys.attachment:manage",
|
||||
|
||||
@@ -139,7 +139,9 @@ func MarkMaterialRequestStatusInternalHandler(svcCtx *svc.ServiceContext) http.H
|
||||
httpx.BadRequest(w, "请求体缺失")
|
||||
return
|
||||
}
|
||||
if req.Status != "DELIVERING" && req.Status != "DONE" {
|
||||
// 备料单状态词表:PENDING(待备料)/LOCKED(已备料已出库)/DELIVERING(配送中)/DONE(已接料完结)
|
||||
// WMS 取消 AGV 后回退用 PENDING(待备料),与 MES 词表对齐(修复 WAIT_SEND 越界静默失败)
|
||||
if req.Status != "DELIVERING" && req.Status != "DONE" && req.Status != "PENDING" {
|
||||
httpx.Fail(w, 3106, "非法状态")
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
package production
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -94,39 +93,6 @@ func TorqueRecordsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// TorqueGroupsHandler GET /torque/groups 拧紧一级汇总(工单号/SN/日期/工位 四条件复合 + 应拧 vs 实拧满足判定)
|
||||
func TorqueGroupsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
q := r.URL.Query()
|
||||
from := parseTorqueTime(q.Get("from"), false)
|
||||
to := parseTorqueTime(q.Get("to"), true)
|
||||
data, err := logic.New(svcCtx).ListTorqueGroups(r.Context(), q.Get("sn"), q.Get("workOrderNo"), q.Get("stationNo"),
|
||||
from, to, atoiDefault(q.Get("page"), 1), atoiDefault(q.Get("pageSize"), 20))
|
||||
if err != nil {
|
||||
httpx.Fail(w, 3210, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Ok(w, data)
|
||||
}
|
||||
}
|
||||
|
||||
// TorqueStatHandler GET /torque/stat 单工件单工位应拧 vs 实拧统计
|
||||
func TorqueStatHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
q := r.URL.Query()
|
||||
if q.Get("sn") == "" {
|
||||
httpx.Fail(w, 3211, "缺少 sn 参数")
|
||||
return
|
||||
}
|
||||
data, err := logic.New(svcCtx).TorqueScrewStat(r.Context(), q.Get("sn"), q.Get("stationNo"))
|
||||
if err != nil {
|
||||
httpx.Fail(w, 3211, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Ok(w, data)
|
||||
}
|
||||
}
|
||||
|
||||
// ProcessStepsHandler 查询工位的工序步骤(参数采集模板),供巡检终端等按工位动态渲染。
|
||||
// 按 stationNo 加载该工位启用工艺流程的工序步骤。
|
||||
func ProcessStepsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
@@ -144,87 +110,3 @@ func ProcessStepsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
httpx.Ok(w, data)
|
||||
}
|
||||
}
|
||||
|
||||
// TorqueAuditHandler POST /torque/audit 拧紧记录审核签字
|
||||
func TorqueAuditHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req struct {
|
||||
RecordId int `json:"recordId"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
if err := httpx.ParseJSON(r, &req); err != nil {
|
||||
httpx.BadRequest(w, "请求体解析失败")
|
||||
return
|
||||
}
|
||||
if req.RecordId <= 0 {
|
||||
httpx.Fail(w, 3208, "缺少 recordId")
|
||||
return
|
||||
}
|
||||
if err := logic.New(svcCtx).AuditTorqueRecord(r.Context(), req.RecordId, req.Remark, operator(r, "")); err != nil {
|
||||
httpx.Fail(w, 3208, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OkMessage(w, "审核成功", nil)
|
||||
}
|
||||
}
|
||||
|
||||
// TorqueAuditLogHandler GET /torque/audit-log 查询拧紧记录修改留痕
|
||||
func TorqueAuditLogHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
q := r.URL.Query()
|
||||
id := atoiDefault(q.Get("recordId"), 0)
|
||||
if id <= 0 {
|
||||
httpx.Fail(w, 3209, "缺少 recordId")
|
||||
return
|
||||
}
|
||||
data, err := logic.New(svcCtx).ListTorqueAuditLog(r.Context(), id)
|
||||
if err != nil {
|
||||
httpx.Fail(w, 3209, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Ok(w, data)
|
||||
}
|
||||
}
|
||||
|
||||
// TorquePendingHandler GET /torque/pending 拧紧待签任务:未审核记录按 工单号+SN+工位 聚合,
|
||||
// 供巡检终端检验员集中第二签(真分页 page/pageSize)
|
||||
func TorquePendingHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
q := r.URL.Query()
|
||||
data, err := logic.New(svcCtx).ListTorquePendingGroups(r.Context(),
|
||||
atoiDefault(q.Get("page"), 1), atoiDefault(q.Get("pageSize"), 20))
|
||||
if err != nil {
|
||||
httpx.Fail(w, 3212, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Ok(w, data)
|
||||
}
|
||||
}
|
||||
|
||||
// TorqueAuditGroupHandler POST /torque/audit-group 拧紧分组批量审核签字:
|
||||
// 把 工单号+SN+工位 一组内全部未审核记录标记审核人=当前登录账号,返回签字条数
|
||||
func TorqueAuditGroupHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req struct {
|
||||
WorkOrderNo string `json:"workOrderNo"`
|
||||
Sn string `json:"sn"`
|
||||
StationNo string `json:"stationNo"`
|
||||
Remark string `json:"remark"`
|
||||
}
|
||||
if err := httpx.ParseJSON(r, &req); err != nil {
|
||||
httpx.BadRequest(w, "请求体解析失败")
|
||||
return
|
||||
}
|
||||
if req.Sn == "" {
|
||||
httpx.Fail(w, 3213, "缺少 sn")
|
||||
return
|
||||
}
|
||||
n, err := logic.New(svcCtx).AuditTorqueGroup(r.Context(),
|
||||
req.WorkOrderNo, req.Sn, req.StationNo, req.Remark, operator(r, ""))
|
||||
if err != nil {
|
||||
httpx.Fail(w, 3213, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OkMessage(w, fmt.Sprintf("已签字 %d 条", n), map[string]any{"count": n})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
package production
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"bj_power_mes/common/httpx"
|
||||
"bj_power_mes/internal/logic"
|
||||
"bj_power_mes/internal/svc"
|
||||
)
|
||||
|
||||
// InspectorSignHandler 检验员签字确认(需求B 第二签)。需 sys.inspect:sign 权限(perm.go 兜底)。
|
||||
func InspectorSignHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req logic.InspectorSignReq
|
||||
if err := httpx.ParseJSON(r, &req); err != nil {
|
||||
httpx.BadRequest(w, "请求体解析失败")
|
||||
return
|
||||
}
|
||||
if err := logic.New(svcCtx).InspectorSign(r.Context(), req, operator(r, "")); err != nil {
|
||||
httpx.Fail(w, 3301, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OkMessage(w, "签字成功", nil)
|
||||
}
|
||||
}
|
||||
|
||||
// SignPendingHandler 待检验员签字列表(需求B 巡检终端「待签任务」数据源)。
|
||||
func SignPendingHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
q := r.URL.Query()
|
||||
f := logic.PendingSignFilter{
|
||||
Sn: q.Get("sn"),
|
||||
OrderNo: q.Get("orderNo"),
|
||||
StationNo: q.Get("stationNo"),
|
||||
Page: atoiDefault(q.Get("page"), 1),
|
||||
PageSize: atoiDefault(q.Get("pageSize"), 50),
|
||||
}
|
||||
data, total, err := logic.New(svcCtx).PendingSigns(r.Context(), f)
|
||||
if err != nil {
|
||||
httpx.Fail(w, 3302, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Ok(w, map[string]any{"list": data, "total": total})
|
||||
}
|
||||
}
|
||||
@@ -273,13 +273,40 @@ func SaveDailyPlanHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
|
||||
func ListDailyPlansHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
orderNo := r.URL.Query().Get("orderNo")
|
||||
planDate := r.URL.Query().Get("planDate")
|
||||
data, err := logic.New(svcCtx).ListDailyPlansWithCombination(r.Context(), orderNo, planDate)
|
||||
q := r.URL.Query()
|
||||
// 日期窗口:防内存炸弹。默认今天~今天+30 由前端传;显示历史时 planDateStart 为空。
|
||||
planDateStart := q.Get("planDateStart")
|
||||
planDateEnd := q.Get("planDateEnd")
|
||||
// 排序方向:asc=按排产日期升序(从前到后,默认) / desc=降序(最新在前)。
|
||||
sortDir := q.Get("sort")
|
||||
if sortDir == "" {
|
||||
sortDir = "asc"
|
||||
}
|
||||
page, _ := strconv.Atoi(q.Get("page"))
|
||||
if page < 1 {
|
||||
page = 1
|
||||
}
|
||||
pageSize, _ := strconv.Atoi(q.Get("pageSize"))
|
||||
if pageSize < 1 {
|
||||
pageSize = 50
|
||||
}
|
||||
rows, total, err := logic.New(svcCtx).ListDailyPlansPaged(r.Context(), planDateStart, planDateEnd, page, pageSize, sortDir)
|
||||
if err != nil {
|
||||
httpx.Fail(w, 3009, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Ok(w, map[string]any{"list": rows, "total": total})
|
||||
}
|
||||
}
|
||||
|
||||
// ListUnplannedWorkOrdersHandler GET /daily-plans/unplanned 未排产工单列表(日排产页顶部入口用)。
|
||||
func ListUnplannedWorkOrdersHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
data, err := logic.New(svcCtx).ListUnplannedWorkOrders(r.Context())
|
||||
if err != nil {
|
||||
httpx.Fail(w, 3011, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.Ok(w, data)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ func RegisterProductionRoutes(server *rest.Server, serverCtx *svc.ServiceContext
|
||||
server.AddRoute(rest.Route{
|
||||
Method: http.MethodGet, Path: "/api/internal/files", Handler: internal(FileDownloadInternalHandler(serverCtx)),
|
||||
})
|
||||
// ---------- 工位停单(只认当天;工人自主停/恢复,上位机据此不下发流转指令) ----------
|
||||
// ---------- 工位停单(只认当天;工人自主停/恢复) ----------
|
||||
server.AddRoute(rest.Route{
|
||||
Method: http.MethodPost, Path: "/api/internal/station/pause", Handler: production.StationPauseInternalHandler(serverCtx),
|
||||
})
|
||||
@@ -137,22 +137,10 @@ func RegisterProductionRoutes(server *rest.Server, serverCtx *svc.ServiceContext
|
||||
Method: http.MethodGet, Path: "/api/internal/material-demand", Handler: internal(production.MaterialDemandInternalHandler(serverCtx)),
|
||||
})
|
||||
|
||||
// ---------- 产线点位/移料(供工位终端调用,X-API-TOKEN 保护)----------
|
||||
// ---------- 产线点位(供工位终端调用,X-API-TOKEN 保护)----------
|
||||
server.AddRoute(rest.Route{
|
||||
Method: http.MethodGet, Path: "/api/internal/line/points", Handler: internal(ListPointsHandler(serverCtx)),
|
||||
})
|
||||
server.AddRoute(rest.Route{
|
||||
Method: http.MethodPost, Path: "/api/internal/line/move", Handler: internal(IssueMoveHandler(serverCtx)),
|
||||
})
|
||||
server.AddRoute(rest.Route{
|
||||
Method: http.MethodPost, Path: "/api/internal/line/move/ack", Handler: internal(AckMoveHandler(serverCtx)),
|
||||
})
|
||||
server.AddRoute(rest.Route{
|
||||
Method: http.MethodPost, Path: "/api/internal/line/move/arrive", Handler: internal(ArriveMoveHandler(serverCtx)),
|
||||
})
|
||||
server.AddRoute(rest.Route{
|
||||
Method: http.MethodGet, Path: "/api/internal/line/moves", Handler: internal(ListMoveCmdsHandler(serverCtx)),
|
||||
})
|
||||
server.AddRoute(rest.Route{
|
||||
Method: http.MethodPost, Path: "/api/internal/line/call-material", Handler: internal(CallMaterialHandler(serverCtx)),
|
||||
})
|
||||
@@ -184,6 +172,7 @@ func RegisterProductionRoutes(server *rest.Server, serverCtx *svc.ServiceContext
|
||||
{Method: http.MethodPost, Path: "/daily-plans", Handler: production.SaveDailyPlanHandler(serverCtx)},
|
||||
{Method: http.MethodPut, Path: "/daily-plans", Handler: production.SaveDailyPlanHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/daily-plans", Handler: production.ListDailyPlansHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/daily-plans/unplanned", Handler: production.ListUnplannedWorkOrdersHandler(serverCtx)},
|
||||
{Method: http.MethodDelete, Path: "/daily-plans/:id", Handler: production.DeleteDailyPlanHandler(serverCtx)},
|
||||
// 日排产启用/停用专用状态接口(body {"status":"PENDING"|"CONFIRMED"}):
|
||||
// 只改 status 列,避免前端此前误用 PUT /daily-plans/{id}(405)或全量保存覆盖分产量
|
||||
@@ -212,13 +201,10 @@ func RegisterProductionRoutes(server *rest.Server, serverCtx *svc.ServiceContext
|
||||
|
||||
{Method: http.MethodPost, Path: "/torque/report", Handler: production.TorqueReportHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/torque/records", Handler: production.TorqueRecordsHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/torque/groups", Handler: production.TorqueGroupsHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/torque/stat", Handler: production.TorqueStatHandler(serverCtx)},
|
||||
{Method: http.MethodPost, Path: "/torque/audit", Handler: production.TorqueAuditHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/torque/audit-log", Handler: production.TorqueAuditLogHandler(serverCtx)},
|
||||
// 巡检终端「待签任务」:拧紧未审核聚合 + 检验员集中第二签
|
||||
{Method: http.MethodGet, Path: "/torque/pending", Handler: production.TorquePendingHandler(serverCtx)},
|
||||
{Method: http.MethodPost, Path: "/torque/audit-group", Handler: production.TorqueAuditGroupHandler(serverCtx)},
|
||||
|
||||
// ---------- 签字机制(需求B):操作工报工签字随 /workpiece/report 落库;检验员签字为独立动作 ----------
|
||||
{Method: http.MethodPost, Path: "/signs/inspector", Handler: production.InspectorSignHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/signs/pending", Handler: production.SignPendingHandler(serverCtx)},
|
||||
|
||||
{Method: http.MethodGet, Path: "/process-steps", Handler: production.ProcessStepsHandler(serverCtx)},
|
||||
|
||||
@@ -263,10 +249,6 @@ func RegisterProductionRoutes(server *rest.Server, serverCtx *svc.ServiceContext
|
||||
{Method: http.MethodPost, Path: "/stations", Handler: SaveStationHandler(serverCtx)},
|
||||
{Method: http.MethodDelete, Path: "/stations/:id", Handler: DeleteStationHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/line/points", Handler: ListPointsHandler(serverCtx)},
|
||||
{Method: http.MethodPost, Path: "/line/move", Handler: IssueMoveHandler(serverCtx)},
|
||||
{Method: http.MethodPost, Path: "/line/move/ack", Handler: AckMoveHandler(serverCtx)},
|
||||
{Method: http.MethodPost, Path: "/line/move/arrive", Handler: ArriveMoveHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/line/moves", Handler: ListMoveCmdsHandler(serverCtx)},
|
||||
{Method: http.MethodPost, Path: "/line/call-material", Handler: CallMaterialHandler(serverCtx)},
|
||||
|
||||
// ---------- PAD 巡检终端(块8) ----------
|
||||
@@ -277,6 +259,7 @@ func RegisterProductionRoutes(server *rest.Server, serverCtx *svc.ServiceContext
|
||||
// P0-4:一键生成《工序间检验记录》(汇总该工单 PROCESS 类巡检,按步骤维度,附装配物料绑定明细)
|
||||
// ---------- MES 质量检验(过程检/完工检,来料检在 WMS 已做仍落本表) ----------
|
||||
|
||||
{Method: http.MethodGet, Path: "/quality/finished-pending", Handler: FinishedPendingHandler(serverCtx)},
|
||||
{Method: http.MethodPost, Path: "/quality/disposal", Handler: InspectionDisposalHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/quality/unqualified-report", Handler: UnqualifiedReportHandler(serverCtx)},
|
||||
{Method: http.MethodPost, Path: "/inspections/generate-inter-process", Handler: GenerateInterProcessInspectionHandler(serverCtx)},
|
||||
|
||||
Reference in New Issue
Block a user