122 lines
3.4 KiB
Plaintext
122 lines
3.4 KiB
Plaintext
syntax = "v1"
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"base.api"
|
||
|
|
)
|
||
|
|
|
||
|
|
type (
|
||
|
|
// === 工件管理 ===
|
||
|
|
|
||
|
|
QueryJobsReq {
|
||
|
|
PageReq
|
||
|
|
SortReq
|
||
|
|
Keyword string `form:"keyword,optional"`
|
||
|
|
WorkOrderId int `form:"workOrderId,optional"`
|
||
|
|
ProductTypeId int `form:"productTypeId,optional"`
|
||
|
|
Statuses []string `form:"statuses,optional"`
|
||
|
|
PositionType string `form:"positionType,optional"`
|
||
|
|
}
|
||
|
|
QueryJobsOfWorkOrderReq {
|
||
|
|
PathId
|
||
|
|
PageReq
|
||
|
|
SortReq
|
||
|
|
Statuses []string `form:"statuses,optional"`
|
||
|
|
}
|
||
|
|
SuspendJobReq {
|
||
|
|
PathId
|
||
|
|
Reason string `json:"reason,optional"`
|
||
|
|
}
|
||
|
|
ResumeJobReq {
|
||
|
|
PathId
|
||
|
|
}
|
||
|
|
ReworkJobReq {
|
||
|
|
PathId
|
||
|
|
TargetStepId string `json:"targetStepId"`
|
||
|
|
Reason string `json:"reason,optional"`
|
||
|
|
}
|
||
|
|
|
||
|
|
QueryJobsReply {
|
||
|
|
PageReply
|
||
|
|
Data []JobReply `json:"data"`
|
||
|
|
}
|
||
|
|
JobReply {
|
||
|
|
Id int `json:"id"`
|
||
|
|
WorkOrderId int `json:"workOrderId"`
|
||
|
|
WorkpieceNo string `json:"workpieceNo"`
|
||
|
|
ProductTypeId int `json:"productTypeId"`
|
||
|
|
RecipeId int `json:"recipeId,omitempty"`
|
||
|
|
CurrentStepId string `json:"currentStepId"`
|
||
|
|
CurrentStepName string `json:"currentStepName"`
|
||
|
|
Status string `json:"status"`
|
||
|
|
PositionType string `json:"positionType"`
|
||
|
|
PositionRefId string `json:"positionRefId"`
|
||
|
|
Priority int `json:"priority"`
|
||
|
|
SuspendedReason string `json:"suspendedReason,omitempty"`
|
||
|
|
Context interface{} `json:"context,omitempty"`
|
||
|
|
Version int `json:"version"`
|
||
|
|
CncStartedAt string `json:"cncStartedAt"`
|
||
|
|
CncCompletedAt string `json:"cncCompletedAt"`
|
||
|
|
CreatedAt string `json:"createdAt"`
|
||
|
|
UpdatedAt string `json:"updatedAt"`
|
||
|
|
CompletedAt string `json:"completedAt,omitempty"`
|
||
|
|
}
|
||
|
|
|
||
|
|
JobStepInstanceReply {
|
||
|
|
Id int `json:"id"`
|
||
|
|
StepId string `json:"stepId"`
|
||
|
|
AttemptNo int `json:"attemptNo"`
|
||
|
|
Status string `json:"status"`
|
||
|
|
EquipmentId int `json:"equipmentId,optional"`
|
||
|
|
StartTime string `json:"startTime,optional"`
|
||
|
|
EndTime string `json:"endTime,optional"`
|
||
|
|
}
|
||
|
|
|
||
|
|
RecipeStepBrief {
|
||
|
|
StepId string `json:"stepId"`
|
||
|
|
StepName string `json:"stepName"`
|
||
|
|
}
|
||
|
|
|
||
|
|
JobDetailReply {
|
||
|
|
JobReply
|
||
|
|
WorkOrderNo string `json:"workOrderNo"`
|
||
|
|
ProductTypeName string `json:"productTypeName"`
|
||
|
|
RecipeName string `json:"recipeName"`
|
||
|
|
CompletedTime string `json:"completedTime,omitempty"`
|
||
|
|
DockNo int `json:"dockNo,optional"`
|
||
|
|
DockSlotNo int `json:"dockSlotNo,optional"`
|
||
|
|
TempSlotNo int `json:"tempSlotNo,optional"`
|
||
|
|
StepInstances []JobStepInstanceReply `json:"stepInstances"`
|
||
|
|
RecipeSteps []RecipeStepBrief `json:"recipeSteps"`
|
||
|
|
}
|
||
|
|
)
|
||
|
|
|
||
|
|
@server (
|
||
|
|
jwt: Auth
|
||
|
|
group: job
|
||
|
|
prefix: /api/v1
|
||
|
|
)
|
||
|
|
service hougai-api {
|
||
|
|
@doc "获取工件列表"
|
||
|
|
@handler queryJobs
|
||
|
|
get /jobs (QueryJobsReq) returns (QueryJobsReply)
|
||
|
|
|
||
|
|
@doc "工单下工件分页"
|
||
|
|
@handler queryJobsOfWorkOrder
|
||
|
|
get /work-orders/:id/jobs (QueryJobsOfWorkOrderReq) returns (QueryJobsReply)
|
||
|
|
|
||
|
|
@doc "获取工件详情"
|
||
|
|
@handler getJob
|
||
|
|
get /jobs/:id (PathId) returns (JobDetailReply)
|
||
|
|
|
||
|
|
@doc "挂起工件"
|
||
|
|
@handler suspendJob
|
||
|
|
post /jobs/:id/suspend (SuspendJobReq)
|
||
|
|
|
||
|
|
@doc "恢复工件"
|
||
|
|
@handler resumeJob
|
||
|
|
post /jobs/:id/resume (ResumeJobReq)
|
||
|
|
|
||
|
|
@doc "返工工件"
|
||
|
|
@handler reworkJob
|
||
|
|
post /jobs/:id/rework (ReworkJobReq)
|
||
|
|
}
|