feat: 核心业务实体扩充(混产模板/产品BOM/试制记录)、WMS 库存检验增强与前端通用能力
- MES 新增实体:混产模板、产品BOM、产品工艺物料、试制记录(schema + ent 生成码 + logic/handler/前端页) - WMS 实体增强:检验记录、库存、半成品重构;新增序列号库存与短缺代报 - AGV 与产能:AGV 手动点位与链路、物料守卫、短缺预测、原因字典 - 前端通用能力:新增下一步引导组件 NextStepBar,统一帮助文档/布局/请求拦截与操作列 - 工位终端:界面与各 handler 调整(api/store/绑定/PLC/拧紧/上报等) - 配置与文档:更新 mes-api.yaml、WMS README 及案例/产线API/问题记录/项目说明/流程说明
This commit is contained in:
@@ -133,7 +133,7 @@ func processDoneHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
ctx.Store.AddEventLog(req.OrderNo, op, "process_done_failed",
|
||||
"报工失败(MES不可达) sn="+req.Sn+" stationNo="+itoa(req.StationNo))
|
||||
logx.Errorf("工序完成上报失败(MES不可达): %v", err)
|
||||
fail(w, http.StatusBadGateway, "MES 服务不可达,报工未成功,请检查网络后重试")
|
||||
failMes(w, err, "MES 服务不可达,报工未成功,请检查网络后重试")
|
||||
return
|
||||
}
|
||||
// MES 业务拒绝兜底(理论上已由 BizError 分支处理):缺料/SN冲突等,直接失败,不入队
|
||||
@@ -152,7 +152,7 @@ func processDoneHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
|
||||
// tempStoreHandler POST /api/report/temp-store
|
||||
// {sn, orderNo, stationNo, flowId, operator} → 调 MES /api/internal/station/checkin(半成品入库)。
|
||||
// {sn, orderNo, stationNo, flowId, operator} → 调 MES /api/internal/station/checkin(在制品暂存入库)。
|
||||
// 不可达时直接失败回前端(2026-11-05 拍板:断网即失败,无离线队列)。
|
||||
func tempStoreHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
@@ -206,7 +206,7 @@ func tempStoreHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
ctx.Store.AddEventLog(req.OrderNo, op, "temp_store_failed",
|
||||
"暂存退库失败(MES不可达) sn="+req.Sn+" stationNo="+itoa(req.StationNo))
|
||||
logx.Errorf("暂存退库上报失败(MES不可达): %v", err)
|
||||
fail(w, http.StatusBadGateway, "MES 服务不可达,暂存未成功,请检查网络后重试")
|
||||
failMes(w, err, "MES 服务不可达,暂存未成功,请检查网络后重试")
|
||||
return
|
||||
}
|
||||
// 兜底:MES 以 HTTP200+code≠0 拒绝却未被 BizError 捕获(理论不可达),按拒绝处理
|
||||
@@ -268,7 +268,7 @@ func scrapHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
}
|
||||
ctx.Store.AddEventLog("", op, "scrap_failed",
|
||||
"报废登记失败(MES不可达) sn="+req.Sn)
|
||||
fail(w, http.StatusBadGateway, "MES 不可达,报废未登记,请稍后重试(不要重复提交)")
|
||||
failMes(w, err, "MES 不可达,报废未登记,请稍后重试(不要重复提交)")
|
||||
return
|
||||
}
|
||||
if msg := mesRespCode(respBody); msg != "" {
|
||||
@@ -290,7 +290,7 @@ func mesConfigHandler(ctx *svc.ServiceContext) http.HandlerFunc {
|
||||
q := url.Values{"stationNo": {strconv.Itoa(stationNo)}}
|
||||
b, _, err := ctx.Mes.Get("/api/internal/public-config", q, bearerOf(r))
|
||||
if err != nil {
|
||||
fail(w, http.StatusBadGateway, "MES 不可达,配置获取失败")
|
||||
failMes(w, err, "MES 不可达,配置获取失败")
|
||||
return
|
||||
}
|
||||
ok(w, json.RawMessage(b))
|
||||
|
||||
Reference in New Issue
Block a user