feat: 移除工艺物料与混产模板实体、新增产线清线与 PLC 监控实时推送、看板双屏增强

- 移除实体:MES 删除 FlowMaterial(工艺物料)与 MixProductionTemplate(混产模板)全套(schema/ent 生成码/handler/logic),清理关联路由与种子
- 新增功能:产线清线(line_clearance handler + logic)、PLC 监控 WebSocket 实时推送(ws/plc_monitor_hub + handler)
- 看板增强:新增管理屏与 KPI 组件(BoardManage/BoardKpi),调整演示屏 Mock 与各看板面板
- MES 完善:PLC 匹配/扭矩扫描/签收、工艺卡 PDF 与工单、AGV 链路、叫料/备料/在制品/短料预测等逻辑与前端调整
- 工位终端:删除离线面板 OfflinePanel,调整主界面/物料面板与 api/store/handler/路由
- WMS:AGV 托盘、物料与 MES 客户端调整及前端帮助/基础数据/叫料/托盘页
- 文档:更新产线API/客户问题/案例/部署手册/问题记录
This commit is contained in:
SunYF
2026-11-19 08:31:05 +08:00
parent f8482b18f6
commit 4c4cda1d41
148 changed files with 2511 additions and 9735 deletions
+3 -3
View File
@@ -29,7 +29,7 @@ import (
// 工位 x 的 PLC 托盘位 = 1
// 且 无工件满足 at_station = x 且 status ∈ {ONLINE, PROCESSING}
// 且 工位 x 非 DISABLED
// 且 不在「工序码下发后 15 秒」宽限窗口
// 且 不在「工艺码下发后 15 秒」宽限窗口
// ⇒ 报 plc_mes_mismatch
//
// 触发点(事件驱动,禁止定时轮询):
@@ -94,7 +94,7 @@ func (s *Service) DetectStationMismatch(ctx context.Context, stationNo int) (*Pl
fmt.Printf("[DBG] early-return: 工位 %d 禁用,不命中\n", stationNo)
return nil, nil
}
// 3) 宽限窗口:工序码下发后 15 秒内不报(PLC 握手未完成属正常瞬态,T1 握手后即覆盖此窗口)
// 3) 宽限窗口:工艺码下发后 15 秒内不报(PLC 握手未完成属正常瞬态,T1 握手后即覆盖此窗口)
inGrace, err := s.inMismatchGrace(ctx, stationNo)
if err != nil {
return nil, err
@@ -126,7 +126,7 @@ func (s *Service) DetectStationMismatch(ctx context.Context, stationNo int) (*Pl
}, nil
}
// inMismatchGrace 判断工位是否处于「工序码下发后 15 秒」宽限窗口
// inMismatchGrace 判断工位是否处于「工艺码下发后 15 秒」宽限窗口
func (s *Service) inMismatchGrace(ctx context.Context, stationNo int) (bool, error) {
since := time.Now().Add(-15 * time.Second)
n, err := s.ctx.EntClient.PlcSendLog.Query().