- 将文档从代码审计任务转换为端到端业务回归测试链路 - 重新组织文档结构为链路总览、示例数据基线和详细步骤 - 添加完整的业务场景清单涵盖WMS/MES/工位终端三大系统 - 定义统一的测试数据包括产品型号、物料清单、工位派工等 - 提供详细的步骤断言和数量等式验证方法 - 建立贯穿全链路的数据流向和状态变更追踪体系
40 lines
1.5 KiB
Go
40 lines
1.5 KiB
Go
package handler
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"bj_power_wms/internal/svc"
|
|
)
|
|
|
|
// 接驳台主数据真源已迁 MES(2026-09-21):仓库不再维护 dock 表,也不给接驳台派任务。
|
|
// WMS 仅在「出库目标工位下拉」处只读派生 MES 接驳台中 line 类型(产线接驳台与工位 1:1)。
|
|
|
|
// stationOption 出库目标工位下拉项(需求20:目标工位可下拉选择、不允许手输)。
|
|
// 客户口径「出库工位号来自 MES 工位列表」——以 MES 接驳台主数据中 line 类型
|
|
// (产线接驳台与工位 1:1 绑定)为真源派生工位选项,避免前端写死 1~20。
|
|
type stationOption struct {
|
|
StationNo int `json:"stationNo"`
|
|
Name string `json:"name"`
|
|
DockCode string `json:"dockCode"`
|
|
}
|
|
|
|
// listStationOptionsHandler GET /api/outbound/stations 返回产线工位下拉选项(无权限包裹,供出库页调用)。
|
|
// 数据改读 MES 接驳台主数据(dock 真源已迁 MES):过滤 line 类型且绑定工位号者。
|
|
func listStationOptionsHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
|
return func(w http.ResponseWriter, r *http.Request) {
|
|
list, err := ctx.Mes.ListDocks(ctx0())
|
|
if err != nil {
|
|
fail(w, http.StatusInternalServerError, "查询工位失败: "+err.Error())
|
|
return
|
|
}
|
|
rows := make([]stationOption, 0, len(list))
|
|
for _, d := range list {
|
|
if d.DockType != "line" || d.StationNo <= 0 {
|
|
continue
|
|
}
|
|
rows = append(rows, stationOption{StationNo: d.StationNo, Name: d.Name, DockCode: d.DockCode})
|
|
}
|
|
ok(w, map[string]any{"list": rows})
|
|
}
|
|
}
|