feat: 重构BOM架构,新增基础设置与虚拟工位管理功能
本次重构删除原有BOM物料清单表,改用工单工艺组合×工艺物料清单作为唯一用料来源;新增系统基础设置表支持WMS地址、日志保留天数等配置,新增虚拟工位作业管理后台接口与前端页签控制功能,同时优化工位号校验逻辑、事件日志自动清理与工单用料查询能力。
This commit is contained in:
@@ -4,6 +4,7 @@ package ent
|
||||
|
||||
import (
|
||||
"bj_power_mes/ent/station"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -33,6 +34,8 @@ type Station struct {
|
||||
HasDock bool `json:"hasDock,omitempty"`
|
||||
// 接驳台编码 DOCK01..21
|
||||
DockCode string `json:"dockCode,omitempty"`
|
||||
// VisibleTabs holds the value of the "visibleTabs" field.
|
||||
VisibleTabs []string `json:"visibleTabs,omitempty"`
|
||||
// CreatedAt holds the value of the "createdAt" field.
|
||||
CreatedAt time.Time `json:"createdAt,omitempty"`
|
||||
selectValues sql.SelectValues
|
||||
@@ -43,6 +46,8 @@ func (*Station) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case station.FieldVisibleTabs:
|
||||
values[i] = new([]byte)
|
||||
case station.FieldIsBuiltin, station.FieldHasDock:
|
||||
values[i] = new(sql.NullBool)
|
||||
case station.FieldID, station.FieldStationNo, station.FieldFlowId:
|
||||
@@ -120,6 +125,14 @@ func (_m *Station) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
_m.DockCode = value.String
|
||||
}
|
||||
case station.FieldVisibleTabs:
|
||||
if value, ok := values[i].(*[]byte); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field visibleTabs", values[i])
|
||||
} else if value != nil && len(*value) > 0 {
|
||||
if err := json.Unmarshal(*value, &_m.VisibleTabs); err != nil {
|
||||
return fmt.Errorf("unmarshal field visibleTabs: %w", err)
|
||||
}
|
||||
}
|
||||
case station.FieldCreatedAt:
|
||||
if value, ok := values[i].(*sql.NullTime); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field createdAt", values[i])
|
||||
@@ -186,6 +199,9 @@ func (_m *Station) String() string {
|
||||
builder.WriteString("dockCode=")
|
||||
builder.WriteString(_m.DockCode)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("visibleTabs=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.VisibleTabs))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("createdAt=")
|
||||
builder.WriteString(_m.CreatedAt.Format(time.ANSIC))
|
||||
builder.WriteByte(')')
|
||||
|
||||
Reference in New Issue
Block a user