docs(business): 生成业务契约文档并重构MES客户端代码
- 创建案例.md文档,包含业务场景清单、业务流程、案例和回归测试三份完整文档 - WMS库房管理系统涵盖入库、出库、库存、检验、盘点等24个业务场景 - MES产线控制系统包含工单、排产、BOM、备料、质检、追溯等23个业务场景 - 工位终端系统支持上线、报工、下线、领料、巡检等15个现场作业场景 - 主链路从合同到成品入库,异常链路处理不合格、数量不符、退料等情况 - 删除MES客户端中的ScanRecord相关代码,精简客户端结构 - 更新客户端初始化逻辑,移除扫描记录相关的依赖注入配置
This commit is contained in:
@@ -126,28 +126,15 @@ func TorqueStatHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- 扫码报工 ----------
|
||||
// ---------- 报工记录 ----------
|
||||
|
||||
func ScanReportHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
var req logic.ScanReq
|
||||
if err := httpx.ParseJSON(r, &req); err != nil {
|
||||
httpx.BadRequest(w, "请求体解析失败")
|
||||
return
|
||||
}
|
||||
if err := logic.New(svcCtx).ReportScan(r.Context(), req, operator(r, "")); err != nil {
|
||||
httpx.Fail(w, 3205, err.Error())
|
||||
return
|
||||
}
|
||||
httpx.OkMessage(w, "扫码成功", nil)
|
||||
}
|
||||
}
|
||||
|
||||
func ScanRecordsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
// ReportRecordsHandler GET /workpiece/process/records?sn=&orderNo=&stationNo=&page=&pageSize=
|
||||
// 报工记录列表:直查真实报工表 workpiece_process,手动报工与工位终端报工均在此可见(报工闭环)。
|
||||
func ReportRecordsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
q := r.URL.Query()
|
||||
data, total, err := logic.New(svcCtx).ListScanRecords(r.Context(), q.Get("sn"), q.Get("orderNo"),
|
||||
atoiDefault(q.Get("page"), 1), atoiDefault(q.Get("pageSize"), 20))
|
||||
data, total, err := logic.New(svcCtx).ListProcessRecords(r.Context(), q.Get("sn"), q.Get("orderNo"),
|
||||
atoiDefault(q.Get("stationNo"), 0), atoiDefault(q.Get("page"), 1), atoiDefault(q.Get("pageSize"), 20))
|
||||
if err != nil {
|
||||
httpx.Fail(w, 3206, err.Error())
|
||||
return
|
||||
|
||||
@@ -192,8 +192,7 @@ func RegisterProductionRoutes(server *rest.Server, serverCtx *svc.ServiceContext
|
||||
{Method: http.MethodPost, Path: "/torque/audit", Handler: production.TorqueAuditHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/torque/audit-log", Handler: production.TorqueAuditLogHandler(serverCtx)},
|
||||
|
||||
{Method: http.MethodPost, Path: "/scan/report", Handler: production.ScanReportHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/scan/records", Handler: production.ScanRecordsHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/workpiece/process/records", Handler: production.ReportRecordsHandler(serverCtx)},
|
||||
{Method: http.MethodGet, Path: "/process-steps", Handler: production.ProcessStepsHandler(serverCtx)},
|
||||
|
||||
{Method: http.MethodPost, Path: "/workpiece/online", Handler: production.OnlineWorkpieceHandler(serverCtx)},
|
||||
|
||||
Reference in New Issue
Block a user