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
+5 -5
View File
@@ -20,7 +20,7 @@ type PlcSendReq struct {
}
// manualConfirmStationNos 人工确认工位(遗留4 PLC 标记):11/12 为下料检测位,
// 无 PLC 装配动作。流程流转到这两个工位时不做 PLC 工序码下发、不等完成信号,
// 无 PLC 装配动作。流程流转到这两个工位时不做 PLC 工艺码下发、不等完成信号,
// 走人工确认分支:下发日志直接置 DONE(人工确认即完成),流转由人工在工位终端推进。
var manualConfirmStationNos = []int{11, 12}
@@ -34,9 +34,9 @@ func isManualConfirmStation(no int) bool {
return false
}
// SendProcess 下发 PLC 工序码。
// SendProcess 下发 PLC 工艺码。
// 路线 = 工单工艺组合(唯一路线源头,工位号升序),不再按日派工派生。
// 约束:① SN 必须属于所选工单且已进线(未完工);② 上一条工序未收到完成信号,不下发下一条(模拟 S7 握手)。
// 约束:① SN 必须属于所选工单且已进线(未完工);② 上一条工艺未收到完成信号,不下发下一条(模拟 S7 握手)。
func (s *Service) SendProcess(ctx context.Context, req PlcSendReq, operator string) (*ent.PlcSendLog, error) {
if req.OrderNo == "" {
return nil, errors.New("请选择工单号")
@@ -54,7 +54,7 @@ func (s *Service) SendProcess(ctx context.Context, req PlcSendReq, operator stri
}
items, _ := RouteStationsFromWO(ctx, s.ctx.EntClient, wo)
if len(items) == 0 {
return nil, errors.New("该工单未配置工艺组合,无法下发 PLC 工序码")
return nil, errors.New("该工单未配置工艺组合,无法下发 PLC 工艺码")
}
combination := RouteStationsStrOfWO(items)
route := RouteStationsOfWO(items)
@@ -73,7 +73,7 @@ func (s *Service) SendProcess(ctx context.Context, req PlcSendReq, operator stri
if err == nil && last != nil {
done, qErr := s.ctx.PLC.Get().QueryDone(ctx)
if qErr != nil || !done {
return nil, errors.New("上一条工序尚未收到PLC完成信号,不能下发下一条")
return nil, errors.New("上一条工艺尚未收到PLC完成信号,不能下发下一条")
}
// 标记上一条为完成
_, _ = s.ctx.EntClient.PlcSendLog.UpdateOneID(last.ID).