refactor: 重构工艺工序相关命名与数据模型

1.  全局替换"工序"为"工艺"统一术语,包括页面文案、枚举、注释
2.  重构工单与工件工艺数据模型:
    - 新增工艺组合表flow_material作为备料/齐套唯一源头
    - 新增工位状态表station_state支持自主停单/恢复接单
    - 移除station_process派工表,改用工单工艺组合作为路线唯一源头
    - 替换processCode为flowId作为工艺关联标识
    - 重构工件当前进度字段为currentStationNo
3.  删除冗余的静态备份资源文件
4.  调整物料选择组件默认启用仅显示激活物料
5.  优化工单创建/编辑逻辑,新增工艺组合校验与保存
This commit is contained in:
SunYF
2026-09-22 11:32:29 +08:00
parent 932700ca65
commit d609ff8a9e
185 changed files with 8623 additions and 4501 deletions
+11
View File
@@ -104,6 +104,17 @@ func (s *Service) IssueMove(ctx context.Context, sn, fromPoint, toPoint, orderNo
if operator == "" {
operator = "SYSTEM"
}
// 工位停单(只认当天):目标工位停单 → 不下发流转指令 + 报警(工件实际滞留于当前点位)
if to.StationNo > 0 && s.GetStationPaused(ctx, to.StationNo) {
_, _ = s.ctx.EntClient.Alert.Create().
SetRuleId(0).SetType("workpiece_unreachable").SetTitle("工件目的地不可达").
SetContent(fmt.Sprintf("目标工位%d已停止接单,指令不下发,工件 %s 滞留于 %s", to.StationNo, sn, fromPoint)).
SetRefType("line_point").SetRefId(fmt.Sprintf("%d", to.ID)).SetOrderNo(orderNo).SetReceiver("").SetStatus("UNREAD").Save(ctx)
s.ctx.EventLog.Write(ctx, "workpiece.unreachable", orderNo, operator, "line_point", toPoint,
fmt.Sprintf("目标工位%d已停止接单,工件 %s 滞留", to.StationNo, sn),
map[string]any{"sn": sn, "fromPoint": fromPoint, "toPoint": toPoint, "stationNo": to.StationNo})
return nil, fmt.Errorf("工位%d已停止接单,工件滞留", to.StationNo)
}
cmdNo := fmt.Sprintf("MV%d", time.Now().UnixNano())
cmd, err := s.ctx.EntClient.PlcMoveCmd.Create().
SetCmdNo(cmdNo).SetSn(sn).SetOrderNo(orderNo).