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
-196
View File
@@ -1,196 +0,0 @@
// Code generated by ent, DO NOT EDIT.
package ent
import (
"bj_power_mes/ent/flowmaterial"
"fmt"
"strings"
"time"
"entgo.io/ent"
"entgo.io/ent/dialect/sql"
)
// FlowMaterial 工艺物料清单:一道工艺装什么料、单台用多少(备料/齐套校验的唯一源头)。
type FlowMaterial struct {
config `json:"-"`
// ID of the ent.
ID int `json:"id,omitempty"`
// 所属工艺ID
FlowId int `json:"flowId,omitempty"`
// 物料编码
MaterialCode string `json:"materialCode,omitempty"`
// MaterialName holds the value of the "materialName" field.
MaterialName string `json:"materialName,omitempty"`
// Spec holds the value of the "spec" field.
Spec string `json:"spec,omitempty"`
// Unit holds the value of the "unit" field.
Unit string `json:"unit,omitempty"`
// SnMode holds the value of the "snMode" field.
SnMode int `json:"snMode,omitempty"`
// 单台用量
UnitQty float64 `json:"unitQty,omitempty"`
// 损耗率%(仅展示口径,不参与备料计算——R7 2026-11-03 拍板:备料量=工单需求×单台用量,损耗走补料审批)
LossRate float64 `json:"lossRate,omitempty"`
// CreatedAt holds the value of the "createdAt" field.
CreatedAt time.Time `json:"createdAt,omitempty"`
selectValues sql.SelectValues
}
// scanValues returns the types for scanning values from sql.Rows.
func (*FlowMaterial) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case flowmaterial.FieldUnitQty, flowmaterial.FieldLossRate:
values[i] = new(sql.NullFloat64)
case flowmaterial.FieldID, flowmaterial.FieldFlowId, flowmaterial.FieldSnMode:
values[i] = new(sql.NullInt64)
case flowmaterial.FieldMaterialCode, flowmaterial.FieldMaterialName, flowmaterial.FieldSpec, flowmaterial.FieldUnit:
values[i] = new(sql.NullString)
case flowmaterial.FieldCreatedAt:
values[i] = new(sql.NullTime)
default:
values[i] = new(sql.UnknownType)
}
}
return values, nil
}
// assignValues assigns the values that were returned from sql.Rows (after scanning)
// to the FlowMaterial fields.
func (_m *FlowMaterial) assignValues(columns []string, values []any) error {
if m, n := len(values), len(columns); m < n {
return fmt.Errorf("mismatch number of scan values: %d != %d", m, n)
}
for i := range columns {
switch columns[i] {
case flowmaterial.FieldID:
value, ok := values[i].(*sql.NullInt64)
if !ok {
return fmt.Errorf("unexpected type %T for field id", value)
}
_m.ID = int(value.Int64)
case flowmaterial.FieldFlowId:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field flowId", values[i])
} else if value.Valid {
_m.FlowId = int(value.Int64)
}
case flowmaterial.FieldMaterialCode:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field materialCode", values[i])
} else if value.Valid {
_m.MaterialCode = value.String
}
case flowmaterial.FieldMaterialName:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field materialName", values[i])
} else if value.Valid {
_m.MaterialName = value.String
}
case flowmaterial.FieldSpec:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field spec", values[i])
} else if value.Valid {
_m.Spec = value.String
}
case flowmaterial.FieldUnit:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field unit", values[i])
} else if value.Valid {
_m.Unit = value.String
}
case flowmaterial.FieldSnMode:
if value, ok := values[i].(*sql.NullInt64); !ok {
return fmt.Errorf("unexpected type %T for field snMode", values[i])
} else if value.Valid {
_m.SnMode = int(value.Int64)
}
case flowmaterial.FieldUnitQty:
if value, ok := values[i].(*sql.NullFloat64); !ok {
return fmt.Errorf("unexpected type %T for field unitQty", values[i])
} else if value.Valid {
_m.UnitQty = value.Float64
}
case flowmaterial.FieldLossRate:
if value, ok := values[i].(*sql.NullFloat64); !ok {
return fmt.Errorf("unexpected type %T for field lossRate", values[i])
} else if value.Valid {
_m.LossRate = value.Float64
}
case flowmaterial.FieldCreatedAt:
if value, ok := values[i].(*sql.NullTime); !ok {
return fmt.Errorf("unexpected type %T for field createdAt", values[i])
} else if value.Valid {
_m.CreatedAt = value.Time
}
default:
_m.selectValues.Set(columns[i], values[i])
}
}
return nil
}
// Value returns the ent.Value that was dynamically selected and assigned to the FlowMaterial.
// This includes values selected through modifiers, order, etc.
func (_m *FlowMaterial) Value(name string) (ent.Value, error) {
return _m.selectValues.Get(name)
}
// Update returns a builder for updating this FlowMaterial.
// Note that you need to call FlowMaterial.Unwrap() before calling this method if this FlowMaterial
// was returned from a transaction, and the transaction was committed or rolled back.
func (_m *FlowMaterial) Update() *FlowMaterialUpdateOne {
return NewFlowMaterialClient(_m.config).UpdateOne(_m)
}
// Unwrap unwraps the FlowMaterial entity that was returned from a transaction after it was closed,
// so that all future queries will be executed through the driver which created the transaction.
func (_m *FlowMaterial) Unwrap() *FlowMaterial {
_tx, ok := _m.config.driver.(*txDriver)
if !ok {
panic("ent: FlowMaterial is not a transactional entity")
}
_m.config.driver = _tx.drv
return _m
}
// String implements the fmt.Stringer.
func (_m *FlowMaterial) String() string {
var builder strings.Builder
builder.WriteString("FlowMaterial(")
builder.WriteString(fmt.Sprintf("id=%v, ", _m.ID))
builder.WriteString("flowId=")
builder.WriteString(fmt.Sprintf("%v", _m.FlowId))
builder.WriteString(", ")
builder.WriteString("materialCode=")
builder.WriteString(_m.MaterialCode)
builder.WriteString(", ")
builder.WriteString("materialName=")
builder.WriteString(_m.MaterialName)
builder.WriteString(", ")
builder.WriteString("spec=")
builder.WriteString(_m.Spec)
builder.WriteString(", ")
builder.WriteString("unit=")
builder.WriteString(_m.Unit)
builder.WriteString(", ")
builder.WriteString("snMode=")
builder.WriteString(fmt.Sprintf("%v", _m.SnMode))
builder.WriteString(", ")
builder.WriteString("unitQty=")
builder.WriteString(fmt.Sprintf("%v", _m.UnitQty))
builder.WriteString(", ")
builder.WriteString("lossRate=")
builder.WriteString(fmt.Sprintf("%v", _m.LossRate))
builder.WriteString(", ")
builder.WriteString("createdAt=")
builder.WriteString(_m.CreatedAt.Format(time.ANSIC))
builder.WriteByte(')')
return builder.String()
}
// FlowMaterials is a parsable slice of FlowMaterial.
type FlowMaterials []*FlowMaterial