docs(test): 更新电表箱装配业务回归测试文档
- 将文档从代码审计任务转换为端到端业务回归测试链路 - 重新组织文档结构为链路总览、示例数据基线和详细步骤 - 添加完整的业务场景清单涵盖WMS/MES/工位终端三大系统 - 定义统一的测试数据包括产品型号、物料清单、工位派工等 - 提供详细的步骤断言和数量等式验证方法 - 建立贯穿全链路的数据流向和状态变更追踪体系
This commit is contained in:
@@ -133,6 +133,54 @@ func (c *Client) FetchProducible(ctx context.Context) (*ProducibleResult, error)
|
||||
return &env.Data, nil
|
||||
}
|
||||
|
||||
// DockRow MES 接驳台主数据行(dock 真源已迁 MES,WMS 仅只读取用)。
|
||||
type DockRow struct {
|
||||
ID int64 `json:"id"`
|
||||
DockCode string `json:"dockCode"`
|
||||
Name string `json:"name"`
|
||||
DockType string `json:"dockType"`
|
||||
StationNo int `json:"stationNo"`
|
||||
Status string `json:"status"`
|
||||
HasPallet bool `json:"hasPallet"`
|
||||
PalletRef string `json:"palletRef"`
|
||||
}
|
||||
|
||||
// ListDocks 拉取 MES 接驳台主数据(dock 真源在 MES)。
|
||||
// WMS 出库目标工位下拉 / AGV 页接驳台列表均读此接口,仓库不再本地维护 dock 表。
|
||||
func (c *Client) ListDocks(ctx context.Context) ([]DockRow, error) {
|
||||
req, err := http.NewRequestWithContext(ctx, http.MethodGet, c.baseURL+"/api/internal/docks", nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
req.Header.Set("X-API-TOKEN", c.token)
|
||||
resp, err := c.hc.Do(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
defer resp.Body.Close()
|
||||
var env struct {
|
||||
Code int `json:"code"`
|
||||
Data struct {
|
||||
List []DockRow `json:"list"`
|
||||
} `json:"data"`
|
||||
Msg string `json:"message"`
|
||||
}
|
||||
if err := json.NewDecoder(resp.Body).Decode(&env); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if env.Code != 0 {
|
||||
msg := env.Msg
|
||||
if msg == "" {
|
||||
msg = "MES 返回失败"
|
||||
}
|
||||
return nil, errors.New(msg)
|
||||
}
|
||||
if env.Data.List == nil {
|
||||
return []DockRow{}, nil
|
||||
}
|
||||
return env.Data.List, nil
|
||||
}
|
||||
|
||||
// MarkStatus 回写备料单状态(DELIVERING / DONE)
|
||||
func (c *Client) MarkStatus(ctx context.Context, requestNo, status string) error {
|
||||
b, _ := json.Marshal(map[string]string{"requestNo": requestNo, "status": status})
|
||||
|
||||
Reference in New Issue
Block a user