diff --git a/.playwright-cli/page-2026-11-25T06-02-12-533Z.yml b/.playwright-cli/page-2026-11-25T06-02-12-533Z.yml deleted file mode 100644 index c506743..0000000 --- a/.playwright-cli/page-2026-11-25T06-02-12-533Z.yml +++ /dev/null @@ -1,14 +0,0 @@ -- generic [ref=e4]: - - heading "工位终端" [level=1] [ref=e5] - - paragraph [ref=e6]: 产线触屏终端(端口 8892) - - generic [ref=e7]: - - generic [ref=e8]: 账号 - - textbox "请输入账号" [ref=e11] - - generic [ref=e13]: - - generic [ref=e14]: 密码 - - textbox "请输入密码" [ref=e17] - - generic [ref=e18]: - - generic [ref=e19]: 工位 - - generic [ref=e20]: 工位 1 - - button "登 录" [ref=e21] [cursor=pointer] - - paragraph [ref=e23]: 账号由 MES 统一管理 \ No newline at end of file diff --git a/.playwright-cli/page-2026-11-25T06-02-59-147Z.yml b/.playwright-cli/page-2026-11-25T06-02-59-147Z.yml deleted file mode 100644 index c506743..0000000 --- a/.playwright-cli/page-2026-11-25T06-02-59-147Z.yml +++ /dev/null @@ -1,14 +0,0 @@ -- generic [ref=e4]: - - heading "工位终端" [level=1] [ref=e5] - - paragraph [ref=e6]: 产线触屏终端(端口 8892) - - generic [ref=e7]: - - generic [ref=e8]: 账号 - - textbox "请输入账号" [ref=e11] - - generic [ref=e13]: - - generic [ref=e14]: 密码 - - textbox "请输入密码" [ref=e17] - - generic [ref=e18]: - - generic [ref=e19]: 工位 - - generic [ref=e20]: 工位 1 - - button "登 录" [ref=e21] [cursor=pointer] - - paragraph [ref=e23]: 账号由 MES 统一管理 \ No newline at end of file diff --git a/bj_power_mes/common/dockcode/dockcode.go b/bj_power_mes/common/dockcode/dockcode.go new file mode 100644 index 0000000..e7cc510 --- /dev/null +++ b/bj_power_mes/common/dockcode/dockcode.go @@ -0,0 +1,117 @@ +// Package dockcode 接驳台(工位接驳台 / 库房接驳台)编码的唯一真源。 +// +// 2026-12-01 用户终版: +// - 工位接驳台编码 = GW{工位号}{Z|Y},Z=左、Y=右,工位 1~10 统一规则,不做左右互换; +// - 库房接驳台 = JBT21(不变); +// - 该编码就是海康 RCS 地图点位码:落库、界面显示、下发 RCS、读 PLC 传感器全部用它, +// 旧 DOCK01~20 编号已全量废弃,系统内不存在第二套编号,也不存在任何换算层。 +// +// 接驳台序号(PLC 托盘传感器位序 1~20,对应点表「工位N后接驳台1/2」): +// 奇数工位 1=左(Z)、2=右(Y);偶数工位 1=右(Y)、2=左(Z)。物理位 = MB900.0 起顺排。 +// +// 运行时不用正则:固定前缀/后缀一律走前缀判断与切片解析。 +package dockcode + +import ( + "strconv" + "strings" +) + +// Store 库房接驳台编码(唯一允许人工派车的接驳台点位)。 +const Store = "JBT21" + +// Station 工位接驳台编码:工位号 1~10 + 左右 → GW{no}{Z|Y};非法入参返回空串。 +func Station(no int, left bool) string { + if no < 1 || no > 10 { + return "" + } + suffix := "Y" + if left { + suffix = "Z" + } + return "GW" + strconv.Itoa(no) + suffix +} + +// Parse 解析工位接驳台编码:GW{1..10}{Z|Y} → 工位号、是否左台。非本格式 ok=false。 +func Parse(code string) (no int, left bool, ok bool) { + c := strings.ToUpper(strings.TrimSpace(code)) + if len(c) < 4 || c[0] != 'G' || c[1] != 'W' { + return 0, false, false + } + last := c[len(c)-1] + if last != 'Z' && last != 'Y' { + return 0, false, false + } + n, err := strconv.Atoi(c[2 : len(c)-1]) + if err != nil || n < 1 || n > 10 { + return 0, false, false + } + return n, last == 'Z', true +} + +// IsStation 是否工位接驳台编码。 +func IsStation(code string) bool { + _, _, ok := Parse(code) + return ok +} + +// Side 左右:left / right;非工位接驳台(含 JBT21、虚拟点)返回空串。 +func Side(code string) string { + _, left, ok := Parse(code) + if !ok { + return "" + } + if left { + return "left" + } + return "right" +} + +// SideCn 左右中文:左 / 右;非工位接驳台返回空串。 +func SideCn(code string) string { + switch Side(code) { + case "left": + return "左" + case "right": + return "右" + } + return "" +} + +// Seq 接驳台序号 1~20(PLC 托盘传感器位序);非工位接驳台返回 0。 +func Seq(code string) int { + n, left, ok := Parse(code) + if !ok { + return 0 + } + firstLeft := n%2 == 1 // 奇数工位的接驳台1 是左台 + if left == firstLeft { + return 2*n - 1 + } + return 2 * n +} + +// CodeOfSeq 接驳台序号 1~20 → 编码;越界返回空串。 +func CodeOfSeq(seq int) string { + if seq < 1 || seq > 20 { + return "" + } + n := (seq + 1) / 2 + firstLeft := n%2 == 1 + return Station(n, (seq%2 == 1) == firstLeft) +} + +// Label 中文显示名:工位N左 / 工位N右 / 库房接驳台;其它编码原样返回。 +func Label(code string) string { + c := strings.ToUpper(strings.TrimSpace(code)) + if c == Store { + return "库房接驳台" + } + if n, left, ok := Parse(c); ok { + if left { + return "工位" + strconv.Itoa(n) + "左" + } + return "工位" + strconv.Itoa(n) + "右" + } + return code +} diff --git a/bj_power_mes/common/dockcode/dockcode_test.go b/bj_power_mes/common/dockcode/dockcode_test.go new file mode 100644 index 0000000..d48f70e --- /dev/null +++ b/bj_power_mes/common/dockcode/dockcode_test.go @@ -0,0 +1,83 @@ +package dockcode + +import "testing" + +// 编码规则:GW{工位号}{Z|Y},Z=左、Y=右,工位 1~10 统一,不做左右互换。 +func TestStation(t *testing.T) { + cases := []struct { + no int + left bool + want string + }{ + {1, true, "GW1Z"}, {1, false, "GW1Y"}, + {2, true, "GW2Z"}, {2, false, "GW2Y"}, + {10, true, "GW10Z"}, {10, false, "GW10Y"}, + {0, true, ""}, {11, false, ""}, + } + for _, c := range cases { + if got := Station(c.no, c.left); got != c.want { + t.Fatalf("Station(%d,%v)=%q, want %q", c.no, c.left, got, c.want) + } + } +} + +func TestParse(t *testing.T) { + for _, code := range []string{"GW1Z", "GW1Y", "GW2Z", "GW10Y", "gw3z"} { + if _, _, ok := Parse(code); !ok { + t.Fatalf("Parse(%q) 应解析成功", code) + } + } + for _, code := range []string{"", "JBT21", "GW0Z", "GW11Z", "GW1X", "GWX", "G1Z", "GW1"} { + if _, _, ok := Parse(code); ok { + t.Fatalf("Parse(%q) 不应解析成功", code) + } + } + n, left, _ := Parse("GW2Z") + if n != 2 || !left { + t.Fatalf("Parse(GW2Z)=%d,%v,want 2,true", n, left) + } +} + +// 接驳台序号(PLC 位序):奇数工位 1=左(Z)/2=右(Y),偶数工位 1=右(Y)/2=左(Z)。 +func TestSeq(t *testing.T) { + cases := map[string]int{ + "GW1Z": 1, "GW1Y": 2, + "GW2Y": 3, "GW2Z": 4, + "GW3Z": 5, "GW3Y": 6, + "GW10Y": 19, "GW10Z": 20, + "JBT21": 0, "A1": 0, + } + for code, want := range cases { + if got := Seq(code); got != want { + t.Fatalf("Seq(%q)=%d, want %d", code, got, want) + } + } +} + +func TestCodeOfSeq(t *testing.T) { + for seq := 1; seq <= 20; seq++ { + code := CodeOfSeq(seq) + if code == "" { + t.Fatalf("CodeOfSeq(%d) 为空", seq) + } + if got := Seq(code); got != seq { + t.Fatalf("CodeOfSeq(%d)=%q 反解序号=%d,不自洽", seq, code, got) + } + } + if CodeOfSeq(0) != "" || CodeOfSeq(21) != "" { + t.Fatalf("越界序号应返回空串") + } +} + +func TestLabel(t *testing.T) { + cases := map[string]string{ + "GW1Z": "工位1左", "GW1Y": "工位1右", + "GW2Z": "工位2左", "GW10Y": "工位10右", + "JBT21": "库房接驳台", "A1": "A1", + } + for code, want := range cases { + if got := Label(code); got != want { + t.Fatalf("Label(%q)=%q, want %q", code, got, want) + } + } +} diff --git a/bj_power_mes/ent/agvtask.go b/bj_power_mes/ent/agvtask.go index f908289..dbb316a 100644 --- a/bj_power_mes/ent/agvtask.go +++ b/bj_power_mes/ent/agvtask.go @@ -20,7 +20,7 @@ type AgvTask struct { TaskNo string `json:"task_no,omitempty"` // 起点接驳台(空车段可为空=单点path由RCS派最近空闲车) SourceDock string `json:"source_dock,omitempty"` - // 终点接驳台/点位 DOCK01..21 或 AGV-CHARGE01 + // 终点接驳台/点位 GW{工位号}{Z|Y} / JBT21 / 虚拟点位 / AGV-CHARGE01 TargetDock string `json:"target_dock,omitempty"` // 物料清单 JSON MaterialsJSON string `json:"materials_json,omitempty"` diff --git a/bj_power_mes/ent/dock.go b/bj_power_mes/ent/dock.go index 6b28189..3e95f32 100644 --- a/bj_power_mes/ent/dock.go +++ b/bj_power_mes/ent/dock.go @@ -12,12 +12,12 @@ import ( "entgo.io/ent/dialect/sql" ) -// Dock 接驳台主数据:DOCK01~DOCK20(产线,DOCKn↔工位n)+ JBT21(库房收货;T7 2026-11-03 统一代号)。 +// Dock 接驳台主数据:工位接驳台 GW{工位号}{Z|Y}(Z=左、Y=右,工位1~10)+ JBT21(库房收货)。编码即 RCS 地图点位码。 type Dock struct { config `json:"-"` // ID of the ent. ID int `json:"id,omitempty"` - // 接驳台编码 DOCK01..21 + // 接驳台编码 = AGV/RCS 点位码:GW1Z..GW10Y(Z=左、Y=右)/ JBT21 DockCode string `json:"dockCode,omitempty"` // 接驳台名称 Name string `json:"name,omitempty"` @@ -25,8 +25,6 @@ type Dock struct { DockType string `json:"dockType,omitempty"` // 关联工位号(与工位1:1,非产线为0) StationNo int `json:"stationNo,omitempty"` - // 左右:left=操作员左手边/right=右手边(按操作员朝向区分,下排工位与地图左右相反) - Side string `json:"side,omitempty"` // 当前是否有托盘 HasPallet bool `json:"hasPallet,omitempty"` // 托盘关联(出库单号/备料单号) @@ -47,7 +45,7 @@ func (*Dock) scanValues(columns []string) ([]any, error) { values[i] = new(sql.NullBool) case dock.FieldID, dock.FieldStationNo: values[i] = new(sql.NullInt64) - case dock.FieldDockCode, dock.FieldName, dock.FieldDockType, dock.FieldSide, dock.FieldPalletRef, dock.FieldStatus: + case dock.FieldDockCode, dock.FieldName, dock.FieldDockType, dock.FieldPalletRef, dock.FieldStatus: values[i] = new(sql.NullString) case dock.FieldCreatedAt: values[i] = new(sql.NullTime) @@ -96,12 +94,6 @@ func (_m *Dock) assignValues(columns []string, values []any) error { } else if value.Valid { _m.StationNo = int(value.Int64) } - case dock.FieldSide: - if value, ok := values[i].(*sql.NullString); !ok { - return fmt.Errorf("unexpected type %T for field side", values[i]) - } else if value.Valid { - _m.Side = value.String - } case dock.FieldHasPallet: if value, ok := values[i].(*sql.NullBool); !ok { return fmt.Errorf("unexpected type %T for field hasPallet", values[i]) @@ -174,9 +166,6 @@ func (_m *Dock) String() string { builder.WriteString("stationNo=") builder.WriteString(fmt.Sprintf("%v", _m.StationNo)) builder.WriteString(", ") - builder.WriteString("side=") - builder.WriteString(_m.Side) - builder.WriteString(", ") builder.WriteString("hasPallet=") builder.WriteString(fmt.Sprintf("%v", _m.HasPallet)) builder.WriteString(", ") diff --git a/bj_power_mes/ent/dock/dock.go b/bj_power_mes/ent/dock/dock.go index d1f8d68..47e7f2e 100644 --- a/bj_power_mes/ent/dock/dock.go +++ b/bj_power_mes/ent/dock/dock.go @@ -21,8 +21,6 @@ const ( FieldDockType = "dock_type" // FieldStationNo holds the string denoting the stationno field in the database. FieldStationNo = "station_no" - // FieldSide holds the string denoting the side field in the database. - FieldSide = "side" // FieldHasPallet holds the string denoting the haspallet field in the database. FieldHasPallet = "has_pallet" // FieldPalletRef holds the string denoting the palletref field in the database. @@ -42,7 +40,6 @@ var Columns = []string{ FieldName, FieldDockType, FieldStationNo, - FieldSide, FieldHasPallet, FieldPalletRef, FieldStatus, @@ -72,10 +69,6 @@ var ( DockTypeValidator func(string) error // DefaultStationNo holds the default value on creation for the "stationNo" field. DefaultStationNo int - // DefaultSide holds the default value on creation for the "side" field. - DefaultSide string - // SideValidator is a validator for the "side" field. It is called by the builders before save. - SideValidator func(string) error // DefaultHasPallet holds the default value on creation for the "hasPallet" field. DefaultHasPallet bool // DefaultPalletRef holds the default value on creation for the "palletRef" field. @@ -118,11 +111,6 @@ func ByStationNo(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldStationNo, opts...).ToFunc() } -// BySide orders the results by the side field. -func BySide(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldSide, opts...).ToFunc() -} - // ByHasPallet orders the results by the hasPallet field. func ByHasPallet(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldHasPallet, opts...).ToFunc() diff --git a/bj_power_mes/ent/dock/where.go b/bj_power_mes/ent/dock/where.go index b226eeb..bd20ad3 100644 --- a/bj_power_mes/ent/dock/where.go +++ b/bj_power_mes/ent/dock/where.go @@ -74,11 +74,6 @@ func StationNo(v int) predicate.Dock { return predicate.Dock(sql.FieldEQ(FieldStationNo, v)) } -// Side applies equality check predicate on the "side" field. It's identical to SideEQ. -func Side(v string) predicate.Dock { - return predicate.Dock(sql.FieldEQ(FieldSide, v)) -} - // HasPallet applies equality check predicate on the "hasPallet" field. It's identical to HasPalletEQ. func HasPallet(v bool) predicate.Dock { return predicate.Dock(sql.FieldEQ(FieldHasPallet, v)) @@ -334,71 +329,6 @@ func StationNoLTE(v int) predicate.Dock { return predicate.Dock(sql.FieldLTE(FieldStationNo, v)) } -// SideEQ applies the EQ predicate on the "side" field. -func SideEQ(v string) predicate.Dock { - return predicate.Dock(sql.FieldEQ(FieldSide, v)) -} - -// SideNEQ applies the NEQ predicate on the "side" field. -func SideNEQ(v string) predicate.Dock { - return predicate.Dock(sql.FieldNEQ(FieldSide, v)) -} - -// SideIn applies the In predicate on the "side" field. -func SideIn(vs ...string) predicate.Dock { - return predicate.Dock(sql.FieldIn(FieldSide, vs...)) -} - -// SideNotIn applies the NotIn predicate on the "side" field. -func SideNotIn(vs ...string) predicate.Dock { - return predicate.Dock(sql.FieldNotIn(FieldSide, vs...)) -} - -// SideGT applies the GT predicate on the "side" field. -func SideGT(v string) predicate.Dock { - return predicate.Dock(sql.FieldGT(FieldSide, v)) -} - -// SideGTE applies the GTE predicate on the "side" field. -func SideGTE(v string) predicate.Dock { - return predicate.Dock(sql.FieldGTE(FieldSide, v)) -} - -// SideLT applies the LT predicate on the "side" field. -func SideLT(v string) predicate.Dock { - return predicate.Dock(sql.FieldLT(FieldSide, v)) -} - -// SideLTE applies the LTE predicate on the "side" field. -func SideLTE(v string) predicate.Dock { - return predicate.Dock(sql.FieldLTE(FieldSide, v)) -} - -// SideContains applies the Contains predicate on the "side" field. -func SideContains(v string) predicate.Dock { - return predicate.Dock(sql.FieldContains(FieldSide, v)) -} - -// SideHasPrefix applies the HasPrefix predicate on the "side" field. -func SideHasPrefix(v string) predicate.Dock { - return predicate.Dock(sql.FieldHasPrefix(FieldSide, v)) -} - -// SideHasSuffix applies the HasSuffix predicate on the "side" field. -func SideHasSuffix(v string) predicate.Dock { - return predicate.Dock(sql.FieldHasSuffix(FieldSide, v)) -} - -// SideEqualFold applies the EqualFold predicate on the "side" field. -func SideEqualFold(v string) predicate.Dock { - return predicate.Dock(sql.FieldEqualFold(FieldSide, v)) -} - -// SideContainsFold applies the ContainsFold predicate on the "side" field. -func SideContainsFold(v string) predicate.Dock { - return predicate.Dock(sql.FieldContainsFold(FieldSide, v)) -} - // HasPalletEQ applies the EQ predicate on the "hasPallet" field. func HasPalletEQ(v bool) predicate.Dock { return predicate.Dock(sql.FieldEQ(FieldHasPallet, v)) diff --git a/bj_power_mes/ent/dock_create.go b/bj_power_mes/ent/dock_create.go index c2d00b1..8ff007b 100644 --- a/bj_power_mes/ent/dock_create.go +++ b/bj_power_mes/ent/dock_create.go @@ -68,20 +68,6 @@ func (_c *DockCreate) SetNillableStationNo(v *int) *DockCreate { return _c } -// SetSide sets the "side" field. -func (_c *DockCreate) SetSide(v string) *DockCreate { - _c.mutation.SetSide(v) - return _c -} - -// SetNillableSide sets the "side" field if the given value is not nil. -func (_c *DockCreate) SetNillableSide(v *string) *DockCreate { - if v != nil { - _c.SetSide(*v) - } - return _c -} - // SetHasPallet sets the "hasPallet" field. func (_c *DockCreate) SetHasPallet(v bool) *DockCreate { _c.mutation.SetHasPallet(v) @@ -185,10 +171,6 @@ func (_c *DockCreate) defaults() { v := dock.DefaultStationNo _c.mutation.SetStationNo(v) } - if _, ok := _c.mutation.Side(); !ok { - v := dock.DefaultSide - _c.mutation.SetSide(v) - } if _, ok := _c.mutation.HasPallet(); !ok { v := dock.DefaultHasPallet _c.mutation.SetHasPallet(v) @@ -236,14 +218,6 @@ func (_c *DockCreate) check() error { if _, ok := _c.mutation.StationNo(); !ok { return &ValidationError{Name: "stationNo", err: errors.New(`ent: missing required field "Dock.stationNo"`)} } - if _, ok := _c.mutation.Side(); !ok { - return &ValidationError{Name: "side", err: errors.New(`ent: missing required field "Dock.side"`)} - } - if v, ok := _c.mutation.Side(); ok { - if err := dock.SideValidator(v); err != nil { - return &ValidationError{Name: "side", err: fmt.Errorf(`ent: validator failed for field "Dock.side": %w`, err)} - } - } if _, ok := _c.mutation.HasPallet(); !ok { return &ValidationError{Name: "hasPallet", err: errors.New(`ent: missing required field "Dock.hasPallet"`)} } @@ -305,10 +279,6 @@ func (_c *DockCreate) createSpec() (*Dock, *sqlgraph.CreateSpec) { _spec.SetField(dock.FieldStationNo, field.TypeInt, value) _node.StationNo = value } - if value, ok := _c.mutation.Side(); ok { - _spec.SetField(dock.FieldSide, field.TypeString, value) - _node.Side = value - } if value, ok := _c.mutation.HasPallet(); ok { _spec.SetField(dock.FieldHasPallet, field.TypeBool, value) _node.HasPallet = value diff --git a/bj_power_mes/ent/dock_update.go b/bj_power_mes/ent/dock_update.go index 9b2b196..0935a73 100644 --- a/bj_power_mes/ent/dock_update.go +++ b/bj_power_mes/ent/dock_update.go @@ -91,20 +91,6 @@ func (_u *DockUpdate) AddStationNo(v int) *DockUpdate { return _u } -// SetSide sets the "side" field. -func (_u *DockUpdate) SetSide(v string) *DockUpdate { - _u.mutation.SetSide(v) - return _u -} - -// SetNillableSide sets the "side" field if the given value is not nil. -func (_u *DockUpdate) SetNillableSide(v *string) *DockUpdate { - if v != nil { - _u.SetSide(*v) - } - return _u -} - // SetHasPallet sets the "hasPallet" field. func (_u *DockUpdate) SetHasPallet(v bool) *DockUpdate { _u.mutation.SetHasPallet(v) @@ -202,11 +188,6 @@ func (_u *DockUpdate) check() error { return &ValidationError{Name: "dockType", err: fmt.Errorf(`ent: validator failed for field "Dock.dockType": %w`, err)} } } - if v, ok := _u.mutation.Side(); ok { - if err := dock.SideValidator(v); err != nil { - return &ValidationError{Name: "side", err: fmt.Errorf(`ent: validator failed for field "Dock.side": %w`, err)} - } - } if v, ok := _u.mutation.PalletRef(); ok { if err := dock.PalletRefValidator(v); err != nil { return &ValidationError{Name: "palletRef", err: fmt.Errorf(`ent: validator failed for field "Dock.palletRef": %w`, err)} @@ -253,9 +234,6 @@ func (_u *DockUpdate) sqlSave(ctx context.Context) (_node int, err error) { if value, ok := _u.mutation.AddedStationNo(); ok { _spec.AddField(dock.FieldStationNo, field.TypeInt, value) } - if value, ok := _u.mutation.Side(); ok { - _spec.SetField(dock.FieldSide, field.TypeString, value) - } if value, ok := _u.mutation.HasPallet(); ok { _spec.SetField(dock.FieldHasPallet, field.TypeBool, value) } @@ -353,20 +331,6 @@ func (_u *DockUpdateOne) AddStationNo(v int) *DockUpdateOne { return _u } -// SetSide sets the "side" field. -func (_u *DockUpdateOne) SetSide(v string) *DockUpdateOne { - _u.mutation.SetSide(v) - return _u -} - -// SetNillableSide sets the "side" field if the given value is not nil. -func (_u *DockUpdateOne) SetNillableSide(v *string) *DockUpdateOne { - if v != nil { - _u.SetSide(*v) - } - return _u -} - // SetHasPallet sets the "hasPallet" field. func (_u *DockUpdateOne) SetHasPallet(v bool) *DockUpdateOne { _u.mutation.SetHasPallet(v) @@ -477,11 +441,6 @@ func (_u *DockUpdateOne) check() error { return &ValidationError{Name: "dockType", err: fmt.Errorf(`ent: validator failed for field "Dock.dockType": %w`, err)} } } - if v, ok := _u.mutation.Side(); ok { - if err := dock.SideValidator(v); err != nil { - return &ValidationError{Name: "side", err: fmt.Errorf(`ent: validator failed for field "Dock.side": %w`, err)} - } - } if v, ok := _u.mutation.PalletRef(); ok { if err := dock.PalletRefValidator(v); err != nil { return &ValidationError{Name: "palletRef", err: fmt.Errorf(`ent: validator failed for field "Dock.palletRef": %w`, err)} @@ -545,9 +504,6 @@ func (_u *DockUpdateOne) sqlSave(ctx context.Context) (_node *Dock, err error) { if value, ok := _u.mutation.AddedStationNo(); ok { _spec.AddField(dock.FieldStationNo, field.TypeInt, value) } - if value, ok := _u.mutation.Side(); ok { - _spec.SetField(dock.FieldSide, field.TypeString, value) - } if value, ok := _u.mutation.HasPallet(); ok { _spec.SetField(dock.FieldHasPallet, field.TypeBool, value) } diff --git a/bj_power_mes/ent/migrate/schema.go b/bj_power_mes/ent/migrate/schema.go index 487842c..17ab335 100644 --- a/bj_power_mes/ent/migrate/schema.go +++ b/bj_power_mes/ent/migrate/schema.go @@ -54,7 +54,7 @@ var ( {Name: "id", Type: field.TypeInt, Increment: true}, {Name: "task_no", Type: field.TypeString, Unique: true, Size: 64, Comment: "我方任务号(内部,同时作为 RCS reqCode/taskCode 追踪键)"}, {Name: "source_dock", Type: field.TypeString, Size: 20, Comment: "起点接驳台(空车段可为空=单点path由RCS派最近空闲车)", Default: ""}, - {Name: "target_dock", Type: field.TypeString, Size: 20, Comment: "终点接驳台/点位 DOCK01..21 或 AGV-CHARGE01", Default: ""}, + {Name: "target_dock", Type: field.TypeString, Size: 20, Comment: "终点接驳台/点位 GW{工位号}{Z|Y} / JBT21 / 虚拟点位 / AGV-CHARGE01", Default: ""}, {Name: "materials_json", Type: field.TypeString, Size: 4000, Comment: "物料清单 JSON", Default: ""}, {Name: "related_request_no", Type: field.TypeString, Nullable: true, Size: 64, Comment: "关联叫料单号(MES material_request.requestNo)", Default: ""}, {Name: "related_outbound_no", Type: field.TypeString, Nullable: true, Size: 64, Comment: "关联出库单号(可选, WMS 回传)", Default: ""}, @@ -387,11 +387,10 @@ var ( // DockColumns holds the columns for the "dock" table. DockColumns = []*schema.Column{ {Name: "id", Type: field.TypeInt, Increment: true}, - {Name: "dock_code", Type: field.TypeString, Unique: true, Size: 20, Comment: "接驳台编码 DOCK01..21"}, + {Name: "dock_code", Type: field.TypeString, Unique: true, Size: 20, Comment: "接驳台编码 = AGV/RCS 点位码:GW1Z..GW10Y(Z=左、Y=右)/ JBT21"}, {Name: "name", Type: field.TypeString, Size: 64, Comment: "接驳台名称", Default: ""}, {Name: "dock_type", Type: field.TypeString, Size: 16, Comment: "类型 line产线/store库房/other其他", Default: "line"}, {Name: "station_no", Type: field.TypeInt, Comment: "关联工位号(与工位1:1,非产线为0)", Default: 0}, - {Name: "side", Type: field.TypeString, Size: 8, Comment: "左右:left=操作员左手边/right=右手边(按操作员朝向区分,下排工位与地图左右相反)", Default: "left"}, {Name: "has_pallet", Type: field.TypeBool, Comment: "当前是否有托盘", Default: false}, {Name: "pallet_ref", Type: field.TypeString, Nullable: true, Size: 64, Comment: "托盘关联(出库单号/备料单号)", Default: ""}, {Name: "status", Type: field.TypeString, Size: 20, Default: "ENABLED"}, @@ -400,7 +399,7 @@ var ( // DockTable holds the schema information for the "dock" table. DockTable = &schema.Table{ Name: "dock", - Comment: "Dock 接驳台主数据:DOCK01~DOCK20(产线,DOCKn↔工位n)+ JBT21(库房收货;T7 2026-11-03 统一代号)。", + Comment: "Dock 接驳台主数据:工位接驳台 GW{工位号}{Z|Y}(Z=左、Y=右,工位1~10)+ JBT21(库房收货)。编码即 RCS 地图点位码。", Columns: DockColumns, PrimaryKey: []*schema.Column{DockColumns[0]}, Indexes: []*schema.Index{ @@ -836,11 +835,8 @@ var ( {Name: "seq", Type: field.TypeInt, Comment: "步骤序号", Default: 1}, {Name: "name", Type: field.TypeString, Size: 128, Comment: "步骤名称"}, {Name: "collect_type", Type: field.TypeString, Size: 20, Comment: "采集方式 AUTO(拧紧枪自动)/MANUAL(手填)/SCAN(扫码,与手填等价采一串字符串)/NONE(仅记录)", Default: "NONE"}, - {Name: "need_check", Type: field.TypeBool, Comment: "是否需要检测确认(报工前须检验通过)", Default: false}, - {Name: "need_operator_sign", Type: field.TypeBool, Comment: "是否需要操作工签字(报工前须签字确认)", Default: false}, - {Name: "need_inspector_sign", Type: field.TypeBool, Comment: "是否需要检验员签字(审核通过并签字后放行)", Default: false}, - {Name: "need_audit", Type: field.TypeBool, Comment: "是否需要审核人复核签字(审核通过后放行)", Default: false}, - {Name: "audit_role", Type: field.TypeString, Nullable: true, Size: 64, Comment: "审核角色(如班组长/工艺员),具该角色的人员可签", Default: ""}, + {Name: "need_check", Type: field.TypeBool, Comment: "是否需要工人自检(报工前须勾选确认)", Default: false}, + {Name: "need_inspector_sign", Type: field.TypeBool, Comment: "是否需要检验员签字(检验员签OK后放行)", Default: false}, {Name: "attachment", Type: field.TypeJSON, Nullable: true, Comment: "本步骤图纸/附件列表 [{name,url}]", SchemaType: map[string]string{"postgres": "jsonb"}}, {Name: "remark", Type: field.TypeString, Size: 255, Default: ""}, {Name: "created_at", Type: field.TypeTime}, @@ -1291,8 +1287,12 @@ var ( {Name: "station_no", Type: field.TypeString, Size: 32, Comment: "工位号", Default: ""}, {Name: "step_id", Type: field.TypeInt, Comment: "工艺步骤ID", Default: 0}, {Name: "step_name", Type: field.TypeString, Size: 128, Comment: "步骤名称", Default: ""}, - {Name: "sign_role", Type: field.TypeString, Size: 16, Comment: "签字角色 OPERATOR/INSPECTOR", Default: "OPERATOR"}, + {Name: "sign_role", Type: field.TypeString, Size: 16, Comment: "签字角色 CALL/INSPECTOR", Default: "CALL"}, {Name: "result", Type: field.TypeString, Size: 10, Comment: "签字时点的结论 OK/NG", Default: "OK"}, + {Name: "step_value", Type: field.TypeString, Size: 128, Comment: "步骤录入值快照", Default: ""}, + {Name: "step_text", Type: field.TypeString, Size: 255, Comment: "步骤录入文本快照", Default: ""}, + {Name: "step_checked", Type: field.TypeBool, Comment: "步骤自检勾选快照", Default: false}, + {Name: "process_id", Type: field.TypeInt64, Nullable: true, Comment: "采集来源工艺步骤数据ID(可选)"}, {Name: "signed_by", Type: field.TypeString, Size: 64, Comment: "签字人(登录账号)", Default: ""}, {Name: "signed_at", Type: field.TypeTime, Comment: "签字时间"}, {Name: "round", Type: field.TypeInt, Comment: "返修重做轮次(1=首做)", Default: 1}, @@ -1308,14 +1308,14 @@ var ( // StepSignRecordTable holds the schema information for the "step_sign_record" table. StepSignRecordTable = &schema.Table{ Name: "step_sign_record", - Comment: "StepSignRecord 步骤签字记录:工艺步骤配置 need_operator_sign/need_inspector_sign 后,", + Comment: "StepSignRecord 步骤签字记录:报检呼叫与检验员签字留痕", Columns: StepSignRecordColumns, PrimaryKey: []*schema.Column{StepSignRecordColumns[0]}, Indexes: []*schema.Index{ { Name: "stepsignrecord_sn_station_no_step_id_sign_role_round", Unique: true, - Columns: []*schema.Column{StepSignRecordColumns[1], StepSignRecordColumns[4], StepSignRecordColumns[5], StepSignRecordColumns[7], StepSignRecordColumns[11]}, + Columns: []*schema.Column{StepSignRecordColumns[1], StepSignRecordColumns[4], StepSignRecordColumns[5], StepSignRecordColumns[7], StepSignRecordColumns[15]}, }, { Name: "stepsignrecord_sn", diff --git a/bj_power_mes/ent/mutation.go b/bj_power_mes/ent/mutation.go index f871422..0206212 100644 --- a/bj_power_mes/ent/mutation.go +++ b/bj_power_mes/ent/mutation.go @@ -10655,7 +10655,6 @@ type DockMutation struct { dockType *string stationNo *int addstationNo *int - side *string hasPallet *bool palletRef *string status *string @@ -10928,42 +10927,6 @@ func (m *DockMutation) ResetStationNo() { m.addstationNo = nil } -// SetSide sets the "side" field. -func (m *DockMutation) SetSide(s string) { - m.side = &s -} - -// Side returns the value of the "side" field in the mutation. -func (m *DockMutation) Side() (r string, exists bool) { - v := m.side - if v == nil { - return - } - return *v, true -} - -// OldSide returns the old "side" field's value of the Dock entity. -// If the Dock object wasn't provided to the builder, the object is fetched from the database. -// An error is returned if the mutation operation is not UpdateOne, or the database query fails. -func (m *DockMutation) OldSide(ctx context.Context) (v string, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldSide is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldSide requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldSide: %w", err) - } - return oldValue.Side, nil -} - -// ResetSide resets all changes to the "side" field. -func (m *DockMutation) ResetSide() { - m.side = nil -} - // SetHasPallet sets the "hasPallet" field. func (m *DockMutation) SetHasPallet(b bool) { m.hasPallet = &b @@ -11155,7 +11118,7 @@ func (m *DockMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *DockMutation) Fields() []string { - fields := make([]string, 0, 9) + fields := make([]string, 0, 8) if m.dockCode != nil { fields = append(fields, dock.FieldDockCode) } @@ -11168,9 +11131,6 @@ func (m *DockMutation) Fields() []string { if m.stationNo != nil { fields = append(fields, dock.FieldStationNo) } - if m.side != nil { - fields = append(fields, dock.FieldSide) - } if m.hasPallet != nil { fields = append(fields, dock.FieldHasPallet) } @@ -11199,8 +11159,6 @@ func (m *DockMutation) Field(name string) (ent.Value, bool) { return m.DockType() case dock.FieldStationNo: return m.StationNo() - case dock.FieldSide: - return m.Side() case dock.FieldHasPallet: return m.HasPallet() case dock.FieldPalletRef: @@ -11226,8 +11184,6 @@ func (m *DockMutation) OldField(ctx context.Context, name string) (ent.Value, er return m.OldDockType(ctx) case dock.FieldStationNo: return m.OldStationNo(ctx) - case dock.FieldSide: - return m.OldSide(ctx) case dock.FieldHasPallet: return m.OldHasPallet(ctx) case dock.FieldPalletRef: @@ -11273,13 +11229,6 @@ func (m *DockMutation) SetField(name string, value ent.Value) error { } m.SetStationNo(v) return nil - case dock.FieldSide: - v, ok := value.(string) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetSide(v) - return nil case dock.FieldHasPallet: v, ok := value.(bool) if !ok { @@ -11393,9 +11342,6 @@ func (m *DockMutation) ResetField(name string) error { case dock.FieldStationNo: m.ResetStationNo() return nil - case dock.FieldSide: - m.ResetSide() - return nil case dock.FieldHasPallet: m.ResetHasPallet() return nil @@ -23642,10 +23588,7 @@ type ProcessStepMutation struct { name *string collectType *string needCheck *bool - needOperatorSign *bool needInspectorSign *bool - needAudit *bool - auditRole *string attachment *[]map[string]string appendattachment []map[string]string remark *string @@ -23994,42 +23937,6 @@ func (m *ProcessStepMutation) ResetNeedCheck() { m.needCheck = nil } -// SetNeedOperatorSign sets the "needOperatorSign" field. -func (m *ProcessStepMutation) SetNeedOperatorSign(b bool) { - m.needOperatorSign = &b -} - -// NeedOperatorSign returns the value of the "needOperatorSign" field in the mutation. -func (m *ProcessStepMutation) NeedOperatorSign() (r bool, exists bool) { - v := m.needOperatorSign - if v == nil { - return - } - return *v, true -} - -// OldNeedOperatorSign returns the old "needOperatorSign" field's value of the ProcessStep entity. -// If the ProcessStep object wasn't provided to the builder, the object is fetched from the database. -// An error is returned if the mutation operation is not UpdateOne, or the database query fails. -func (m *ProcessStepMutation) OldNeedOperatorSign(ctx context.Context) (v bool, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldNeedOperatorSign is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldNeedOperatorSign requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldNeedOperatorSign: %w", err) - } - return oldValue.NeedOperatorSign, nil -} - -// ResetNeedOperatorSign resets all changes to the "needOperatorSign" field. -func (m *ProcessStepMutation) ResetNeedOperatorSign() { - m.needOperatorSign = nil -} - // SetNeedInspectorSign sets the "needInspectorSign" field. func (m *ProcessStepMutation) SetNeedInspectorSign(b bool) { m.needInspectorSign = &b @@ -24066,91 +23973,6 @@ func (m *ProcessStepMutation) ResetNeedInspectorSign() { m.needInspectorSign = nil } -// SetNeedAudit sets the "needAudit" field. -func (m *ProcessStepMutation) SetNeedAudit(b bool) { - m.needAudit = &b -} - -// NeedAudit returns the value of the "needAudit" field in the mutation. -func (m *ProcessStepMutation) NeedAudit() (r bool, exists bool) { - v := m.needAudit - if v == nil { - return - } - return *v, true -} - -// OldNeedAudit returns the old "needAudit" field's value of the ProcessStep entity. -// If the ProcessStep object wasn't provided to the builder, the object is fetched from the database. -// An error is returned if the mutation operation is not UpdateOne, or the database query fails. -func (m *ProcessStepMutation) OldNeedAudit(ctx context.Context) (v bool, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldNeedAudit is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldNeedAudit requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldNeedAudit: %w", err) - } - return oldValue.NeedAudit, nil -} - -// ResetNeedAudit resets all changes to the "needAudit" field. -func (m *ProcessStepMutation) ResetNeedAudit() { - m.needAudit = nil -} - -// SetAuditRole sets the "auditRole" field. -func (m *ProcessStepMutation) SetAuditRole(s string) { - m.auditRole = &s -} - -// AuditRole returns the value of the "auditRole" field in the mutation. -func (m *ProcessStepMutation) AuditRole() (r string, exists bool) { - v := m.auditRole - if v == nil { - return - } - return *v, true -} - -// OldAuditRole returns the old "auditRole" field's value of the ProcessStep entity. -// If the ProcessStep object wasn't provided to the builder, the object is fetched from the database. -// An error is returned if the mutation operation is not UpdateOne, or the database query fails. -func (m *ProcessStepMutation) OldAuditRole(ctx context.Context) (v string, err error) { - if !m.op.Is(OpUpdateOne) { - return v, errors.New("OldAuditRole is only allowed on UpdateOne operations") - } - if m.id == nil || m.oldValue == nil { - return v, errors.New("OldAuditRole requires an ID field in the mutation") - } - oldValue, err := m.oldValue(ctx) - if err != nil { - return v, fmt.Errorf("querying old value for OldAuditRole: %w", err) - } - return oldValue.AuditRole, nil -} - -// ClearAuditRole clears the value of the "auditRole" field. -func (m *ProcessStepMutation) ClearAuditRole() { - m.auditRole = nil - m.clearedFields[processstep.FieldAuditRole] = struct{}{} -} - -// AuditRoleCleared returns if the "auditRole" field was cleared in this mutation. -func (m *ProcessStepMutation) AuditRoleCleared() bool { - _, ok := m.clearedFields[processstep.FieldAuditRole] - return ok -} - -// ResetAuditRole resets all changes to the "auditRole" field. -func (m *ProcessStepMutation) ResetAuditRole() { - m.auditRole = nil - delete(m.clearedFields, processstep.FieldAuditRole) -} - // SetAttachment sets the "attachment" field. func (m *ProcessStepMutation) SetAttachment(value []map[string]string) { m.attachment = &value @@ -24322,7 +24144,7 @@ func (m *ProcessStepMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *ProcessStepMutation) Fields() []string { - fields := make([]string, 0, 12) + fields := make([]string, 0, 9) if m.flowId != nil { fields = append(fields, processstep.FieldFlowId) } @@ -24338,18 +24160,9 @@ func (m *ProcessStepMutation) Fields() []string { if m.needCheck != nil { fields = append(fields, processstep.FieldNeedCheck) } - if m.needOperatorSign != nil { - fields = append(fields, processstep.FieldNeedOperatorSign) - } if m.needInspectorSign != nil { fields = append(fields, processstep.FieldNeedInspectorSign) } - if m.needAudit != nil { - fields = append(fields, processstep.FieldNeedAudit) - } - if m.auditRole != nil { - fields = append(fields, processstep.FieldAuditRole) - } if m.attachment != nil { fields = append(fields, processstep.FieldAttachment) } @@ -24377,14 +24190,8 @@ func (m *ProcessStepMutation) Field(name string) (ent.Value, bool) { return m.CollectType() case processstep.FieldNeedCheck: return m.NeedCheck() - case processstep.FieldNeedOperatorSign: - return m.NeedOperatorSign() case processstep.FieldNeedInspectorSign: return m.NeedInspectorSign() - case processstep.FieldNeedAudit: - return m.NeedAudit() - case processstep.FieldAuditRole: - return m.AuditRole() case processstep.FieldAttachment: return m.Attachment() case processstep.FieldRemark: @@ -24410,14 +24217,8 @@ func (m *ProcessStepMutation) OldField(ctx context.Context, name string) (ent.Va return m.OldCollectType(ctx) case processstep.FieldNeedCheck: return m.OldNeedCheck(ctx) - case processstep.FieldNeedOperatorSign: - return m.OldNeedOperatorSign(ctx) case processstep.FieldNeedInspectorSign: return m.OldNeedInspectorSign(ctx) - case processstep.FieldNeedAudit: - return m.OldNeedAudit(ctx) - case processstep.FieldAuditRole: - return m.OldAuditRole(ctx) case processstep.FieldAttachment: return m.OldAttachment(ctx) case processstep.FieldRemark: @@ -24468,13 +24269,6 @@ func (m *ProcessStepMutation) SetField(name string, value ent.Value) error { } m.SetNeedCheck(v) return nil - case processstep.FieldNeedOperatorSign: - v, ok := value.(bool) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetNeedOperatorSign(v) - return nil case processstep.FieldNeedInspectorSign: v, ok := value.(bool) if !ok { @@ -24482,20 +24276,6 @@ func (m *ProcessStepMutation) SetField(name string, value ent.Value) error { } m.SetNeedInspectorSign(v) return nil - case processstep.FieldNeedAudit: - v, ok := value.(bool) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetNeedAudit(v) - return nil - case processstep.FieldAuditRole: - v, ok := value.(string) - if !ok { - return fmt.Errorf("unexpected type %T for field %s", value, name) - } - m.SetAuditRole(v) - return nil case processstep.FieldAttachment: v, ok := value.([]map[string]string) if !ok { @@ -24577,9 +24357,6 @@ func (m *ProcessStepMutation) ClearedFields() []string { if m.FieldCleared(processstep.FieldFlowId) { fields = append(fields, processstep.FieldFlowId) } - if m.FieldCleared(processstep.FieldAuditRole) { - fields = append(fields, processstep.FieldAuditRole) - } if m.FieldCleared(processstep.FieldAttachment) { fields = append(fields, processstep.FieldAttachment) } @@ -24600,9 +24377,6 @@ func (m *ProcessStepMutation) ClearField(name string) error { case processstep.FieldFlowId: m.ClearFlowId() return nil - case processstep.FieldAuditRole: - m.ClearAuditRole() - return nil case processstep.FieldAttachment: m.ClearAttachment() return nil @@ -24629,18 +24403,9 @@ func (m *ProcessStepMutation) ResetField(name string) error { case processstep.FieldNeedCheck: m.ResetNeedCheck() return nil - case processstep.FieldNeedOperatorSign: - m.ResetNeedOperatorSign() - return nil case processstep.FieldNeedInspectorSign: m.ResetNeedInspectorSign() return nil - case processstep.FieldNeedAudit: - m.ResetNeedAudit() - return nil - case processstep.FieldAuditRole: - m.ResetAuditRole() - return nil case processstep.FieldAttachment: m.ResetAttachment() return nil @@ -35967,6 +35732,11 @@ type StepSignRecordMutation struct { stepName *string signRole *string result *string + stepValue *string + stepText *string + stepChecked *bool + processId *int64 + addprocessId *int64 signedBy *string signedAt *time.Time round *int @@ -36417,6 +36187,184 @@ func (m *StepSignRecordMutation) ResetResult() { m.result = nil } +// SetStepValue sets the "stepValue" field. +func (m *StepSignRecordMutation) SetStepValue(s string) { + m.stepValue = &s +} + +// StepValue returns the value of the "stepValue" field in the mutation. +func (m *StepSignRecordMutation) StepValue() (r string, exists bool) { + v := m.stepValue + if v == nil { + return + } + return *v, true +} + +// OldStepValue returns the old "stepValue" field's value of the StepSignRecord entity. +// If the StepSignRecord object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *StepSignRecordMutation) OldStepValue(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStepValue is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStepValue requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStepValue: %w", err) + } + return oldValue.StepValue, nil +} + +// ResetStepValue resets all changes to the "stepValue" field. +func (m *StepSignRecordMutation) ResetStepValue() { + m.stepValue = nil +} + +// SetStepText sets the "stepText" field. +func (m *StepSignRecordMutation) SetStepText(s string) { + m.stepText = &s +} + +// StepText returns the value of the "stepText" field in the mutation. +func (m *StepSignRecordMutation) StepText() (r string, exists bool) { + v := m.stepText + if v == nil { + return + } + return *v, true +} + +// OldStepText returns the old "stepText" field's value of the StepSignRecord entity. +// If the StepSignRecord object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *StepSignRecordMutation) OldStepText(ctx context.Context) (v string, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStepText is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStepText requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStepText: %w", err) + } + return oldValue.StepText, nil +} + +// ResetStepText resets all changes to the "stepText" field. +func (m *StepSignRecordMutation) ResetStepText() { + m.stepText = nil +} + +// SetStepChecked sets the "stepChecked" field. +func (m *StepSignRecordMutation) SetStepChecked(b bool) { + m.stepChecked = &b +} + +// StepChecked returns the value of the "stepChecked" field in the mutation. +func (m *StepSignRecordMutation) StepChecked() (r bool, exists bool) { + v := m.stepChecked + if v == nil { + return + } + return *v, true +} + +// OldStepChecked returns the old "stepChecked" field's value of the StepSignRecord entity. +// If the StepSignRecord object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *StepSignRecordMutation) OldStepChecked(ctx context.Context) (v bool, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldStepChecked is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldStepChecked requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldStepChecked: %w", err) + } + return oldValue.StepChecked, nil +} + +// ResetStepChecked resets all changes to the "stepChecked" field. +func (m *StepSignRecordMutation) ResetStepChecked() { + m.stepChecked = nil +} + +// SetProcessId sets the "processId" field. +func (m *StepSignRecordMutation) SetProcessId(i int64) { + m.processId = &i + m.addprocessId = nil +} + +// ProcessId returns the value of the "processId" field in the mutation. +func (m *StepSignRecordMutation) ProcessId() (r int64, exists bool) { + v := m.processId + if v == nil { + return + } + return *v, true +} + +// OldProcessId returns the old "processId" field's value of the StepSignRecord entity. +// If the StepSignRecord object wasn't provided to the builder, the object is fetched from the database. +// An error is returned if the mutation operation is not UpdateOne, or the database query fails. +func (m *StepSignRecordMutation) OldProcessId(ctx context.Context) (v int64, err error) { + if !m.op.Is(OpUpdateOne) { + return v, errors.New("OldProcessId is only allowed on UpdateOne operations") + } + if m.id == nil || m.oldValue == nil { + return v, errors.New("OldProcessId requires an ID field in the mutation") + } + oldValue, err := m.oldValue(ctx) + if err != nil { + return v, fmt.Errorf("querying old value for OldProcessId: %w", err) + } + return oldValue.ProcessId, nil +} + +// AddProcessId adds i to the "processId" field. +func (m *StepSignRecordMutation) AddProcessId(i int64) { + if m.addprocessId != nil { + *m.addprocessId += i + } else { + m.addprocessId = &i + } +} + +// AddedProcessId returns the value that was added to the "processId" field in this mutation. +func (m *StepSignRecordMutation) AddedProcessId() (r int64, exists bool) { + v := m.addprocessId + if v == nil { + return + } + return *v, true +} + +// ClearProcessId clears the value of the "processId" field. +func (m *StepSignRecordMutation) ClearProcessId() { + m.processId = nil + m.addprocessId = nil + m.clearedFields[stepsignrecord.FieldProcessId] = struct{}{} +} + +// ProcessIdCleared returns if the "processId" field was cleared in this mutation. +func (m *StepSignRecordMutation) ProcessIdCleared() bool { + _, ok := m.clearedFields[stepsignrecord.FieldProcessId] + return ok +} + +// ResetProcessId resets all changes to the "processId" field. +func (m *StepSignRecordMutation) ResetProcessId() { + m.processId = nil + m.addprocessId = nil + delete(m.clearedFields, stepsignrecord.FieldProcessId) +} + // SetSignedBy sets the "signedBy" field. func (m *StepSignRecordMutation) SetSignedBy(s string) { m.signedBy = &s @@ -36880,7 +36828,7 @@ func (m *StepSignRecordMutation) Type() string { // order to get all numeric fields that were incremented/decremented, call // AddedFields(). func (m *StepSignRecordMutation) Fields() []string { - fields := make([]string, 0, 19) + fields := make([]string, 0, 23) if m.sn != nil { fields = append(fields, stepsignrecord.FieldSn) } @@ -36905,6 +36853,18 @@ func (m *StepSignRecordMutation) Fields() []string { if m.result != nil { fields = append(fields, stepsignrecord.FieldResult) } + if m.stepValue != nil { + fields = append(fields, stepsignrecord.FieldStepValue) + } + if m.stepText != nil { + fields = append(fields, stepsignrecord.FieldStepText) + } + if m.stepChecked != nil { + fields = append(fields, stepsignrecord.FieldStepChecked) + } + if m.processId != nil { + fields = append(fields, stepsignrecord.FieldProcessId) + } if m.signedBy != nil { fields = append(fields, stepsignrecord.FieldSignedBy) } @@ -36962,6 +36922,14 @@ func (m *StepSignRecordMutation) Field(name string) (ent.Value, bool) { return m.SignRole() case stepsignrecord.FieldResult: return m.Result() + case stepsignrecord.FieldStepValue: + return m.StepValue() + case stepsignrecord.FieldStepText: + return m.StepText() + case stepsignrecord.FieldStepChecked: + return m.StepChecked() + case stepsignrecord.FieldProcessId: + return m.ProcessId() case stepsignrecord.FieldSignedBy: return m.SignedBy() case stepsignrecord.FieldSignedAt: @@ -37009,6 +36977,14 @@ func (m *StepSignRecordMutation) OldField(ctx context.Context, name string) (ent return m.OldSignRole(ctx) case stepsignrecord.FieldResult: return m.OldResult(ctx) + case stepsignrecord.FieldStepValue: + return m.OldStepValue(ctx) + case stepsignrecord.FieldStepText: + return m.OldStepText(ctx) + case stepsignrecord.FieldStepChecked: + return m.OldStepChecked(ctx) + case stepsignrecord.FieldProcessId: + return m.OldProcessId(ctx) case stepsignrecord.FieldSignedBy: return m.OldSignedBy(ctx) case stepsignrecord.FieldSignedAt: @@ -37096,6 +37072,34 @@ func (m *StepSignRecordMutation) SetField(name string, value ent.Value) error { } m.SetResult(v) return nil + case stepsignrecord.FieldStepValue: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStepValue(v) + return nil + case stepsignrecord.FieldStepText: + v, ok := value.(string) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStepText(v) + return nil + case stepsignrecord.FieldStepChecked: + v, ok := value.(bool) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetStepChecked(v) + return nil + case stepsignrecord.FieldProcessId: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.SetProcessId(v) + return nil case stepsignrecord.FieldSignedBy: v, ok := value.(string) if !ok { @@ -37187,6 +37191,9 @@ func (m *StepSignRecordMutation) AddedFields() []string { if m.addstepId != nil { fields = append(fields, stepsignrecord.FieldStepId) } + if m.addprocessId != nil { + fields = append(fields, stepsignrecord.FieldProcessId) + } if m.addround != nil { fields = append(fields, stepsignrecord.FieldRound) } @@ -37202,6 +37209,8 @@ func (m *StepSignRecordMutation) AddedField(name string) (ent.Value, bool) { return m.AddedFlowId() case stepsignrecord.FieldStepId: return m.AddedStepId() + case stepsignrecord.FieldProcessId: + return m.AddedProcessId() case stepsignrecord.FieldRound: return m.AddedRound() } @@ -37227,6 +37236,13 @@ func (m *StepSignRecordMutation) AddField(name string, value ent.Value) error { } m.AddStepId(v) return nil + case stepsignrecord.FieldProcessId: + v, ok := value.(int64) + if !ok { + return fmt.Errorf("unexpected type %T for field %s", value, name) + } + m.AddProcessId(v) + return nil case stepsignrecord.FieldRound: v, ok := value.(int) if !ok { @@ -37242,6 +37258,9 @@ func (m *StepSignRecordMutation) AddField(name string, value ent.Value) error { // mutation. func (m *StepSignRecordMutation) ClearedFields() []string { var fields []string + if m.FieldCleared(stepsignrecord.FieldProcessId) { + fields = append(fields, stepsignrecord.FieldProcessId) + } if m.FieldCleared(stepsignrecord.FieldRevokedAt) { fields = append(fields, stepsignrecord.FieldRevokedAt) } @@ -37259,6 +37278,9 @@ func (m *StepSignRecordMutation) FieldCleared(name string) bool { // error if the field is not defined in the schema. func (m *StepSignRecordMutation) ClearField(name string) error { switch name { + case stepsignrecord.FieldProcessId: + m.ClearProcessId() + return nil case stepsignrecord.FieldRevokedAt: m.ClearRevokedAt() return nil @@ -37294,6 +37316,18 @@ func (m *StepSignRecordMutation) ResetField(name string) error { case stepsignrecord.FieldResult: m.ResetResult() return nil + case stepsignrecord.FieldStepValue: + m.ResetStepValue() + return nil + case stepsignrecord.FieldStepText: + m.ResetStepText() + return nil + case stepsignrecord.FieldStepChecked: + m.ResetStepChecked() + return nil + case stepsignrecord.FieldProcessId: + m.ResetProcessId() + return nil case stepsignrecord.FieldSignedBy: m.ResetSignedBy() return nil diff --git a/bj_power_mes/ent/processstep.go b/bj_power_mes/ent/processstep.go index 4d51114..f758d7b 100644 --- a/bj_power_mes/ent/processstep.go +++ b/bj_power_mes/ent/processstep.go @@ -26,16 +26,10 @@ type ProcessStep struct { Name string `json:"name,omitempty"` // 采集方式 AUTO(拧紧枪自动)/MANUAL(手填)/SCAN(扫码,与手填等价采一串字符串)/NONE(仅记录) CollectType string `json:"collectType,omitempty"` - // 是否需要检测确认(报工前须检验通过) + // 是否需要工人自检(报工前须勾选确认) NeedCheck bool `json:"needCheck,omitempty"` - // 是否需要操作工签字(报工前须签字确认) - NeedOperatorSign bool `json:"needOperatorSign,omitempty"` - // 是否需要检验员签字(审核通过并签字后放行) + // 是否需要检验员签字(检验员签OK后放行) NeedInspectorSign bool `json:"needInspectorSign,omitempty"` - // 是否需要审核人复核签字(审核通过后放行) - NeedAudit bool `json:"needAudit,omitempty"` - // 审核角色(如班组长/工艺员),具该角色的人员可签 - AuditRole string `json:"auditRole,omitempty"` // 本步骤图纸/附件列表 [{name,url}] Attachment []map[string]string `json:"attachment,omitempty"` // Remark holds the value of the "remark" field. @@ -52,11 +46,11 @@ func (*ProcessStep) scanValues(columns []string) ([]any, error) { switch columns[i] { case processstep.FieldAttachment: values[i] = new([]byte) - case processstep.FieldNeedCheck, processstep.FieldNeedOperatorSign, processstep.FieldNeedInspectorSign, processstep.FieldNeedAudit: + case processstep.FieldNeedCheck, processstep.FieldNeedInspectorSign: values[i] = new(sql.NullBool) case processstep.FieldID, processstep.FieldFlowId, processstep.FieldSeq: values[i] = new(sql.NullInt64) - case processstep.FieldName, processstep.FieldCollectType, processstep.FieldAuditRole, processstep.FieldRemark: + case processstep.FieldName, processstep.FieldCollectType, processstep.FieldRemark: values[i] = new(sql.NullString) case processstep.FieldCreatedAt: values[i] = new(sql.NullTime) @@ -111,30 +105,12 @@ func (_m *ProcessStep) assignValues(columns []string, values []any) error { } else if value.Valid { _m.NeedCheck = value.Bool } - case processstep.FieldNeedOperatorSign: - if value, ok := values[i].(*sql.NullBool); !ok { - return fmt.Errorf("unexpected type %T for field needOperatorSign", values[i]) - } else if value.Valid { - _m.NeedOperatorSign = value.Bool - } case processstep.FieldNeedInspectorSign: if value, ok := values[i].(*sql.NullBool); !ok { return fmt.Errorf("unexpected type %T for field needInspectorSign", values[i]) } else if value.Valid { _m.NeedInspectorSign = value.Bool } - case processstep.FieldNeedAudit: - if value, ok := values[i].(*sql.NullBool); !ok { - return fmt.Errorf("unexpected type %T for field needAudit", values[i]) - } else if value.Valid { - _m.NeedAudit = value.Bool - } - case processstep.FieldAuditRole: - if value, ok := values[i].(*sql.NullString); !ok { - return fmt.Errorf("unexpected type %T for field auditRole", values[i]) - } else if value.Valid { - _m.AuditRole = value.String - } case processstep.FieldAttachment: if value, ok := values[i].(*[]byte); !ok { return fmt.Errorf("unexpected type %T for field attachment", values[i]) @@ -206,18 +182,9 @@ func (_m *ProcessStep) String() string { builder.WriteString("needCheck=") builder.WriteString(fmt.Sprintf("%v", _m.NeedCheck)) builder.WriteString(", ") - builder.WriteString("needOperatorSign=") - builder.WriteString(fmt.Sprintf("%v", _m.NeedOperatorSign)) - builder.WriteString(", ") builder.WriteString("needInspectorSign=") builder.WriteString(fmt.Sprintf("%v", _m.NeedInspectorSign)) builder.WriteString(", ") - builder.WriteString("needAudit=") - builder.WriteString(fmt.Sprintf("%v", _m.NeedAudit)) - builder.WriteString(", ") - builder.WriteString("auditRole=") - builder.WriteString(_m.AuditRole) - builder.WriteString(", ") builder.WriteString("attachment=") builder.WriteString(fmt.Sprintf("%v", _m.Attachment)) builder.WriteString(", ") diff --git a/bj_power_mes/ent/processstep/processstep.go b/bj_power_mes/ent/processstep/processstep.go index ca4c0bd..5767077 100644 --- a/bj_power_mes/ent/processstep/processstep.go +++ b/bj_power_mes/ent/processstep/processstep.go @@ -23,14 +23,8 @@ const ( FieldCollectType = "collect_type" // FieldNeedCheck holds the string denoting the needcheck field in the database. FieldNeedCheck = "need_check" - // FieldNeedOperatorSign holds the string denoting the needoperatorsign field in the database. - FieldNeedOperatorSign = "need_operator_sign" // FieldNeedInspectorSign holds the string denoting the needinspectorsign field in the database. FieldNeedInspectorSign = "need_inspector_sign" - // FieldNeedAudit holds the string denoting the needaudit field in the database. - FieldNeedAudit = "need_audit" - // FieldAuditRole holds the string denoting the auditrole field in the database. - FieldAuditRole = "audit_role" // FieldAttachment holds the string denoting the attachment field in the database. FieldAttachment = "attachment" // FieldRemark holds the string denoting the remark field in the database. @@ -49,10 +43,7 @@ var Columns = []string{ FieldName, FieldCollectType, FieldNeedCheck, - FieldNeedOperatorSign, FieldNeedInspectorSign, - FieldNeedAudit, - FieldAuditRole, FieldAttachment, FieldRemark, FieldCreatedAt, @@ -79,16 +70,8 @@ var ( CollectTypeValidator func(string) error // DefaultNeedCheck holds the default value on creation for the "needCheck" field. DefaultNeedCheck bool - // DefaultNeedOperatorSign holds the default value on creation for the "needOperatorSign" field. - DefaultNeedOperatorSign bool // DefaultNeedInspectorSign holds the default value on creation for the "needInspectorSign" field. DefaultNeedInspectorSign bool - // DefaultNeedAudit holds the default value on creation for the "needAudit" field. - DefaultNeedAudit bool - // DefaultAuditRole holds the default value on creation for the "auditRole" field. - DefaultAuditRole string - // AuditRoleValidator is a validator for the "auditRole" field. It is called by the builders before save. - AuditRoleValidator func(string) error // DefaultRemark holds the default value on creation for the "remark" field. DefaultRemark string // RemarkValidator is a validator for the "remark" field. It is called by the builders before save. @@ -132,26 +115,11 @@ func ByNeedCheck(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldNeedCheck, opts...).ToFunc() } -// ByNeedOperatorSign orders the results by the needOperatorSign field. -func ByNeedOperatorSign(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldNeedOperatorSign, opts...).ToFunc() -} - // ByNeedInspectorSign orders the results by the needInspectorSign field. func ByNeedInspectorSign(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldNeedInspectorSign, opts...).ToFunc() } -// ByNeedAudit orders the results by the needAudit field. -func ByNeedAudit(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldNeedAudit, opts...).ToFunc() -} - -// ByAuditRole orders the results by the auditRole field. -func ByAuditRole(opts ...sql.OrderTermOption) OrderOption { - return sql.OrderByField(FieldAuditRole, opts...).ToFunc() -} - // ByRemark orders the results by the remark field. func ByRemark(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldRemark, opts...).ToFunc() diff --git a/bj_power_mes/ent/processstep/where.go b/bj_power_mes/ent/processstep/where.go index 92ef7da..8dc37f6 100644 --- a/bj_power_mes/ent/processstep/where.go +++ b/bj_power_mes/ent/processstep/where.go @@ -79,26 +79,11 @@ func NeedCheck(v bool) predicate.ProcessStep { return predicate.ProcessStep(sql.FieldEQ(FieldNeedCheck, v)) } -// NeedOperatorSign applies equality check predicate on the "needOperatorSign" field. It's identical to NeedOperatorSignEQ. -func NeedOperatorSign(v bool) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldEQ(FieldNeedOperatorSign, v)) -} - // NeedInspectorSign applies equality check predicate on the "needInspectorSign" field. It's identical to NeedInspectorSignEQ. func NeedInspectorSign(v bool) predicate.ProcessStep { return predicate.ProcessStep(sql.FieldEQ(FieldNeedInspectorSign, v)) } -// NeedAudit applies equality check predicate on the "needAudit" field. It's identical to NeedAuditEQ. -func NeedAudit(v bool) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldEQ(FieldNeedAudit, v)) -} - -// AuditRole applies equality check predicate on the "auditRole" field. It's identical to AuditRoleEQ. -func AuditRole(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldEQ(FieldAuditRole, v)) -} - // Remark applies equality check predicate on the "remark" field. It's identical to RemarkEQ. func Remark(v string) predicate.ProcessStep { return predicate.ProcessStep(sql.FieldEQ(FieldRemark, v)) @@ -339,16 +324,6 @@ func NeedCheckNEQ(v bool) predicate.ProcessStep { return predicate.ProcessStep(sql.FieldNEQ(FieldNeedCheck, v)) } -// NeedOperatorSignEQ applies the EQ predicate on the "needOperatorSign" field. -func NeedOperatorSignEQ(v bool) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldEQ(FieldNeedOperatorSign, v)) -} - -// NeedOperatorSignNEQ applies the NEQ predicate on the "needOperatorSign" field. -func NeedOperatorSignNEQ(v bool) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldNEQ(FieldNeedOperatorSign, v)) -} - // NeedInspectorSignEQ applies the EQ predicate on the "needInspectorSign" field. func NeedInspectorSignEQ(v bool) predicate.ProcessStep { return predicate.ProcessStep(sql.FieldEQ(FieldNeedInspectorSign, v)) @@ -359,91 +334,6 @@ func NeedInspectorSignNEQ(v bool) predicate.ProcessStep { return predicate.ProcessStep(sql.FieldNEQ(FieldNeedInspectorSign, v)) } -// NeedAuditEQ applies the EQ predicate on the "needAudit" field. -func NeedAuditEQ(v bool) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldEQ(FieldNeedAudit, v)) -} - -// NeedAuditNEQ applies the NEQ predicate on the "needAudit" field. -func NeedAuditNEQ(v bool) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldNEQ(FieldNeedAudit, v)) -} - -// AuditRoleEQ applies the EQ predicate on the "auditRole" field. -func AuditRoleEQ(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldEQ(FieldAuditRole, v)) -} - -// AuditRoleNEQ applies the NEQ predicate on the "auditRole" field. -func AuditRoleNEQ(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldNEQ(FieldAuditRole, v)) -} - -// AuditRoleIn applies the In predicate on the "auditRole" field. -func AuditRoleIn(vs ...string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldIn(FieldAuditRole, vs...)) -} - -// AuditRoleNotIn applies the NotIn predicate on the "auditRole" field. -func AuditRoleNotIn(vs ...string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldNotIn(FieldAuditRole, vs...)) -} - -// AuditRoleGT applies the GT predicate on the "auditRole" field. -func AuditRoleGT(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldGT(FieldAuditRole, v)) -} - -// AuditRoleGTE applies the GTE predicate on the "auditRole" field. -func AuditRoleGTE(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldGTE(FieldAuditRole, v)) -} - -// AuditRoleLT applies the LT predicate on the "auditRole" field. -func AuditRoleLT(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldLT(FieldAuditRole, v)) -} - -// AuditRoleLTE applies the LTE predicate on the "auditRole" field. -func AuditRoleLTE(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldLTE(FieldAuditRole, v)) -} - -// AuditRoleContains applies the Contains predicate on the "auditRole" field. -func AuditRoleContains(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldContains(FieldAuditRole, v)) -} - -// AuditRoleHasPrefix applies the HasPrefix predicate on the "auditRole" field. -func AuditRoleHasPrefix(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldHasPrefix(FieldAuditRole, v)) -} - -// AuditRoleHasSuffix applies the HasSuffix predicate on the "auditRole" field. -func AuditRoleHasSuffix(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldHasSuffix(FieldAuditRole, v)) -} - -// AuditRoleIsNil applies the IsNil predicate on the "auditRole" field. -func AuditRoleIsNil() predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldIsNull(FieldAuditRole)) -} - -// AuditRoleNotNil applies the NotNil predicate on the "auditRole" field. -func AuditRoleNotNil() predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldNotNull(FieldAuditRole)) -} - -// AuditRoleEqualFold applies the EqualFold predicate on the "auditRole" field. -func AuditRoleEqualFold(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldEqualFold(FieldAuditRole, v)) -} - -// AuditRoleContainsFold applies the ContainsFold predicate on the "auditRole" field. -func AuditRoleContainsFold(v string) predicate.ProcessStep { - return predicate.ProcessStep(sql.FieldContainsFold(FieldAuditRole, v)) -} - // AttachmentIsNil applies the IsNil predicate on the "attachment" field. func AttachmentIsNil() predicate.ProcessStep { return predicate.ProcessStep(sql.FieldIsNull(FieldAttachment)) diff --git a/bj_power_mes/ent/processstep_create.go b/bj_power_mes/ent/processstep_create.go index 08b96b1..32a5fc7 100644 --- a/bj_power_mes/ent/processstep_create.go +++ b/bj_power_mes/ent/processstep_create.go @@ -82,20 +82,6 @@ func (_c *ProcessStepCreate) SetNillableNeedCheck(v *bool) *ProcessStepCreate { return _c } -// SetNeedOperatorSign sets the "needOperatorSign" field. -func (_c *ProcessStepCreate) SetNeedOperatorSign(v bool) *ProcessStepCreate { - _c.mutation.SetNeedOperatorSign(v) - return _c -} - -// SetNillableNeedOperatorSign sets the "needOperatorSign" field if the given value is not nil. -func (_c *ProcessStepCreate) SetNillableNeedOperatorSign(v *bool) *ProcessStepCreate { - if v != nil { - _c.SetNeedOperatorSign(*v) - } - return _c -} - // SetNeedInspectorSign sets the "needInspectorSign" field. func (_c *ProcessStepCreate) SetNeedInspectorSign(v bool) *ProcessStepCreate { _c.mutation.SetNeedInspectorSign(v) @@ -110,34 +96,6 @@ func (_c *ProcessStepCreate) SetNillableNeedInspectorSign(v *bool) *ProcessStepC return _c } -// SetNeedAudit sets the "needAudit" field. -func (_c *ProcessStepCreate) SetNeedAudit(v bool) *ProcessStepCreate { - _c.mutation.SetNeedAudit(v) - return _c -} - -// SetNillableNeedAudit sets the "needAudit" field if the given value is not nil. -func (_c *ProcessStepCreate) SetNillableNeedAudit(v *bool) *ProcessStepCreate { - if v != nil { - _c.SetNeedAudit(*v) - } - return _c -} - -// SetAuditRole sets the "auditRole" field. -func (_c *ProcessStepCreate) SetAuditRole(v string) *ProcessStepCreate { - _c.mutation.SetAuditRole(v) - return _c -} - -// SetNillableAuditRole sets the "auditRole" field if the given value is not nil. -func (_c *ProcessStepCreate) SetNillableAuditRole(v *string) *ProcessStepCreate { - if v != nil { - _c.SetAuditRole(*v) - } - return _c -} - // SetAttachment sets the "attachment" field. func (_c *ProcessStepCreate) SetAttachment(v []map[string]string) *ProcessStepCreate { _c.mutation.SetAttachment(v) @@ -225,22 +183,10 @@ func (_c *ProcessStepCreate) defaults() { v := processstep.DefaultNeedCheck _c.mutation.SetNeedCheck(v) } - if _, ok := _c.mutation.NeedOperatorSign(); !ok { - v := processstep.DefaultNeedOperatorSign - _c.mutation.SetNeedOperatorSign(v) - } if _, ok := _c.mutation.NeedInspectorSign(); !ok { v := processstep.DefaultNeedInspectorSign _c.mutation.SetNeedInspectorSign(v) } - if _, ok := _c.mutation.NeedAudit(); !ok { - v := processstep.DefaultNeedAudit - _c.mutation.SetNeedAudit(v) - } - if _, ok := _c.mutation.AuditRole(); !ok { - v := processstep.DefaultAuditRole - _c.mutation.SetAuditRole(v) - } if _, ok := _c.mutation.Remark(); !ok { v := processstep.DefaultRemark _c.mutation.SetRemark(v) @@ -275,20 +221,9 @@ func (_c *ProcessStepCreate) check() error { if _, ok := _c.mutation.NeedCheck(); !ok { return &ValidationError{Name: "needCheck", err: errors.New(`ent: missing required field "ProcessStep.needCheck"`)} } - if _, ok := _c.mutation.NeedOperatorSign(); !ok { - return &ValidationError{Name: "needOperatorSign", err: errors.New(`ent: missing required field "ProcessStep.needOperatorSign"`)} - } if _, ok := _c.mutation.NeedInspectorSign(); !ok { return &ValidationError{Name: "needInspectorSign", err: errors.New(`ent: missing required field "ProcessStep.needInspectorSign"`)} } - if _, ok := _c.mutation.NeedAudit(); !ok { - return &ValidationError{Name: "needAudit", err: errors.New(`ent: missing required field "ProcessStep.needAudit"`)} - } - if v, ok := _c.mutation.AuditRole(); ok { - if err := processstep.AuditRoleValidator(v); err != nil { - return &ValidationError{Name: "auditRole", err: fmt.Errorf(`ent: validator failed for field "ProcessStep.auditRole": %w`, err)} - } - } if _, ok := _c.mutation.Remark(); !ok { return &ValidationError{Name: "remark", err: errors.New(`ent: missing required field "ProcessStep.remark"`)} } @@ -357,22 +292,10 @@ func (_c *ProcessStepCreate) createSpec() (*ProcessStep, *sqlgraph.CreateSpec) { _spec.SetField(processstep.FieldNeedCheck, field.TypeBool, value) _node.NeedCheck = value } - if value, ok := _c.mutation.NeedOperatorSign(); ok { - _spec.SetField(processstep.FieldNeedOperatorSign, field.TypeBool, value) - _node.NeedOperatorSign = value - } if value, ok := _c.mutation.NeedInspectorSign(); ok { _spec.SetField(processstep.FieldNeedInspectorSign, field.TypeBool, value) _node.NeedInspectorSign = value } - if value, ok := _c.mutation.NeedAudit(); ok { - _spec.SetField(processstep.FieldNeedAudit, field.TypeBool, value) - _node.NeedAudit = value - } - if value, ok := _c.mutation.AuditRole(); ok { - _spec.SetField(processstep.FieldAuditRole, field.TypeString, value) - _node.AuditRole = value - } if value, ok := _c.mutation.Attachment(); ok { _spec.SetField(processstep.FieldAttachment, field.TypeJSON, value) _node.Attachment = value diff --git a/bj_power_mes/ent/processstep_update.go b/bj_power_mes/ent/processstep_update.go index b560e73..89a9cdc 100644 --- a/bj_power_mes/ent/processstep_update.go +++ b/bj_power_mes/ent/processstep_update.go @@ -119,20 +119,6 @@ func (_u *ProcessStepUpdate) SetNillableNeedCheck(v *bool) *ProcessStepUpdate { return _u } -// SetNeedOperatorSign sets the "needOperatorSign" field. -func (_u *ProcessStepUpdate) SetNeedOperatorSign(v bool) *ProcessStepUpdate { - _u.mutation.SetNeedOperatorSign(v) - return _u -} - -// SetNillableNeedOperatorSign sets the "needOperatorSign" field if the given value is not nil. -func (_u *ProcessStepUpdate) SetNillableNeedOperatorSign(v *bool) *ProcessStepUpdate { - if v != nil { - _u.SetNeedOperatorSign(*v) - } - return _u -} - // SetNeedInspectorSign sets the "needInspectorSign" field. func (_u *ProcessStepUpdate) SetNeedInspectorSign(v bool) *ProcessStepUpdate { _u.mutation.SetNeedInspectorSign(v) @@ -147,40 +133,6 @@ func (_u *ProcessStepUpdate) SetNillableNeedInspectorSign(v *bool) *ProcessStepU return _u } -// SetNeedAudit sets the "needAudit" field. -func (_u *ProcessStepUpdate) SetNeedAudit(v bool) *ProcessStepUpdate { - _u.mutation.SetNeedAudit(v) - return _u -} - -// SetNillableNeedAudit sets the "needAudit" field if the given value is not nil. -func (_u *ProcessStepUpdate) SetNillableNeedAudit(v *bool) *ProcessStepUpdate { - if v != nil { - _u.SetNeedAudit(*v) - } - return _u -} - -// SetAuditRole sets the "auditRole" field. -func (_u *ProcessStepUpdate) SetAuditRole(v string) *ProcessStepUpdate { - _u.mutation.SetAuditRole(v) - return _u -} - -// SetNillableAuditRole sets the "auditRole" field if the given value is not nil. -func (_u *ProcessStepUpdate) SetNillableAuditRole(v *string) *ProcessStepUpdate { - if v != nil { - _u.SetAuditRole(*v) - } - return _u -} - -// ClearAuditRole clears the value of the "auditRole" field. -func (_u *ProcessStepUpdate) ClearAuditRole() *ProcessStepUpdate { - _u.mutation.ClearAuditRole() - return _u -} - // SetAttachment sets the "attachment" field. func (_u *ProcessStepUpdate) SetAttachment(v []map[string]string) *ProcessStepUpdate { _u.mutation.SetAttachment(v) @@ -257,11 +209,6 @@ func (_u *ProcessStepUpdate) check() error { return &ValidationError{Name: "collectType", err: fmt.Errorf(`ent: validator failed for field "ProcessStep.collectType": %w`, err)} } } - if v, ok := _u.mutation.AuditRole(); ok { - if err := processstep.AuditRoleValidator(v); err != nil { - return &ValidationError{Name: "auditRole", err: fmt.Errorf(`ent: validator failed for field "ProcessStep.auditRole": %w`, err)} - } - } if v, ok := _u.mutation.Remark(); ok { if err := processstep.RemarkValidator(v); err != nil { return &ValidationError{Name: "remark", err: fmt.Errorf(`ent: validator failed for field "ProcessStep.remark": %w`, err)} @@ -312,21 +259,9 @@ func (_u *ProcessStepUpdate) sqlSave(ctx context.Context) (_node int, err error) if value, ok := _u.mutation.NeedCheck(); ok { _spec.SetField(processstep.FieldNeedCheck, field.TypeBool, value) } - if value, ok := _u.mutation.NeedOperatorSign(); ok { - _spec.SetField(processstep.FieldNeedOperatorSign, field.TypeBool, value) - } if value, ok := _u.mutation.NeedInspectorSign(); ok { _spec.SetField(processstep.FieldNeedInspectorSign, field.TypeBool, value) } - if value, ok := _u.mutation.NeedAudit(); ok { - _spec.SetField(processstep.FieldNeedAudit, field.TypeBool, value) - } - if value, ok := _u.mutation.AuditRole(); ok { - _spec.SetField(processstep.FieldAuditRole, field.TypeString, value) - } - if _u.mutation.AuditRoleCleared() { - _spec.ClearField(processstep.FieldAuditRole, field.TypeString) - } if value, ok := _u.mutation.Attachment(); ok { _spec.SetField(processstep.FieldAttachment, field.TypeJSON, value) } @@ -453,20 +388,6 @@ func (_u *ProcessStepUpdateOne) SetNillableNeedCheck(v *bool) *ProcessStepUpdate return _u } -// SetNeedOperatorSign sets the "needOperatorSign" field. -func (_u *ProcessStepUpdateOne) SetNeedOperatorSign(v bool) *ProcessStepUpdateOne { - _u.mutation.SetNeedOperatorSign(v) - return _u -} - -// SetNillableNeedOperatorSign sets the "needOperatorSign" field if the given value is not nil. -func (_u *ProcessStepUpdateOne) SetNillableNeedOperatorSign(v *bool) *ProcessStepUpdateOne { - if v != nil { - _u.SetNeedOperatorSign(*v) - } - return _u -} - // SetNeedInspectorSign sets the "needInspectorSign" field. func (_u *ProcessStepUpdateOne) SetNeedInspectorSign(v bool) *ProcessStepUpdateOne { _u.mutation.SetNeedInspectorSign(v) @@ -481,40 +402,6 @@ func (_u *ProcessStepUpdateOne) SetNillableNeedInspectorSign(v *bool) *ProcessSt return _u } -// SetNeedAudit sets the "needAudit" field. -func (_u *ProcessStepUpdateOne) SetNeedAudit(v bool) *ProcessStepUpdateOne { - _u.mutation.SetNeedAudit(v) - return _u -} - -// SetNillableNeedAudit sets the "needAudit" field if the given value is not nil. -func (_u *ProcessStepUpdateOne) SetNillableNeedAudit(v *bool) *ProcessStepUpdateOne { - if v != nil { - _u.SetNeedAudit(*v) - } - return _u -} - -// SetAuditRole sets the "auditRole" field. -func (_u *ProcessStepUpdateOne) SetAuditRole(v string) *ProcessStepUpdateOne { - _u.mutation.SetAuditRole(v) - return _u -} - -// SetNillableAuditRole sets the "auditRole" field if the given value is not nil. -func (_u *ProcessStepUpdateOne) SetNillableAuditRole(v *string) *ProcessStepUpdateOne { - if v != nil { - _u.SetAuditRole(*v) - } - return _u -} - -// ClearAuditRole clears the value of the "auditRole" field. -func (_u *ProcessStepUpdateOne) ClearAuditRole() *ProcessStepUpdateOne { - _u.mutation.ClearAuditRole() - return _u -} - // SetAttachment sets the "attachment" field. func (_u *ProcessStepUpdateOne) SetAttachment(v []map[string]string) *ProcessStepUpdateOne { _u.mutation.SetAttachment(v) @@ -604,11 +491,6 @@ func (_u *ProcessStepUpdateOne) check() error { return &ValidationError{Name: "collectType", err: fmt.Errorf(`ent: validator failed for field "ProcessStep.collectType": %w`, err)} } } - if v, ok := _u.mutation.AuditRole(); ok { - if err := processstep.AuditRoleValidator(v); err != nil { - return &ValidationError{Name: "auditRole", err: fmt.Errorf(`ent: validator failed for field "ProcessStep.auditRole": %w`, err)} - } - } if v, ok := _u.mutation.Remark(); ok { if err := processstep.RemarkValidator(v); err != nil { return &ValidationError{Name: "remark", err: fmt.Errorf(`ent: validator failed for field "ProcessStep.remark": %w`, err)} @@ -676,21 +558,9 @@ func (_u *ProcessStepUpdateOne) sqlSave(ctx context.Context) (_node *ProcessStep if value, ok := _u.mutation.NeedCheck(); ok { _spec.SetField(processstep.FieldNeedCheck, field.TypeBool, value) } - if value, ok := _u.mutation.NeedOperatorSign(); ok { - _spec.SetField(processstep.FieldNeedOperatorSign, field.TypeBool, value) - } if value, ok := _u.mutation.NeedInspectorSign(); ok { _spec.SetField(processstep.FieldNeedInspectorSign, field.TypeBool, value) } - if value, ok := _u.mutation.NeedAudit(); ok { - _spec.SetField(processstep.FieldNeedAudit, field.TypeBool, value) - } - if value, ok := _u.mutation.AuditRole(); ok { - _spec.SetField(processstep.FieldAuditRole, field.TypeString, value) - } - if _u.mutation.AuditRoleCleared() { - _spec.ClearField(processstep.FieldAuditRole, field.TypeString) - } if value, ok := _u.mutation.Attachment(); ok { _spec.SetField(processstep.FieldAttachment, field.TypeJSON, value) } diff --git a/bj_power_mes/ent/runtime.go b/bj_power_mes/ent/runtime.go index b56ced2..d75ed89 100644 --- a/bj_power_mes/ent/runtime.go +++ b/bj_power_mes/ent/runtime.go @@ -689,30 +689,24 @@ func init() { dockDescStationNo := dockFields[3].Descriptor() // dock.DefaultStationNo holds the default value on creation for the stationNo field. dock.DefaultStationNo = dockDescStationNo.Default.(int) - // dockDescSide is the schema descriptor for side field. - dockDescSide := dockFields[4].Descriptor() - // dock.DefaultSide holds the default value on creation for the side field. - dock.DefaultSide = dockDescSide.Default.(string) - // dock.SideValidator is a validator for the "side" field. It is called by the builders before save. - dock.SideValidator = dockDescSide.Validators[0].(func(string) error) // dockDescHasPallet is the schema descriptor for hasPallet field. - dockDescHasPallet := dockFields[5].Descriptor() + dockDescHasPallet := dockFields[4].Descriptor() // dock.DefaultHasPallet holds the default value on creation for the hasPallet field. dock.DefaultHasPallet = dockDescHasPallet.Default.(bool) // dockDescPalletRef is the schema descriptor for palletRef field. - dockDescPalletRef := dockFields[6].Descriptor() + dockDescPalletRef := dockFields[5].Descriptor() // dock.DefaultPalletRef holds the default value on creation for the palletRef field. dock.DefaultPalletRef = dockDescPalletRef.Default.(string) // dock.PalletRefValidator is a validator for the "palletRef" field. It is called by the builders before save. dock.PalletRefValidator = dockDescPalletRef.Validators[0].(func(string) error) // dockDescStatus is the schema descriptor for status field. - dockDescStatus := dockFields[7].Descriptor() + dockDescStatus := dockFields[6].Descriptor() // dock.DefaultStatus holds the default value on creation for the status field. dock.DefaultStatus = dockDescStatus.Default.(string) // dock.StatusValidator is a validator for the "status" field. It is called by the builders before save. dock.StatusValidator = dockDescStatus.Validators[0].(func(string) error) // dockDescCreatedAt is the schema descriptor for createdAt field. - dockDescCreatedAt := dockFields[8].Descriptor() + dockDescCreatedAt := dockFields[7].Descriptor() // dock.DefaultCreatedAt holds the default value on creation for the createdAt field. dock.DefaultCreatedAt = dockDescCreatedAt.Default.(func() time.Time) eventlogFields := schema.EventLog{}.Fields() @@ -1467,32 +1461,18 @@ func init() { processstepDescNeedCheck := processstepFields[5].Descriptor() // processstep.DefaultNeedCheck holds the default value on creation for the needCheck field. processstep.DefaultNeedCheck = processstepDescNeedCheck.Default.(bool) - // processstepDescNeedOperatorSign is the schema descriptor for needOperatorSign field. - processstepDescNeedOperatorSign := processstepFields[6].Descriptor() - // processstep.DefaultNeedOperatorSign holds the default value on creation for the needOperatorSign field. - processstep.DefaultNeedOperatorSign = processstepDescNeedOperatorSign.Default.(bool) // processstepDescNeedInspectorSign is the schema descriptor for needInspectorSign field. - processstepDescNeedInspectorSign := processstepFields[7].Descriptor() + processstepDescNeedInspectorSign := processstepFields[6].Descriptor() // processstep.DefaultNeedInspectorSign holds the default value on creation for the needInspectorSign field. processstep.DefaultNeedInspectorSign = processstepDescNeedInspectorSign.Default.(bool) - // processstepDescNeedAudit is the schema descriptor for needAudit field. - processstepDescNeedAudit := processstepFields[8].Descriptor() - // processstep.DefaultNeedAudit holds the default value on creation for the needAudit field. - processstep.DefaultNeedAudit = processstepDescNeedAudit.Default.(bool) - // processstepDescAuditRole is the schema descriptor for auditRole field. - processstepDescAuditRole := processstepFields[9].Descriptor() - // processstep.DefaultAuditRole holds the default value on creation for the auditRole field. - processstep.DefaultAuditRole = processstepDescAuditRole.Default.(string) - // processstep.AuditRoleValidator is a validator for the "auditRole" field. It is called by the builders before save. - processstep.AuditRoleValidator = processstepDescAuditRole.Validators[0].(func(string) error) // processstepDescRemark is the schema descriptor for remark field. - processstepDescRemark := processstepFields[11].Descriptor() + processstepDescRemark := processstepFields[8].Descriptor() // processstep.DefaultRemark holds the default value on creation for the remark field. processstep.DefaultRemark = processstepDescRemark.Default.(string) // processstep.RemarkValidator is a validator for the "remark" field. It is called by the builders before save. processstep.RemarkValidator = processstepDescRemark.Validators[0].(func(string) error) // processstepDescCreatedAt is the schema descriptor for createdAt field. - processstepDescCreatedAt := processstepFields[12].Descriptor() + processstepDescCreatedAt := processstepFields[9].Descriptor() // processstep.DefaultCreatedAt holds the default value on creation for the createdAt field. processstep.DefaultCreatedAt = processstepDescCreatedAt.Default.(func() time.Time) // processstepDescID is the schema descriptor for id field. @@ -2059,56 +2039,72 @@ func init() { stepsignrecord.DefaultResult = stepsignrecordDescResult.Default.(string) // stepsignrecord.ResultValidator is a validator for the "result" field. It is called by the builders before save. stepsignrecord.ResultValidator = stepsignrecordDescResult.Validators[0].(func(string) error) + // stepsignrecordDescStepValue is the schema descriptor for stepValue field. + stepsignrecordDescStepValue := stepsignrecordFields[9].Descriptor() + // stepsignrecord.DefaultStepValue holds the default value on creation for the stepValue field. + stepsignrecord.DefaultStepValue = stepsignrecordDescStepValue.Default.(string) + // stepsignrecord.StepValueValidator is a validator for the "stepValue" field. It is called by the builders before save. + stepsignrecord.StepValueValidator = stepsignrecordDescStepValue.Validators[0].(func(string) error) + // stepsignrecordDescStepText is the schema descriptor for stepText field. + stepsignrecordDescStepText := stepsignrecordFields[10].Descriptor() + // stepsignrecord.DefaultStepText holds the default value on creation for the stepText field. + stepsignrecord.DefaultStepText = stepsignrecordDescStepText.Default.(string) + // stepsignrecord.StepTextValidator is a validator for the "stepText" field. It is called by the builders before save. + stepsignrecord.StepTextValidator = stepsignrecordDescStepText.Validators[0].(func(string) error) + // stepsignrecordDescStepChecked is the schema descriptor for stepChecked field. + stepsignrecordDescStepChecked := stepsignrecordFields[11].Descriptor() + // stepsignrecord.DefaultStepChecked holds the default value on creation for the stepChecked field. + stepsignrecord.DefaultStepChecked = stepsignrecordDescStepChecked.Default.(bool) // stepsignrecordDescSignedBy is the schema descriptor for signedBy field. - stepsignrecordDescSignedBy := stepsignrecordFields[9].Descriptor() + stepsignrecordDescSignedBy := stepsignrecordFields[13].Descriptor() // stepsignrecord.DefaultSignedBy holds the default value on creation for the signedBy field. stepsignrecord.DefaultSignedBy = stepsignrecordDescSignedBy.Default.(string) // stepsignrecord.SignedByValidator is a validator for the "signedBy" field. It is called by the builders before save. stepsignrecord.SignedByValidator = stepsignrecordDescSignedBy.Validators[0].(func(string) error) // stepsignrecordDescSignedAt is the schema descriptor for signedAt field. - stepsignrecordDescSignedAt := stepsignrecordFields[10].Descriptor() + stepsignrecordDescSignedAt := stepsignrecordFields[14].Descriptor() // stepsignrecord.DefaultSignedAt holds the default value on creation for the signedAt field. stepsignrecord.DefaultSignedAt = stepsignrecordDescSignedAt.Default.(func() time.Time) // stepsignrecordDescRound is the schema descriptor for round field. - stepsignrecordDescRound := stepsignrecordFields[11].Descriptor() + stepsignrecordDescRound := stepsignrecordFields[15].Descriptor() // stepsignrecord.DefaultRound holds the default value on creation for the round field. stepsignrecord.DefaultRound = stepsignrecordDescRound.Default.(int) // stepsignrecordDescSource is the schema descriptor for source field. - stepsignrecordDescSource := stepsignrecordFields[12].Descriptor() + stepsignrecordDescSource := stepsignrecordFields[16].Descriptor() // stepsignrecord.DefaultSource holds the default value on creation for the source field. stepsignrecord.DefaultSource = stepsignrecordDescSource.Default.(string) // stepsignrecord.SourceValidator is a validator for the "source" field. It is called by the builders before save. stepsignrecord.SourceValidator = stepsignrecordDescSource.Validators[0].(func(string) error) // stepsignrecordDescRemark is the schema descriptor for remark field. - stepsignrecordDescRemark := stepsignrecordFields[13].Descriptor() + stepsignrecordDescRemark := stepsignrecordFields[17].Descriptor() // stepsignrecord.DefaultRemark holds the default value on creation for the remark field. stepsignrecord.DefaultRemark = stepsignrecordDescRemark.Default.(string) // stepsignrecord.RemarkValidator is a validator for the "remark" field. It is called by the builders before save. stepsignrecord.RemarkValidator = stepsignrecordDescRemark.Validators[0].(func(string) error) // stepsignrecordDescFingerprint is the schema descriptor for fingerprint field. - stepsignrecordDescFingerprint := stepsignrecordFields[14].Descriptor() + stepsignrecordDescFingerprint := stepsignrecordFields[18].Descriptor() // stepsignrecord.DefaultFingerprint holds the default value on creation for the fingerprint field. stepsignrecord.DefaultFingerprint = stepsignrecordDescFingerprint.Default.(string) // stepsignrecord.FingerprintValidator is a validator for the "fingerprint" field. It is called by the builders before save. stepsignrecord.FingerprintValidator = stepsignrecordDescFingerprint.Validators[0].(func(string) error) // stepsignrecordDescRevoked is the schema descriptor for revoked field. - stepsignrecordDescRevoked := stepsignrecordFields[15].Descriptor() + stepsignrecordDescRevoked := stepsignrecordFields[19].Descriptor() // stepsignrecord.DefaultRevoked holds the default value on creation for the revoked field. stepsignrecord.DefaultRevoked = stepsignrecordDescRevoked.Default.(bool) // stepsignrecordDescRevokedBy is the schema descriptor for revokedBy field. - stepsignrecordDescRevokedBy := stepsignrecordFields[16].Descriptor() + stepsignrecordDescRevokedBy := stepsignrecordFields[20].Descriptor() // stepsignrecord.DefaultRevokedBy holds the default value on creation for the revokedBy field. stepsignrecord.DefaultRevokedBy = stepsignrecordDescRevokedBy.Default.(string) // stepsignrecord.RevokedByValidator is a validator for the "revokedBy" field. It is called by the builders before save. stepsignrecord.RevokedByValidator = stepsignrecordDescRevokedBy.Validators[0].(func(string) error) // stepsignrecordDescRevokeReason is the schema descriptor for revokeReason field. - stepsignrecordDescRevokeReason := stepsignrecordFields[18].Descriptor() + stepsignrecordDescRevokeReason := stepsignrecordFields[22].Descriptor() // stepsignrecord.DefaultRevokeReason holds the default value on creation for the revokeReason field. stepsignrecord.DefaultRevokeReason = stepsignrecordDescRevokeReason.Default.(string) // stepsignrecord.RevokeReasonValidator is a validator for the "revokeReason" field. It is called by the builders before save. stepsignrecord.RevokeReasonValidator = stepsignrecordDescRevokeReason.Validators[0].(func(string) error) // stepsignrecordDescCreatedAt is the schema descriptor for createdAt field. - stepsignrecordDescCreatedAt := stepsignrecordFields[19].Descriptor() + stepsignrecordDescCreatedAt := stepsignrecordFields[23].Descriptor() // stepsignrecord.DefaultCreatedAt holds the default value on creation for the createdAt field. stepsignrecord.DefaultCreatedAt = stepsignrecordDescCreatedAt.Default.(func() time.Time) // stepsignrecordDescID is the schema descriptor for id field. diff --git a/bj_power_mes/ent/stepsignrecord.go b/bj_power_mes/ent/stepsignrecord.go index e39edff..7130d08 100644 --- a/bj_power_mes/ent/stepsignrecord.go +++ b/bj_power_mes/ent/stepsignrecord.go @@ -12,7 +12,7 @@ import ( "entgo.io/ent/dialect/sql" ) -// StepSignRecord 步骤签字记录:工艺步骤配置 need_operator_sign/need_inspector_sign 后, +// StepSignRecord 步骤签字记录:报检呼叫与检验员签字留痕 type StepSignRecord struct { config `json:"-"` // ID of the ent. @@ -29,10 +29,18 @@ type StepSignRecord struct { StepId int `json:"stepId,omitempty"` // 步骤名称 StepName string `json:"stepName,omitempty"` - // 签字角色 OPERATOR/INSPECTOR + // 签字角色 CALL/INSPECTOR SignRole string `json:"signRole,omitempty"` // 签字时点的结论 OK/NG Result string `json:"result,omitempty"` + // 步骤录入值快照 + StepValue string `json:"stepValue,omitempty"` + // 步骤录入文本快照 + StepText string `json:"stepText,omitempty"` + // 步骤自检勾选快照 + StepChecked bool `json:"stepChecked,omitempty"` + // 采集来源工艺步骤数据ID(可选) + ProcessId int64 `json:"processId,omitempty"` // 签字人(登录账号) SignedBy string `json:"signedBy,omitempty"` // 签字时间 @@ -63,11 +71,11 @@ func (*StepSignRecord) scanValues(columns []string) ([]any, error) { values := make([]any, len(columns)) for i := range columns { switch columns[i] { - case stepsignrecord.FieldRevoked: + case stepsignrecord.FieldStepChecked, stepsignrecord.FieldRevoked: values[i] = new(sql.NullBool) - case stepsignrecord.FieldID, stepsignrecord.FieldFlowId, stepsignrecord.FieldStepId, stepsignrecord.FieldRound: + case stepsignrecord.FieldID, stepsignrecord.FieldFlowId, stepsignrecord.FieldStepId, stepsignrecord.FieldProcessId, stepsignrecord.FieldRound: values[i] = new(sql.NullInt64) - case stepsignrecord.FieldSn, stepsignrecord.FieldOrderNo, stepsignrecord.FieldStationNo, stepsignrecord.FieldStepName, stepsignrecord.FieldSignRole, stepsignrecord.FieldResult, stepsignrecord.FieldSignedBy, stepsignrecord.FieldSource, stepsignrecord.FieldRemark, stepsignrecord.FieldFingerprint, stepsignrecord.FieldRevokedBy, stepsignrecord.FieldRevokeReason: + case stepsignrecord.FieldSn, stepsignrecord.FieldOrderNo, stepsignrecord.FieldStationNo, stepsignrecord.FieldStepName, stepsignrecord.FieldSignRole, stepsignrecord.FieldResult, stepsignrecord.FieldStepValue, stepsignrecord.FieldStepText, stepsignrecord.FieldSignedBy, stepsignrecord.FieldSource, stepsignrecord.FieldRemark, stepsignrecord.FieldFingerprint, stepsignrecord.FieldRevokedBy, stepsignrecord.FieldRevokeReason: values[i] = new(sql.NullString) case stepsignrecord.FieldSignedAt, stepsignrecord.FieldRevokedAt, stepsignrecord.FieldCreatedAt: values[i] = new(sql.NullTime) @@ -140,6 +148,30 @@ func (_m *StepSignRecord) assignValues(columns []string, values []any) error { } else if value.Valid { _m.Result = value.String } + case stepsignrecord.FieldStepValue: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field stepValue", values[i]) + } else if value.Valid { + _m.StepValue = value.String + } + case stepsignrecord.FieldStepText: + if value, ok := values[i].(*sql.NullString); !ok { + return fmt.Errorf("unexpected type %T for field stepText", values[i]) + } else if value.Valid { + _m.StepText = value.String + } + case stepsignrecord.FieldStepChecked: + if value, ok := values[i].(*sql.NullBool); !ok { + return fmt.Errorf("unexpected type %T for field stepChecked", values[i]) + } else if value.Valid { + _m.StepChecked = value.Bool + } + case stepsignrecord.FieldProcessId: + if value, ok := values[i].(*sql.NullInt64); !ok { + return fmt.Errorf("unexpected type %T for field processId", values[i]) + } else if value.Valid { + _m.ProcessId = value.Int64 + } case stepsignrecord.FieldSignedBy: if value, ok := values[i].(*sql.NullString); !ok { return fmt.Errorf("unexpected type %T for field signedBy", values[i]) @@ -266,6 +298,18 @@ func (_m *StepSignRecord) String() string { builder.WriteString("result=") builder.WriteString(_m.Result) builder.WriteString(", ") + builder.WriteString("stepValue=") + builder.WriteString(_m.StepValue) + builder.WriteString(", ") + builder.WriteString("stepText=") + builder.WriteString(_m.StepText) + builder.WriteString(", ") + builder.WriteString("stepChecked=") + builder.WriteString(fmt.Sprintf("%v", _m.StepChecked)) + builder.WriteString(", ") + builder.WriteString("processId=") + builder.WriteString(fmt.Sprintf("%v", _m.ProcessId)) + builder.WriteString(", ") builder.WriteString("signedBy=") builder.WriteString(_m.SignedBy) builder.WriteString(", ") diff --git a/bj_power_mes/ent/stepsignrecord/stepsignrecord.go b/bj_power_mes/ent/stepsignrecord/stepsignrecord.go index 1ac0364..1e26661 100644 --- a/bj_power_mes/ent/stepsignrecord/stepsignrecord.go +++ b/bj_power_mes/ent/stepsignrecord/stepsignrecord.go @@ -29,6 +29,14 @@ const ( FieldSignRole = "sign_role" // FieldResult holds the string denoting the result field in the database. FieldResult = "result" + // FieldStepValue holds the string denoting the stepvalue field in the database. + FieldStepValue = "step_value" + // FieldStepText holds the string denoting the steptext field in the database. + FieldStepText = "step_text" + // FieldStepChecked holds the string denoting the stepchecked field in the database. + FieldStepChecked = "step_checked" + // FieldProcessId holds the string denoting the processid field in the database. + FieldProcessId = "process_id" // FieldSignedBy holds the string denoting the signedby field in the database. FieldSignedBy = "signed_by" // FieldSignedAt holds the string denoting the signedat field in the database. @@ -66,6 +74,10 @@ var Columns = []string{ FieldStepName, FieldSignRole, FieldResult, + FieldStepValue, + FieldStepText, + FieldStepChecked, + FieldProcessId, FieldSignedBy, FieldSignedAt, FieldRound, @@ -118,6 +130,16 @@ var ( DefaultResult string // ResultValidator is a validator for the "result" field. It is called by the builders before save. ResultValidator func(string) error + // DefaultStepValue holds the default value on creation for the "stepValue" field. + DefaultStepValue string + // StepValueValidator is a validator for the "stepValue" field. It is called by the builders before save. + StepValueValidator func(string) error + // DefaultStepText holds the default value on creation for the "stepText" field. + DefaultStepText string + // StepTextValidator is a validator for the "stepText" field. It is called by the builders before save. + StepTextValidator func(string) error + // DefaultStepChecked holds the default value on creation for the "stepChecked" field. + DefaultStepChecked bool // DefaultSignedBy holds the default value on creation for the "signedBy" field. DefaultSignedBy string // SignedByValidator is a validator for the "signedBy" field. It is called by the builders before save. @@ -202,6 +224,26 @@ func ByResult(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldResult, opts...).ToFunc() } +// ByStepValue orders the results by the stepValue field. +func ByStepValue(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStepValue, opts...).ToFunc() +} + +// ByStepText orders the results by the stepText field. +func ByStepText(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStepText, opts...).ToFunc() +} + +// ByStepChecked orders the results by the stepChecked field. +func ByStepChecked(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldStepChecked, opts...).ToFunc() +} + +// ByProcessId orders the results by the processId field. +func ByProcessId(opts ...sql.OrderTermOption) OrderOption { + return sql.OrderByField(FieldProcessId, opts...).ToFunc() +} + // BySignedBy orders the results by the signedBy field. func BySignedBy(opts ...sql.OrderTermOption) OrderOption { return sql.OrderByField(FieldSignedBy, opts...).ToFunc() diff --git a/bj_power_mes/ent/stepsignrecord/where.go b/bj_power_mes/ent/stepsignrecord/where.go index eebe59e..973106f 100644 --- a/bj_power_mes/ent/stepsignrecord/where.go +++ b/bj_power_mes/ent/stepsignrecord/where.go @@ -94,6 +94,26 @@ func Result(v string) predicate.StepSignRecord { return predicate.StepSignRecord(sql.FieldEQ(FieldResult, v)) } +// StepValue applies equality check predicate on the "stepValue" field. It's identical to StepValueEQ. +func StepValue(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEQ(FieldStepValue, v)) +} + +// StepText applies equality check predicate on the "stepText" field. It's identical to StepTextEQ. +func StepText(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEQ(FieldStepText, v)) +} + +// StepChecked applies equality check predicate on the "stepChecked" field. It's identical to StepCheckedEQ. +func StepChecked(v bool) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEQ(FieldStepChecked, v)) +} + +// ProcessId applies equality check predicate on the "processId" field. It's identical to ProcessIdEQ. +func ProcessId(v int64) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEQ(FieldProcessId, v)) +} + // SignedBy applies equality check predicate on the "signedBy" field. It's identical to SignedByEQ. func SignedBy(v string) predicate.StepSignRecord { return predicate.StepSignRecord(sql.FieldEQ(FieldSignedBy, v)) @@ -619,6 +639,196 @@ func ResultContainsFold(v string) predicate.StepSignRecord { return predicate.StepSignRecord(sql.FieldContainsFold(FieldResult, v)) } +// StepValueEQ applies the EQ predicate on the "stepValue" field. +func StepValueEQ(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEQ(FieldStepValue, v)) +} + +// StepValueNEQ applies the NEQ predicate on the "stepValue" field. +func StepValueNEQ(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldNEQ(FieldStepValue, v)) +} + +// StepValueIn applies the In predicate on the "stepValue" field. +func StepValueIn(vs ...string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldIn(FieldStepValue, vs...)) +} + +// StepValueNotIn applies the NotIn predicate on the "stepValue" field. +func StepValueNotIn(vs ...string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldNotIn(FieldStepValue, vs...)) +} + +// StepValueGT applies the GT predicate on the "stepValue" field. +func StepValueGT(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldGT(FieldStepValue, v)) +} + +// StepValueGTE applies the GTE predicate on the "stepValue" field. +func StepValueGTE(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldGTE(FieldStepValue, v)) +} + +// StepValueLT applies the LT predicate on the "stepValue" field. +func StepValueLT(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldLT(FieldStepValue, v)) +} + +// StepValueLTE applies the LTE predicate on the "stepValue" field. +func StepValueLTE(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldLTE(FieldStepValue, v)) +} + +// StepValueContains applies the Contains predicate on the "stepValue" field. +func StepValueContains(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldContains(FieldStepValue, v)) +} + +// StepValueHasPrefix applies the HasPrefix predicate on the "stepValue" field. +func StepValueHasPrefix(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldHasPrefix(FieldStepValue, v)) +} + +// StepValueHasSuffix applies the HasSuffix predicate on the "stepValue" field. +func StepValueHasSuffix(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldHasSuffix(FieldStepValue, v)) +} + +// StepValueEqualFold applies the EqualFold predicate on the "stepValue" field. +func StepValueEqualFold(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEqualFold(FieldStepValue, v)) +} + +// StepValueContainsFold applies the ContainsFold predicate on the "stepValue" field. +func StepValueContainsFold(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldContainsFold(FieldStepValue, v)) +} + +// StepTextEQ applies the EQ predicate on the "stepText" field. +func StepTextEQ(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEQ(FieldStepText, v)) +} + +// StepTextNEQ applies the NEQ predicate on the "stepText" field. +func StepTextNEQ(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldNEQ(FieldStepText, v)) +} + +// StepTextIn applies the In predicate on the "stepText" field. +func StepTextIn(vs ...string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldIn(FieldStepText, vs...)) +} + +// StepTextNotIn applies the NotIn predicate on the "stepText" field. +func StepTextNotIn(vs ...string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldNotIn(FieldStepText, vs...)) +} + +// StepTextGT applies the GT predicate on the "stepText" field. +func StepTextGT(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldGT(FieldStepText, v)) +} + +// StepTextGTE applies the GTE predicate on the "stepText" field. +func StepTextGTE(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldGTE(FieldStepText, v)) +} + +// StepTextLT applies the LT predicate on the "stepText" field. +func StepTextLT(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldLT(FieldStepText, v)) +} + +// StepTextLTE applies the LTE predicate on the "stepText" field. +func StepTextLTE(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldLTE(FieldStepText, v)) +} + +// StepTextContains applies the Contains predicate on the "stepText" field. +func StepTextContains(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldContains(FieldStepText, v)) +} + +// StepTextHasPrefix applies the HasPrefix predicate on the "stepText" field. +func StepTextHasPrefix(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldHasPrefix(FieldStepText, v)) +} + +// StepTextHasSuffix applies the HasSuffix predicate on the "stepText" field. +func StepTextHasSuffix(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldHasSuffix(FieldStepText, v)) +} + +// StepTextEqualFold applies the EqualFold predicate on the "stepText" field. +func StepTextEqualFold(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEqualFold(FieldStepText, v)) +} + +// StepTextContainsFold applies the ContainsFold predicate on the "stepText" field. +func StepTextContainsFold(v string) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldContainsFold(FieldStepText, v)) +} + +// StepCheckedEQ applies the EQ predicate on the "stepChecked" field. +func StepCheckedEQ(v bool) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEQ(FieldStepChecked, v)) +} + +// StepCheckedNEQ applies the NEQ predicate on the "stepChecked" field. +func StepCheckedNEQ(v bool) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldNEQ(FieldStepChecked, v)) +} + +// ProcessIdEQ applies the EQ predicate on the "processId" field. +func ProcessIdEQ(v int64) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldEQ(FieldProcessId, v)) +} + +// ProcessIdNEQ applies the NEQ predicate on the "processId" field. +func ProcessIdNEQ(v int64) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldNEQ(FieldProcessId, v)) +} + +// ProcessIdIn applies the In predicate on the "processId" field. +func ProcessIdIn(vs ...int64) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldIn(FieldProcessId, vs...)) +} + +// ProcessIdNotIn applies the NotIn predicate on the "processId" field. +func ProcessIdNotIn(vs ...int64) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldNotIn(FieldProcessId, vs...)) +} + +// ProcessIdGT applies the GT predicate on the "processId" field. +func ProcessIdGT(v int64) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldGT(FieldProcessId, v)) +} + +// ProcessIdGTE applies the GTE predicate on the "processId" field. +func ProcessIdGTE(v int64) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldGTE(FieldProcessId, v)) +} + +// ProcessIdLT applies the LT predicate on the "processId" field. +func ProcessIdLT(v int64) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldLT(FieldProcessId, v)) +} + +// ProcessIdLTE applies the LTE predicate on the "processId" field. +func ProcessIdLTE(v int64) predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldLTE(FieldProcessId, v)) +} + +// ProcessIdIsNil applies the IsNil predicate on the "processId" field. +func ProcessIdIsNil() predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldIsNull(FieldProcessId)) +} + +// ProcessIdNotNil applies the NotNil predicate on the "processId" field. +func ProcessIdNotNil() predicate.StepSignRecord { + return predicate.StepSignRecord(sql.FieldNotNull(FieldProcessId)) +} + // SignedByEQ applies the EQ predicate on the "signedBy" field. func SignedByEQ(v string) predicate.StepSignRecord { return predicate.StepSignRecord(sql.FieldEQ(FieldSignedBy, v)) diff --git a/bj_power_mes/ent/stepsignrecord_create.go b/bj_power_mes/ent/stepsignrecord_create.go index 69d7f25..c1f3474 100644 --- a/bj_power_mes/ent/stepsignrecord_create.go +++ b/bj_power_mes/ent/stepsignrecord_create.go @@ -132,6 +132,62 @@ func (_c *StepSignRecordCreate) SetNillableResult(v *string) *StepSignRecordCrea return _c } +// SetStepValue sets the "stepValue" field. +func (_c *StepSignRecordCreate) SetStepValue(v string) *StepSignRecordCreate { + _c.mutation.SetStepValue(v) + return _c +} + +// SetNillableStepValue sets the "stepValue" field if the given value is not nil. +func (_c *StepSignRecordCreate) SetNillableStepValue(v *string) *StepSignRecordCreate { + if v != nil { + _c.SetStepValue(*v) + } + return _c +} + +// SetStepText sets the "stepText" field. +func (_c *StepSignRecordCreate) SetStepText(v string) *StepSignRecordCreate { + _c.mutation.SetStepText(v) + return _c +} + +// SetNillableStepText sets the "stepText" field if the given value is not nil. +func (_c *StepSignRecordCreate) SetNillableStepText(v *string) *StepSignRecordCreate { + if v != nil { + _c.SetStepText(*v) + } + return _c +} + +// SetStepChecked sets the "stepChecked" field. +func (_c *StepSignRecordCreate) SetStepChecked(v bool) *StepSignRecordCreate { + _c.mutation.SetStepChecked(v) + return _c +} + +// SetNillableStepChecked sets the "stepChecked" field if the given value is not nil. +func (_c *StepSignRecordCreate) SetNillableStepChecked(v *bool) *StepSignRecordCreate { + if v != nil { + _c.SetStepChecked(*v) + } + return _c +} + +// SetProcessId sets the "processId" field. +func (_c *StepSignRecordCreate) SetProcessId(v int64) *StepSignRecordCreate { + _c.mutation.SetProcessId(v) + return _c +} + +// SetNillableProcessId sets the "processId" field if the given value is not nil. +func (_c *StepSignRecordCreate) SetNillableProcessId(v *int64) *StepSignRecordCreate { + if v != nil { + _c.SetProcessId(*v) + } + return _c +} + // SetSignedBy sets the "signedBy" field. func (_c *StepSignRecordCreate) SetSignedBy(v string) *StepSignRecordCreate { _c.mutation.SetSignedBy(v) @@ -359,6 +415,18 @@ func (_c *StepSignRecordCreate) defaults() { v := stepsignrecord.DefaultResult _c.mutation.SetResult(v) } + if _, ok := _c.mutation.StepValue(); !ok { + v := stepsignrecord.DefaultStepValue + _c.mutation.SetStepValue(v) + } + if _, ok := _c.mutation.StepText(); !ok { + v := stepsignrecord.DefaultStepText + _c.mutation.SetStepText(v) + } + if _, ok := _c.mutation.StepChecked(); !ok { + v := stepsignrecord.DefaultStepChecked + _c.mutation.SetStepChecked(v) + } if _, ok := _c.mutation.SignedBy(); !ok { v := stepsignrecord.DefaultSignedBy _c.mutation.SetSignedBy(v) @@ -457,6 +525,25 @@ func (_c *StepSignRecordCreate) check() error { return &ValidationError{Name: "result", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.result": %w`, err)} } } + if _, ok := _c.mutation.StepValue(); !ok { + return &ValidationError{Name: "stepValue", err: errors.New(`ent: missing required field "StepSignRecord.stepValue"`)} + } + if v, ok := _c.mutation.StepValue(); ok { + if err := stepsignrecord.StepValueValidator(v); err != nil { + return &ValidationError{Name: "stepValue", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.stepValue": %w`, err)} + } + } + if _, ok := _c.mutation.StepText(); !ok { + return &ValidationError{Name: "stepText", err: errors.New(`ent: missing required field "StepSignRecord.stepText"`)} + } + if v, ok := _c.mutation.StepText(); ok { + if err := stepsignrecord.StepTextValidator(v); err != nil { + return &ValidationError{Name: "stepText", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.stepText": %w`, err)} + } + } + if _, ok := _c.mutation.StepChecked(); !ok { + return &ValidationError{Name: "stepChecked", err: errors.New(`ent: missing required field "StepSignRecord.stepChecked"`)} + } if _, ok := _c.mutation.SignedBy(); !ok { return &ValidationError{Name: "signedBy", err: errors.New(`ent: missing required field "StepSignRecord.signedBy"`)} } @@ -586,6 +673,22 @@ func (_c *StepSignRecordCreate) createSpec() (*StepSignRecord, *sqlgraph.CreateS _spec.SetField(stepsignrecord.FieldResult, field.TypeString, value) _node.Result = value } + if value, ok := _c.mutation.StepValue(); ok { + _spec.SetField(stepsignrecord.FieldStepValue, field.TypeString, value) + _node.StepValue = value + } + if value, ok := _c.mutation.StepText(); ok { + _spec.SetField(stepsignrecord.FieldStepText, field.TypeString, value) + _node.StepText = value + } + if value, ok := _c.mutation.StepChecked(); ok { + _spec.SetField(stepsignrecord.FieldStepChecked, field.TypeBool, value) + _node.StepChecked = value + } + if value, ok := _c.mutation.ProcessId(); ok { + _spec.SetField(stepsignrecord.FieldProcessId, field.TypeInt64, value) + _node.ProcessId = value + } if value, ok := _c.mutation.SignedBy(); ok { _spec.SetField(stepsignrecord.FieldSignedBy, field.TypeString, value) _node.SignedBy = value diff --git a/bj_power_mes/ent/stepsignrecord_update.go b/bj_power_mes/ent/stepsignrecord_update.go index f073a0d..9fb9fca 100644 --- a/bj_power_mes/ent/stepsignrecord_update.go +++ b/bj_power_mes/ent/stepsignrecord_update.go @@ -155,6 +155,75 @@ func (_u *StepSignRecordUpdate) SetNillableResult(v *string) *StepSignRecordUpda return _u } +// SetStepValue sets the "stepValue" field. +func (_u *StepSignRecordUpdate) SetStepValue(v string) *StepSignRecordUpdate { + _u.mutation.SetStepValue(v) + return _u +} + +// SetNillableStepValue sets the "stepValue" field if the given value is not nil. +func (_u *StepSignRecordUpdate) SetNillableStepValue(v *string) *StepSignRecordUpdate { + if v != nil { + _u.SetStepValue(*v) + } + return _u +} + +// SetStepText sets the "stepText" field. +func (_u *StepSignRecordUpdate) SetStepText(v string) *StepSignRecordUpdate { + _u.mutation.SetStepText(v) + return _u +} + +// SetNillableStepText sets the "stepText" field if the given value is not nil. +func (_u *StepSignRecordUpdate) SetNillableStepText(v *string) *StepSignRecordUpdate { + if v != nil { + _u.SetStepText(*v) + } + return _u +} + +// SetStepChecked sets the "stepChecked" field. +func (_u *StepSignRecordUpdate) SetStepChecked(v bool) *StepSignRecordUpdate { + _u.mutation.SetStepChecked(v) + return _u +} + +// SetNillableStepChecked sets the "stepChecked" field if the given value is not nil. +func (_u *StepSignRecordUpdate) SetNillableStepChecked(v *bool) *StepSignRecordUpdate { + if v != nil { + _u.SetStepChecked(*v) + } + return _u +} + +// SetProcessId sets the "processId" field. +func (_u *StepSignRecordUpdate) SetProcessId(v int64) *StepSignRecordUpdate { + _u.mutation.ResetProcessId() + _u.mutation.SetProcessId(v) + return _u +} + +// SetNillableProcessId sets the "processId" field if the given value is not nil. +func (_u *StepSignRecordUpdate) SetNillableProcessId(v *int64) *StepSignRecordUpdate { + if v != nil { + _u.SetProcessId(*v) + } + return _u +} + +// AddProcessId adds value to the "processId" field. +func (_u *StepSignRecordUpdate) AddProcessId(v int64) *StepSignRecordUpdate { + _u.mutation.AddProcessId(v) + return _u +} + +// ClearProcessId clears the value of the "processId" field. +func (_u *StepSignRecordUpdate) ClearProcessId() *StepSignRecordUpdate { + _u.mutation.ClearProcessId() + return _u +} + // SetSignedBy sets the "signedBy" field. func (_u *StepSignRecordUpdate) SetSignedBy(v string) *StepSignRecordUpdate { _u.mutation.SetSignedBy(v) @@ -372,6 +441,16 @@ func (_u *StepSignRecordUpdate) check() error { return &ValidationError{Name: "result", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.result": %w`, err)} } } + if v, ok := _u.mutation.StepValue(); ok { + if err := stepsignrecord.StepValueValidator(v); err != nil { + return &ValidationError{Name: "stepValue", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.stepValue": %w`, err)} + } + } + if v, ok := _u.mutation.StepText(); ok { + if err := stepsignrecord.StepTextValidator(v); err != nil { + return &ValidationError{Name: "stepText", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.stepText": %w`, err)} + } + } if v, ok := _u.mutation.SignedBy(); ok { if err := stepsignrecord.SignedByValidator(v); err != nil { return &ValidationError{Name: "signedBy", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.signedBy": %w`, err)} @@ -453,6 +532,24 @@ func (_u *StepSignRecordUpdate) sqlSave(ctx context.Context) (_node int, err err if value, ok := _u.mutation.Result(); ok { _spec.SetField(stepsignrecord.FieldResult, field.TypeString, value) } + if value, ok := _u.mutation.StepValue(); ok { + _spec.SetField(stepsignrecord.FieldStepValue, field.TypeString, value) + } + if value, ok := _u.mutation.StepText(); ok { + _spec.SetField(stepsignrecord.FieldStepText, field.TypeString, value) + } + if value, ok := _u.mutation.StepChecked(); ok { + _spec.SetField(stepsignrecord.FieldStepChecked, field.TypeBool, value) + } + if value, ok := _u.mutation.ProcessId(); ok { + _spec.SetField(stepsignrecord.FieldProcessId, field.TypeInt64, value) + } + if value, ok := _u.mutation.AddedProcessId(); ok { + _spec.AddField(stepsignrecord.FieldProcessId, field.TypeInt64, value) + } + if _u.mutation.ProcessIdCleared() { + _spec.ClearField(stepsignrecord.FieldProcessId, field.TypeInt64) + } if value, ok := _u.mutation.SignedBy(); ok { _spec.SetField(stepsignrecord.FieldSignedBy, field.TypeString, value) } @@ -637,6 +734,75 @@ func (_u *StepSignRecordUpdateOne) SetNillableResult(v *string) *StepSignRecordU return _u } +// SetStepValue sets the "stepValue" field. +func (_u *StepSignRecordUpdateOne) SetStepValue(v string) *StepSignRecordUpdateOne { + _u.mutation.SetStepValue(v) + return _u +} + +// SetNillableStepValue sets the "stepValue" field if the given value is not nil. +func (_u *StepSignRecordUpdateOne) SetNillableStepValue(v *string) *StepSignRecordUpdateOne { + if v != nil { + _u.SetStepValue(*v) + } + return _u +} + +// SetStepText sets the "stepText" field. +func (_u *StepSignRecordUpdateOne) SetStepText(v string) *StepSignRecordUpdateOne { + _u.mutation.SetStepText(v) + return _u +} + +// SetNillableStepText sets the "stepText" field if the given value is not nil. +func (_u *StepSignRecordUpdateOne) SetNillableStepText(v *string) *StepSignRecordUpdateOne { + if v != nil { + _u.SetStepText(*v) + } + return _u +} + +// SetStepChecked sets the "stepChecked" field. +func (_u *StepSignRecordUpdateOne) SetStepChecked(v bool) *StepSignRecordUpdateOne { + _u.mutation.SetStepChecked(v) + return _u +} + +// SetNillableStepChecked sets the "stepChecked" field if the given value is not nil. +func (_u *StepSignRecordUpdateOne) SetNillableStepChecked(v *bool) *StepSignRecordUpdateOne { + if v != nil { + _u.SetStepChecked(*v) + } + return _u +} + +// SetProcessId sets the "processId" field. +func (_u *StepSignRecordUpdateOne) SetProcessId(v int64) *StepSignRecordUpdateOne { + _u.mutation.ResetProcessId() + _u.mutation.SetProcessId(v) + return _u +} + +// SetNillableProcessId sets the "processId" field if the given value is not nil. +func (_u *StepSignRecordUpdateOne) SetNillableProcessId(v *int64) *StepSignRecordUpdateOne { + if v != nil { + _u.SetProcessId(*v) + } + return _u +} + +// AddProcessId adds value to the "processId" field. +func (_u *StepSignRecordUpdateOne) AddProcessId(v int64) *StepSignRecordUpdateOne { + _u.mutation.AddProcessId(v) + return _u +} + +// ClearProcessId clears the value of the "processId" field. +func (_u *StepSignRecordUpdateOne) ClearProcessId() *StepSignRecordUpdateOne { + _u.mutation.ClearProcessId() + return _u +} + // SetSignedBy sets the "signedBy" field. func (_u *StepSignRecordUpdateOne) SetSignedBy(v string) *StepSignRecordUpdateOne { _u.mutation.SetSignedBy(v) @@ -867,6 +1033,16 @@ func (_u *StepSignRecordUpdateOne) check() error { return &ValidationError{Name: "result", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.result": %w`, err)} } } + if v, ok := _u.mutation.StepValue(); ok { + if err := stepsignrecord.StepValueValidator(v); err != nil { + return &ValidationError{Name: "stepValue", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.stepValue": %w`, err)} + } + } + if v, ok := _u.mutation.StepText(); ok { + if err := stepsignrecord.StepTextValidator(v); err != nil { + return &ValidationError{Name: "stepText", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.stepText": %w`, err)} + } + } if v, ok := _u.mutation.SignedBy(); ok { if err := stepsignrecord.SignedByValidator(v); err != nil { return &ValidationError{Name: "signedBy", err: fmt.Errorf(`ent: validator failed for field "StepSignRecord.signedBy": %w`, err)} @@ -965,6 +1141,24 @@ func (_u *StepSignRecordUpdateOne) sqlSave(ctx context.Context) (_node *StepSign if value, ok := _u.mutation.Result(); ok { _spec.SetField(stepsignrecord.FieldResult, field.TypeString, value) } + if value, ok := _u.mutation.StepValue(); ok { + _spec.SetField(stepsignrecord.FieldStepValue, field.TypeString, value) + } + if value, ok := _u.mutation.StepText(); ok { + _spec.SetField(stepsignrecord.FieldStepText, field.TypeString, value) + } + if value, ok := _u.mutation.StepChecked(); ok { + _spec.SetField(stepsignrecord.FieldStepChecked, field.TypeBool, value) + } + if value, ok := _u.mutation.ProcessId(); ok { + _spec.SetField(stepsignrecord.FieldProcessId, field.TypeInt64, value) + } + if value, ok := _u.mutation.AddedProcessId(); ok { + _spec.AddField(stepsignrecord.FieldProcessId, field.TypeInt64, value) + } + if _u.mutation.ProcessIdCleared() { + _spec.ClearField(stepsignrecord.FieldProcessId, field.TypeInt64) + } if value, ok := _u.mutation.SignedBy(); ok { _spec.SetField(stepsignrecord.FieldSignedBy, field.TypeString, value) } diff --git a/bj_power_mes/frontend/src/board/boardMock.js b/bj_power_mes/frontend/src/board/boardMock.js index cf83270..2416819 100644 --- a/bj_power_mes/frontend/src/board/boardMock.js +++ b/bj_power_mes/frontend/src/board/boardMock.js @@ -85,17 +85,17 @@ function buildStations() { /** 演示点位态:主线/接驳台预置部分占用,在途多条(多条流光) */ function buildDemoPoints() { const mainHas = new Set(['C1', 'C3', 'C7', 'C9', 'C13']) - const dockHas = new Set(['G1L', 'G3R', 'G6L', 'JBT21']) + const dockHas = new Set(['GW1Z', 'GW3Y', 'GW6Z', 'JBT21']) return { mock: false, main: Array.from({ length: 15 }, (_, i) => ({ code: `C${i + 1}`, has: mainHas.has(`C${i + 1}`) })), dock: (() => { const arr = Array.from({ length: 20 }, (_, i) => { const g = Math.floor(i / 2) + 1 - // 左右互换(2026-11-03 拍板):偶数工位 地图左=GxR、地图右=GxL;奇数工位 地图左=GxL。 - const s = g % 2 === 1 ? (i % 2 === 0 ? 'L' : 'R') : (i % 2 === 0 ? 'R' : 'L') - const code = `G${g}${s}` - return { code, label: `工位${g}${s === 'L' ? '左' : '右'}`, has: dockHas.has(code) } + // 编码即 RCS 点位码:Z=左、Y=右,工位 1~10 统一(奇数工位槽1=Z,偶数工位槽1=Y) + const s = g % 2 === 1 ? (i % 2 === 0 ? 'Z' : 'Y') : (i % 2 === 0 ? 'Y' : 'Z') + const code = `GW${g}${s}` + return { code, label: `工位${g}${s === 'Z' ? '左' : '右'}`, has: dockHas.has(code) } }) arr.push({ code: 'JBT21', label: '库房接驳台', has: dockHas.has('JBT21') }) return arr @@ -103,8 +103,8 @@ function buildDemoPoints() { // 多条在途路径 → 产线地图同时渲染多条 bd-flow-dash 流光 transit: [ { src: 'G5', tgt: 'C7' }, - { src: 'JBT21', tgt: 'G1L' }, - { src: 'C3', tgt: 'G3L' }, + { src: 'JBT21', tgt: 'GW1Z' }, + { src: 'C3', tgt: 'GW3Z' }, { src: 'G8', tgt: 'C10' }, ], } @@ -113,9 +113,9 @@ function buildDemoPoints() { /** 演示 AGV:多台在途(≥2 台 moving),其余待命;01/02 状态保持原值不改 */ function buildDemoAgv() { return [ - { code: 'AGV-01', status: 'moving', from: 'JBT21', to: 'G1L', carrier: '装配螺丝 M6', taskNo: 'WO-20260825-007-01' }, + { code: 'AGV-01', status: 'moving', from: 'JBT21', to: 'GW1Z', carrier: '装配螺丝 M6', taskNo: 'WO-20260825-007-01' }, { code: 'AGV-02', status: 'idle', from: 'JBT21', to: '', carrier: '', taskNo: '' }, - { code: 'AGV-03', status: 'moving', from: 'G3L', to: 'C3', carrier: '电路板 PCBA-01', taskNo: 'WO-20260825-007-03' }, + { code: 'AGV-03', status: 'moving', from: 'GW3Z', to: 'C3', carrier: '电路板 PCBA-01', taskNo: 'WO-20260825-007-03' }, { code: 'AGV-04', status: 'moving', from: 'C10', to: 'G8', carrier: '外壳上盖-铝合金', taskNo: 'WO-20260825-007-04' }, ] } diff --git a/bj_power_mes/frontend/src/board/components/BoardLineModel.vue b/bj_power_mes/frontend/src/board/components/BoardLineModel.vue index 15690c5..8a2eda4 100644 --- a/bj_power_mes/frontend/src/board/components/BoardLineModel.vue +++ b/bj_power_mes/frontend/src/board/components/BoardLineModel.vue @@ -208,17 +208,20 @@ function pointCenter(code) { if (n >= 1 && n <= 15) return { x: cx(n), y: C_Y + C_H / 2 } return null } - if (c.startsWith('G')) { + if (c.startsWith('GW')) { + // 工位接驳台 GW{工位号}{Z|Y}:Z=左、Y=右(Z 在上排槽1、下排槽2,与图纸镜像一致) const last = c.charAt(c.length - 1) - if (last === 'L' || last === 'R') { - const g = parseInt(c.slice(1, -1), 10) - if (Number.isNaN(g)) return null - const pair = PAIR_STOP.find((p) => p[0] === g || p[1] === g) - if (!pair) return null - const stopCenter = cx(pair[2]) - const top = g % 2 === 1 - return { x: dockX(stopCenter, last === 'L' ? 1 : 2) + DOCK_W / 2, y: top ? DOCK_TOP_Y + DOCK_H / 2 : DOCK_BOT_Y + DOCK_H / 2 } - } + if (last !== 'Z' && last !== 'Y') return null + const g = parseInt(c.slice(2, c.length - 1), 10) + if (Number.isNaN(g)) return null + const pair = PAIR_STOP.find((p) => p[0] === g || p[1] === g) + if (!pair) return null + const stopCenter = cx(pair[2]) + const top = g % 2 === 1 + const slot = (g % 2 === 1) === (last === 'Z') ? 1 : 2 + return { x: dockX(stopCenter, slot) + DOCK_W / 2, y: top ? DOCK_TOP_Y + DOCK_H / 2 : DOCK_BOT_Y + DOCK_H / 2 } + } + if (c.startsWith('G')) { const n = parseInt(c.slice(1), 10) const pair = PAIR_STOP.find((p) => p[0] === n || p[1] === n) if (!pair) return null @@ -263,9 +266,9 @@ const dockMap = computed(() => new Map((props.data.points?.dock || []).map((p) = const hasMain = (n) => mainMap.value.get(`C${n}`)?.has ?? false const hasJbt = computed(() => dockMap.value.get('JBT21')?.has ?? false) -// 左右互换(2026-11-03 拍板):偶数工位 地图左槽=GxR、右槽=GxL;奇数工位 地图左槽=GxL、右槽=GxR -const dockCode = (g, slot) => (g % 2 === 0 ? (slot === 1 ? `G${g}R` : `G${g}L`) : (slot === 1 ? `G${g}L` : `G${g}R`)) -const dockLabel = (g, slot) => dockMap.value.get(dockCode(g, slot))?.label || (dockCode(g, slot) === `G${g}L` ? `工位${g}左` : `工位${g}右`) +// 槽位 → 点位码:槽1/槽2 = 图纸接驳台1/2;奇数工位 1=GWnZ、2=GWnY,偶数工位 1=GWnY、2=GWnZ +const dockCode = (g, slot) => (g % 2 === 1 ? (slot === 1 ? `GW${g}Z` : `GW${g}Y`) : (slot === 1 ? `GW${g}Y` : `GW${g}Z`)) +const dockLabel = (g, slot) => dockMap.value.get(dockCode(g, slot))?.label || `工位${g}${dockCode(g, slot).charAt(dockCode(g, slot).length - 1) === 'Z' ? '左' : '右'}` const hasDockSlot = (g, slot) => dockMap.value.get(dockCode(g, slot))?.has ?? false const inStation = computed(() => stations.value.filter((s) => !!s.currentSn).length) diff --git a/bj_power_mes/frontend/src/help.js b/bj_power_mes/frontend/src/help.js index 8722f56..8e2ec20 100644 --- a/bj_power_mes/frontend/src/help.js +++ b/bj_power_mes/frontend/src/help.js @@ -62,7 +62,7 @@ export const helpDailyPlan = P('日排产', '排产是算料和叫料的开关 ] }, { k: 'confuse', t: '排产日期和两个筛选各管各的', text: '排产日期默认显示全部,想只看某段时间自己填日期范围;「启用状态」管算不算料,「工单进度」默认「未完成」(工单未完工/未取消),管这单干到哪。两个筛选互不影响,只改一个会以为没数据。' }, { k: 'rule', t: '没启用就不能上件', text: '工单开工前忘记启用排产,工位终端扫码上件会被拦下,提示先到日排产点「启用」。启用后才算料、才叫得到料、工件才能进线。' }, - { k: 'confuse', t: '送达接驳台为什么显示中文', text: '列里显示的是「左 / 右」这样的中文接驳台名称,不是 DOCK 编码。工位 2、4、6、8、10 的左右按操作员「背向主线」的视角统一,和图纸上顺向看是反的,这是现场约定。' }, + { k: 'confuse', t: '送达接驳台为什么显示中文', text: '列里显示的是「工位3左」这样的中文接驳台名称,不是 GW3Z 这类点位编号。左右与 AGV 地图点位码一致:Z=左、Y=右,10 个工位同一规则,不互换。' }, { k: 'irreversible', t: '停用 vs 删除', text: '停用=把这一天标记为废弃:不再参与算料和叫料,额度释放给补排;已发到工位的料不收回,台面余料要人工确认,不再用就走生产退料。删除会把这一天从排产页拿掉(这行已记完工台数时会二次提示),完工流水仍保留。' }, { k: 'confuse', t: '数量为什么加不上去', text: '可排额度=工单总台数-已完工台数-仍然有效的排产剩余量。停用(废弃)的旧行不再占额度,欠的量能补排,所以同一工单各天计划加起来可能大于工单总台数——那是「历史排过多少料」,不是计划超产。补排日期只能选今天或以后,过去的日子不改历史。排产量可以大于当前库存,系统只预警不拦截。' }, { k: 'rule', t: '逐日数量可以自己调(前松中紧后松)', text: '新建排产时先选「排产日期」,再选模式:平均分摊填「总数量」、固定日产填「每日产量」。系统只按模式铺出建议的逐日数量(平均分摊余数排前面、固定日产按每日产量),你可在「逐日数量」里逐天改——比如前期排少点、中后期排多点,某天改成 4 也行。以改完的逐日合计为本次实际总量,只要不超工单剩余可排就能保存;某天不排填 0,改动会留操作日志。已有完工数量的日期不在这个弹窗里改,要动得先停掉对应排产。' }, @@ -266,7 +266,6 @@ export const helpProcessCard = P('生产流程卡', '流程卡是报工实绩的 { k: 'tip', t: '导出', text: '一次最多导 100 张,范围为空时不能确认导出;支持多格式导出。' } ], [ { name: '绩效报表', path: '/performance' }, - { name: '签字复核', path: '/audit-pending' } ]) export const helpPerformance = P('绩效报表', '按报工时间归集,没报工就不会出现在这里。', [ @@ -299,13 +298,6 @@ export const helpQualityInspection = P('质量检验', '结论一旦判下去就 { name: '成品试验', path: '/trial-register' } ]) -export const helpAuditPending = P('签字复核', '审核通过是「放行」,不是「完工」。', [ - { k: 'states', t: '未审核 → 通过 / 驳回', text: '未审核的签字会卡住报工流转;驳回后现场要重做那一步再提交,不是改一下签字就行。' }, - { k: 'irreversible', t: '审核记录', text: '签字留名留时间,事后不能改。' } -], [ - { name: '生产流程卡', path: '/process-card' } -]) - export const helpProducibleSupport = P('齐套测算', '只读测算,库存不够也只提示、不会拦着排产。', [ { k: 'role', t: '这页解决什么', text: '按当前可用库存和排产计划算「还能造几套、库存大概撑到哪天」,给计划员看瓶颈物料。它不产生单据、不扣库存。' }, { k: 'confuse', t: '几个数怎么读', text: '「可生产套数」是按当前可用库存取最短板的那件物料算出来的整套数;「库存可支撑到」是把日排产逐日消耗模拟完、再按近几天平均用量外推出来的日期;「充足」表示算不到告罄,不等于库存真的无限。' }, @@ -519,7 +511,6 @@ export const helpLogin = P('登录', '连续失败时先确认账号是否被停 // 兼容既有页面的 import 名(页面引用的是短名) export const helpRole = helpRoleManage export const helpQuality = helpQualityInspection -export const helpAudit = helpAuditPending export const helpProducible = helpProducibleSupport // 保留导出:PLC↔MES 对账的已知局限,供排查时查阅 diff --git a/bj_power_mes/frontend/src/layouts/MainLayout.vue b/bj_power_mes/frontend/src/layouts/MainLayout.vue index 20e1df4..85fc903 100644 --- a/bj_power_mes/frontend/src/layouts/MainLayout.vue +++ b/bj_power_mes/frontend/src/layouts/MainLayout.vue @@ -155,7 +155,6 @@ const menuGroups = [ { code: 'produce.wip', name: '在制品追踪', path: '/wip', icon: Clock }, { code: 'produce.trace', name: '工件追溯', path: '/trace', icon: Search }, { code: 'sys.inspect', name: '巡检终端', path: '/inspect', icon: CircleCheck }, - { code: 'produce.audit', name: '签字复核', path: '/audit-pending', icon: CircleCheck }, { code: 'produce.quality', name: '质量检验', path: '/quality', icon: CircleCheck }, { code: 'produce.trial', name: '成品试验', path: '/trial-register', icon: CircleCheck } ] @@ -270,7 +269,7 @@ const TODO_PATH = { 'produce.return': '/transfer-return', 'produce.shortage': '/shortage', 'produce.qtyreport': '/qty-report', - 'produce.sign': '/audit-pending', + 'produce.sign': '/inspect', 'produce.alert': '/alert-center', 'sys.syncfailure': '/sync-failure', } diff --git a/bj_power_mes/frontend/src/pages/AccountManage.vue b/bj_power_mes/frontend/src/pages/AccountManage.vue index 3437b9b..be724a3 100644 --- a/bj_power_mes/frontend/src/pages/AccountManage.vue +++ b/bj_power_mes/frontend/src/pages/AccountManage.vue @@ -66,8 +66,8 @@ + :total="page.total" background layout="total, sizes, prev, pager, next" style="margin-top:12px" + @size-change="onSizeChange" @current-change="loadAll" /> @@ -153,7 +153,18 @@ const loading = ref(false) const all = ref([]) const roles = ref([]) const stationNos = ref([]) -const page = reactive({ current: 1, size: 10 }) +// 服务端真分页:/users 接 page/pageSize 时返回 {list,total};老后端返回裸数组则本地切片。 +const page = reactive({ current: 1, size: 10, total: 0 }) +const serverPaged = ref(false) +const pageList = computed(() => { + if (serverPaged.value) return all.value + const start = (page.current - 1) * page.size + return all.value.slice(start, start + page.size) +}) +function onSizeChange() { + page.current = 1 + loadAll() +} const roleOfId = computed(() => { const m = {} @@ -179,18 +190,24 @@ function roleTag(row) { async function loadAll() { loading.value = true try { - const [u, r] = await Promise.all([request.get('/users'), request.get('/roles')]) - all.value = u || [] + const [u, r] = await Promise.all([ + request.get('/users', { params: { page: page.current, pageSize: page.size } }), + request.get('/roles') + ]) + if (Array.isArray(u)) { + serverPaged.value = false + all.value = u + page.total = u.length + } else { + all.value = Array.isArray(u?.list) ? u.list : [] + serverPaged.value = u?.total !== undefined && u?.total !== null + page.total = serverPaged.value ? Number(u.total) || 0 : all.value.length + } roles.value = r || [] } finally { loading.value = false } } -const pageList = ref([]) -function slice() { - const start = (page.current - 1) * page.size - pageList.value = all.value.slice(start, start + page.size) -} /* ---------- 新增 / 编辑 ---------- */ const dialog = reactive({ @@ -239,7 +256,6 @@ async function save() { ElMessage.success('保存成功') dialog.show = false await loadAll() - slice() } finally { saving.value = false } @@ -255,10 +271,8 @@ async function toggleStatus(row) { }) ElMessage.success(target === 'ENABLED' ? '已启用' : '已停用') await loadAll() - slice() } catch { await loadAll() - slice() } } @@ -273,7 +287,6 @@ async function removeUser(row) { await request.delete(`/users/${row.id}`) ElMessage.success('已删除') await loadAll() - slice() } /* ---------- 详情(只读查看账号信息) ---------- */ @@ -286,7 +299,6 @@ function openDetail(row) { onMounted(async () => { await loadAll() - slice() stationNos.value = await loadStationNos() }) diff --git a/bj_power_mes/frontend/src/pages/Agv.vue b/bj_power_mes/frontend/src/pages/Agv.vue index 41c3425..9dbe819 100644 --- a/bj_power_mes/frontend/src/pages/Agv.vue +++ b/bj_power_mes/frontend/src/pages/Agv.vue @@ -39,14 +39,9 @@ async function loadDocks() { loadingDocks.value = false } -// 显示层统一(2026-11-03 左右互换拍板):接驳台按 side(操作员朝向 left/right)显示「工位X左/右」; -// 库房接驳台一律显示「库房接驳台」,不显示 JBT21 编号(T7 2026-11-03 统一代号)。 -const dockCn = (d) => { - if (!d) return '—' - if (String(d.dockCode || '') === 'JBT21' || String(d.dockCode || '') === 'DOCK21') return '库房接驳台' - const s = d.side === 'left' ? '左' : d.side === 'right' ? '右' : '' - return `工位${d.stationNo || ''}${s}` -} +// 显示层统一:接驳台编码即 AGV/RCS 点位码(GW{工位号}{Z|Y},Z=左、Y=右), +// 中文名统一由 dockLabel 解析;库房接驳台显示「库房接驳台」,不显示 JBT21 编号。 +const dockCn = (d) => (d ? dockCnCode(d.dockCode) : '—') const dockCnMap = computed(() => { const m = {} docks.value.forEach((d) => { m[d.dockCode] = dockCn(d) }) @@ -74,8 +69,9 @@ const pointMap = computed(() => { const pointLabel = (code) => { const p = pointMap.value[String(code)] if (p?.isDock && dockCnMap.value[p.dockCode]) return dockCnMap.value[p.dockCode] - // 2026-11-10:点位码兜底也不再显示 DOCK/JBT 原始编号 - if (/^(DOCK\d+|JBT21|G\d+[LR])$/i.test(String(code))) return dockCnCode(code) + // 点位码兜底:接驳台显示中文名,不显示原始编号 + const c = String(code || '') + if (c.slice(0, 2) === 'GW' || c === 'JBT21') return dockCnCode(c) return p?.name || String(code || '—') } const savingPoint = ref(0) @@ -120,7 +116,7 @@ const pendingCn = (a) => ({ // 车才离开,不再自动装车送回库房。库房 JBT21 与 TRANSPORT 卸货放行同样保留人工按钮。 // 2026-11-20 一段式裁决:load_go(确认装车并送货)已删——叫料链确认发货直接 B01 两点直达; // finish_return(结束回充电位)已删——回充业务不存在,freeRobot 后 RCS 自行调度车辆。 -const isLineDockRow = (row) => String(row?.targetDock || '').slice(0, 4) === 'DOCK' +const isLineDockRow = (row) => String(row?.targetDock || '').slice(0, 2) === 'GW' const confirmBusy = ref(false) async function confirmAgv(row, action, nextDock, confirmForcePick) { if (!canAgv.value) { ElMessage.error('没有 AGV管理权限,请找管理员开通'); return } diff --git a/bj_power_mes/frontend/src/pages/AgvManual.vue b/bj_power_mes/frontend/src/pages/AgvManual.vue index d65294e..359c39f 100644 --- a/bj_power_mes/frontend/src/pages/AgvManual.vue +++ b/bj_power_mes/frontend/src/pages/AgvManual.vue @@ -24,8 +24,8 @@ const selected = ref('') const selectedPurpose = ref('') // 选定动作:pickup 取货 / deliver 送货 / start 首段开始用车(非空标记,保证底部按钮可渲染) const activeChain = reactive({ chainNo: '', agvCode: '', current: '', segments: [], status: '', pendingAction: '', templateType: '', realtime: null }) -// 人工派车白名单(2026-11-14 用户终版):只允许库房接驳台 JBT21 与 7 个虚拟点位。 -// 所有 GW* 工位接驳台、DOCK* 历史业务点位、AGV-WAIT*/AGV-CHARGE* 待命充电位一律不显示。 +// 人工派车白名单:只允许库房接驳台 JBT21 与 7 个虚拟点位。 +// 所有 GW* 工位接驳台、AGV-WAIT*/AGV-CHARGE* 待命充电位一律不显示。 // 这里只做展示过滤,后端 validateManualDispatchTarget 才是硬闸门(同一张规则表,口径一致)。 const selectablePoints = computed(() => (points.value || []).filter((p) => p.enabled !== false && agvManualAllowed(p.positionCode) diff --git a/bj_power_mes/frontend/src/pages/AlertRule.vue b/bj_power_mes/frontend/src/pages/AlertRule.vue index 137ef4c..c7d97bd 100644 --- a/bj_power_mes/frontend/src/pages/AlertRule.vue +++ b/bj_power_mes/frontend/src/pages/AlertRule.vue @@ -28,7 +28,11 @@ 编辑 - + + @@ -54,7 +58,7 @@ + + diff --git a/bj_power_mes/frontend/src/pages/AuditPending.vue b/bj_power_mes/frontend/src/pages/AuditPending.vue deleted file mode 100644 index 61e2cce..0000000 --- a/bj_power_mes/frontend/src/pages/AuditPending.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - - - diff --git a/bj_power_mes/frontend/src/pages/DailyPlan.vue b/bj_power_mes/frontend/src/pages/DailyPlan.vue index 5fcad28..79fdfb1 100644 --- a/bj_power_mes/frontend/src/pages/DailyPlan.vue +++ b/bj_power_mes/frontend/src/pages/DailyPlan.vue @@ -117,6 +117,9 @@ +
+ 汇总数量为本页已加载明细的合计;同一工单明细跨页时请用「工单号」筛选查看整单。 +
+
@@ -115,7 +119,7 @@ + + diff --git a/bj_power_mes/frontend/src/pages/ProcessCard.vue b/bj_power_mes/frontend/src/pages/ProcessCard.vue index 1986c4a..c9f8d68 100644 --- a/bj_power_mes/frontend/src/pages/ProcessCard.vue +++ b/bj_power_mes/frontend/src/pages/ProcessCard.vue @@ -57,7 +57,7 @@ - + + { + if (serverPaged.value) return allRoles.value + const start = (page.current - 1) * page.size + return allRoles.value.slice(start, start + page.size) +}) const perms = ref([]) // 全部权限定义(MENU + BUTTON) const treeRef = ref() const filters = reactive({ keyword: '' }) function doSearch() { + page.current = 1 loadRoles() } function resetFilters() { filters.keyword = '' + page.current = 1 + loadRoles() +} +function onSizeChange() { + page.current = 1 loadRoles() } @@ -179,7 +196,18 @@ function summaryOf(codes) { async function loadRoles() { loading.value = true try { - roles.value = (await request.get('/roles', { params: { keyword: filters.keyword || undefined } })) || [] + const resp = await request.get('/roles', { params: { + keyword: filters.keyword || undefined, page: page.current, pageSize: page.size + } }) + if (Array.isArray(resp)) { + serverPaged.value = false + allRoles.value = resp + page.total = resp.length + } else { + allRoles.value = Array.isArray(resp?.list) ? resp.list : [] + serverPaged.value = resp?.total !== undefined && resp?.total !== null + page.total = serverPaged.value ? Number(resp.total) || 0 : allRoles.value.length + } } finally { loading.value = false } @@ -265,4 +293,5 @@ onMounted(async () => { .mb12 { margin-bottom: 12px; } .perm-tree { border: 1px solid #ebeef5; border-radius: 4px; padding: 12px; max-height: 360px; overflow: auto; } .perm-tip { color: #909399; font-size: 12px; margin-bottom: 8px; } +.list-pagination { margin-top: 12px; justify-content: flex-end; } diff --git a/bj_power_mes/frontend/src/pages/Settings.vue b/bj_power_mes/frontend/src/pages/Settings.vue index 28e94f1..0dd41ed 100644 --- a/bj_power_mes/frontend/src/pages/Settings.vue +++ b/bj_power_mes/frontend/src/pages/Settings.vue @@ -59,7 +59,7 @@ -
工人呼叫签字后,检验员超过该时长未签即落预警中心 + 异常告警角标(默认 30);不进铃铛,无人打开巡检端也会自动报警
+
工人报检后,检验员超过该时长未签即落预警中心 + 异常告警角标(默认 30);不进铃铛,无人打开巡检端也会自动报警
@@ -104,6 +104,25 @@
保存后立即热切换,所有库存查询/扣账/台账同步即刻走新地址;测试结果:{{ testMsg || '—' }}
+ + +
+ + + + +
+
暂存退库自动回流 WMS 的末级库位(区域/货架/层/位置号),默认 1区/1架/1层/1号;四项须命中 WMS 启用库位节点
+
+ +
+ + + + +
+
完工检合格成品自动回流 WMS 的末级库位,默认 1区/1架/1层/1号;四项须命中 WMS 启用库位节点
+
保存 @@ -139,7 +158,7 @@ const loading = ref(false) const saving = ref(false) const testing = ref(false) const testMsg = ref('') -const form = reactive({ wmsBaseURL: '', demandDays: 5, extrapWindow: 3, extrapCap: 365, logRetentionDays: 0, pipelineCache: 0, allowCrossDay: 1, allowBorrow: 1, torqueNgAlert: true, dashboardRefreshSeconds: 5, archiveRemindDays: 7, dashboardTitle: '', dashboardVoice: true, dashboardKpiVisible: '[]', dashboardAnimationLevel: 'full', dashboardBoardTitleScroll: 0, multiOrderCachePolicy: 'physical', agvUnloadTimeoutMinutes: 5, signTimeoutMinutes: 30, agvTaskTypLift: "B01", agvTaskTypPlain: "B02", agvTaskTypEmpty: "C01" }) +const form = reactive({ wmsBaseURL: '', demandDays: 5, extrapWindow: 3, extrapCap: 365, logRetentionDays: 0, pipelineCache: 0, allowCrossDay: 1, allowBorrow: 1, torqueNgAlert: true, dashboardRefreshSeconds: 5, archiveRemindDays: 7, dashboardTitle: '', dashboardVoice: true, dashboardKpiVisible: '[]', dashboardAnimationLevel: 'full', dashboardBoardTitleScroll: 0, multiOrderCachePolicy: 'physical', agvUnloadTimeoutMinutes: 5, signTimeoutMinutes: 30, agvTaskTypLift: "B01", agvTaskTypPlain: "B02", agvTaskTypEmpty: "C01", semiZoneCode: '1区', semiShelfNo: '1架', semiLayerNo: '1层', semiPositionNo: '1号', finishedZoneCode: '1区', finishedShelfNo: '1架', finishedLayerNo: '1层', finishedPositionNo: '1号' }) const info = ref({}) // 看板顶部指标:15 项可选,值用 key、中文标签;空数组=显示全部 @@ -205,7 +224,15 @@ async function load() { agvTaskTypEmpty: data.agvTaskTypEmpty || "C01", multiOrderCachePolicy: data.multiOrderCachePolicy || 'physical', agvUnloadTimeoutMinutes: data.agvUnloadTimeoutMinutes ?? 5, - signTimeoutMinutes: data.signTimeoutMinutes ?? 30 + signTimeoutMinutes: data.signTimeoutMinutes ?? 30, + semiZoneCode: data.semiZoneCode || '1区', + semiShelfNo: data.semiShelfNo || '1架', + semiLayerNo: data.semiLayerNo || '1层', + semiPositionNo: data.semiPositionNo || '1号', + finishedZoneCode: data.finishedZoneCode || '1区', + finishedShelfNo: data.finishedShelfNo || '1架', + finishedLayerNo: data.finishedLayerNo || '1层', + finishedPositionNo: data.finishedPositionNo || '1号' }) info.value = data } finally { diff --git a/bj_power_mes/frontend/src/pages/Shortage.vue b/bj_power_mes/frontend/src/pages/Shortage.vue index 3f893e7..d557ac2 100644 --- a/bj_power_mes/frontend/src/pages/Shortage.vue +++ b/bj_power_mes/frontend/src/pages/Shortage.vue @@ -19,7 +19,7 @@ + @@ -62,11 +66,26 @@ + + diff --git a/bj_power_mes/frontend/src/pages/SyncFailure.vue b/bj_power_mes/frontend/src/pages/SyncFailure.vue index 3f57c65..f8d8970 100644 --- a/bj_power_mes/frontend/src/pages/SyncFailure.vue +++ b/bj_power_mes/frontend/src/pages/SyncFailure.vue @@ -6,14 +6,14 @@ - + - + 刷新 @@ -46,6 +46,10 @@ + @@ -54,11 +58,26 @@ \ No newline at end of file + + + \ No newline at end of file diff --git a/bj_power_mes/frontend/src/pages/TransferReturn.vue b/bj_power_mes/frontend/src/pages/TransferReturn.vue index 1da85ba..6d2013b 100644 --- a/bj_power_mes/frontend/src/pages/TransferReturn.vue +++ b/bj_power_mes/frontend/src/pages/TransferReturn.vue @@ -1,13 +1,13 @@ - + +
diff --git a/bj_power_mes/schema/agv_task.go b/bj_power_mes/schema/agv_task.go index 3be7fdd..64cca6d 100644 --- a/bj_power_mes/schema/agv_task.go +++ b/bj_power_mes/schema/agv_task.go @@ -29,7 +29,7 @@ func (AgvTask) Fields() []ent.Field { return []ent.Field{ field.String("task_no").Unique().MaxLen(64).Comment("我方任务号(内部,同时作为 RCS reqCode/taskCode 追踪键)"), field.String("source_dock").Default("").MaxLen(20).Comment("起点接驳台(空车段可为空=单点path由RCS派最近空闲车)"), - field.String("target_dock").Default("").MaxLen(20).Comment("终点接驳台/点位 DOCK01..21 或 AGV-CHARGE01"), + field.String("target_dock").Default("").MaxLen(20).Comment("终点接驳台/点位 GW{工位号}{Z|Y} / JBT21 / 虚拟点位 / AGV-CHARGE01"), field.String("materials_json").Default("").MaxLen(4000).Comment("物料清单 JSON"), field.String("related_request_no").Default("").MaxLen(64).Optional().Comment("关联叫料单号(MES material_request.requestNo)"), field.String("related_outbound_no").Default("").MaxLen(64).Optional().Comment("关联出库单号(可选, WMS 回传)"), diff --git a/bj_power_mes/schema/dock.go b/bj_power_mes/schema/dock.go index 189d32f..dece776 100644 --- a/bj_power_mes/schema/dock.go +++ b/bj_power_mes/schema/dock.go @@ -10,7 +10,8 @@ import ( "entgo.io/ent/schema/index" ) -// Dock 接驳台主数据:DOCK01~DOCK20(产线,DOCKn↔工位n)+ JBT21(库房收货;T7 2026-11-03 统一代号)。 +// Dock 接驳台主数据:工位接驳台 GW{工位号}{Z|Y}(Z=左、Y=右,工位1~10)+ JBT21(库房收货)。 +// 编码即 AGV/RCS 地图点位码(2026-12-01 用户终版),旧 DOCK 编号已全量废弃。 // 接驳台真源在 MES(工位维护、AGV 通讯、排产推荐都查本表);仓库不维护接驳台。 // hasPallet 标记该接驳台当前是否有托盘:来源 PLC 托盘传感器 或 AGV 到位/卸货自动维护。 type Dock struct { @@ -18,20 +19,17 @@ type Dock struct { } func (Dock) Annotations() []schema.Annotation { - return []schema.Annotation{entsql.Annotation{Table: "dock"}, entsql.WithComments(true), schema.Comment("Dock 接驳台主数据:DOCK01~DOCK20(产线,DOCKn↔工位n)+ JBT21(库房收货;T7 2026-11-03 统一代号)。")} + return []schema.Annotation{entsql.Annotation{Table: "dock"}, entsql.WithComments(true), schema.Comment("Dock 接驳台主数据:工位接驳台 GW{工位号}{Z|Y}(Z=左、Y=右,工位1~10)+ JBT21(库房收货)。编码即 RCS 地图点位码。")} } func (Dock) Fields() []ent.Field { return []ent.Field{ - field.String("dockCode").Unique().MaxLen(20).Comment("接驳台编码 DOCK01..21"), + field.String("dockCode").Unique().MaxLen(20).Comment("接驳台编码 = AGV/RCS 点位码:GW1Z..GW10Y(Z=左、Y=右)/ JBT21"), field.String("name").Default("").MaxLen(64).Comment("接驳台名称"), // type: line(产线) / store(库房) / other(其他,如缓存区、线边暂存位) field.String("dockType").Default("line").MaxLen(16).Comment("类型 line产线/store库房/other其他"), - // 关联工位(产线接驳台 DOCKn↔工位n,1:1);库房/其他接驳台不挂工位,为 0 + // 关联工位(工位接驳台 GWnZ/GWnY ↔ 工位n,1:1);库房/其他接驳台不挂工位,为 0 field.Int("stationNo").Default(0).Comment("关联工位号(与工位1:1,非产线为0)"), - // 左右标识(2026-11-03 拍板:左右按操作员左右区分——下排工位 2/4/6/8/10 与地图左右相反, - // 故以字段显式建模,废除「奇数=左偶数=右」隐式约定;存量库经迁移补丁按新约定刷数) - field.String("side").Default("left").MaxLen(8).Comment("左右:left=操作员左手边/right=右手边(按操作员朝向区分,下排工位与地图左右相反)"), field.Bool("hasPallet").Default(false).Comment("当前是否有托盘"), // 有托盘时的关联出库/任务(便于查这个托盘是哪批料、要送到哪) field.String("palletRef").Default("").MaxLen(64).Optional().Comment("托盘关联(出库单号/备料单号)"), diff --git a/bj_power_mes/schema/line_point.go b/bj_power_mes/schema/line_point.go index cc5d9f5..41eadec 100644 --- a/bj_power_mes/schema/line_point.go +++ b/bj_power_mes/schema/line_point.go @@ -15,7 +15,7 @@ import ( // 主线位置统一编址 C1~C15(左→右),**没有独立缓存位**——缓存是主线位置的属性: // 正对工位的停靠位(C1/C4/C7/C10/C13/C15)不缓存(工件到达即顶升进工位), // 其余位置(C2/C3/C5/C6/C8/C9/C11/C12/C14)可缓存,由 cacheable 字段区分。 -// 上料 = 放到主线任意位置或任意工位(建档时选择当前位置);接驳台(GxL/GxR/JBT21) +// 上料 = 放到主线任意位置或任意工位(建档时选择当前位置);接驳台(GW{工位号}{Z|Y}/JBT21) // 是 AGV 点位(dock 表),不是主线位置、不进本台账。 type LinePoint struct { ent.Schema diff --git a/bj_power_mes/schema/process_step.go b/bj_power_mes/schema/process_step.go index c043119..d8426b6 100644 --- a/bj_power_mes/schema/process_step.go +++ b/bj_power_mes/schema/process_step.go @@ -27,11 +27,8 @@ func (ProcessStep) Fields() []ent.Field { field.Int("seq").Default(1).Comment("步骤序号"), field.String("name").MaxLen(128).Comment("步骤名称"), field.String("collectType").Default("NONE").MaxLen(20).Comment("采集方式 AUTO(拧紧枪自动)/MANUAL(手填)/SCAN(扫码,与手填等价采一串字符串)/NONE(仅记录)"), - field.Bool("needCheck").Default(false).Comment("是否需要检测确认(报工前须检验通过)"), - field.Bool("needOperatorSign").Default(false).Comment("是否需要操作工签字(报工前须签字确认)"), - field.Bool("needInspectorSign").Default(false).Comment("是否需要检验员签字(审核通过并签字后放行)"), - field.Bool("needAudit").Default(false).Comment("是否需要审核人复核签字(审核通过后放行)"), - field.String("auditRole").Default("").MaxLen(64).Optional().Comment("审核角色(如班组长/工艺员),具该角色的人员可签"), + field.Bool("needCheck").Default(false).Comment("是否需要工人自检(报工前须勾选确认)"), + field.Bool("needInspectorSign").Default(false).Comment("是否需要检验员签字(检验员签OK后放行)"), // 本步骤图纸/附件(按工序分发到工位终端),多份,存 {name,url} 列表 field.JSON("attachment", []map[string]string{}).Optional().SchemaType(map[string]string{ dialect.Postgres: "jsonb", diff --git a/bj_power_mes/schema/step_sign_record.go b/bj_power_mes/schema/step_sign_record.go index 767000a..6349c2d 100644 --- a/bj_power_mes/schema/step_sign_record.go +++ b/bj_power_mes/schema/step_sign_record.go @@ -10,15 +10,15 @@ import ( "entgo.io/ent/schema/index" ) -// StepSignRecord 步骤签字记录:工艺步骤配置 need_operator_sign/need_inspector_sign 后, -// 操作工报工前签字确认、检验员审核通过并签字,均落此表(按 sn+工位+步骤+角色+轮次 唯一)。 -// 签字是「确认我干了/我检了」的事实动作(含检验员审核结论 result),与审核(通过/驳回)语义不同。 +// StepSignRecord 步骤签字记录:工艺步骤配置 need_inspector_sign 后, +// 工人「报检」呼叫(CALL)落步骤录入快照、检验员审核通过并签字(INSPECTOR),均落此表(按 sn+工位+步骤+角色+轮次 唯一)。 +// 签字是「确认我检了」的事实动作(含检验员审核结论 result),与审核(通过/驳回)语义不同。 type StepSignRecord struct { ent.Schema } func (StepSignRecord) Annotations() []schema.Annotation { - return []schema.Annotation{entsql.Annotation{Table: "step_sign_record"}, entsql.WithComments(true), schema.Comment("StepSignRecord 步骤签字记录:工艺步骤配置 need_operator_sign/need_inspector_sign 后,")} + return []schema.Annotation{entsql.Annotation{Table: "step_sign_record"}, entsql.WithComments(true), schema.Comment("StepSignRecord 步骤签字记录:报检呼叫与检验员签字留痕")} } func (StepSignRecord) Fields() []ent.Field { @@ -30,10 +30,15 @@ func (StepSignRecord) Fields() []ent.Field { field.String("stationNo").Default("").MaxLen(32).Comment("工位号"), field.Int("stepId").Default(0).Comment("工艺步骤ID"), field.String("stepName").Default("").MaxLen(128).Comment("步骤名称"), - // OPERATOR=操作工签字 / INSPECTOR=检验员审核签字 - field.String("signRole").Default("OPERATOR").MaxLen(16).Comment("签字角色 OPERATOR/INSPECTOR"), - // OPERATOR 步骤恒 OK;INSPECTOR 步骤存审核结论 OK/NG(NG 拦流转) + // CALL=工人报检呼叫(步骤快照) / INSPECTOR=检验员审核签字 + field.String("signRole").Default("CALL").MaxLen(16).Comment("签字角色 CALL/INSPECTOR"), + // CALL 步骤恒 OK;INSPECTOR 步骤存审核结论 OK/NG(NG 拦流转) field.String("result").Default("OK").MaxLen(10).Comment("签字时点的结论 OK/NG"), + // 报检呼叫时提交的步骤录入快照(兼容文本/数值,统一存字符串) + field.String("stepValue").Default("").MaxLen(128).Comment("步骤录入值快照"), + field.String("stepText").Default("").MaxLen(255).Comment("步骤录入文本快照"), + field.Bool("stepChecked").Default(false).Comment("步骤自检勾选快照"), + field.Int64("processId").Optional().Comment("采集来源工艺步骤数据ID(可选)"), field.String("signedBy").Default("").MaxLen(64).Comment("签字人(登录账号)"), field.Time("signedAt").Default(time.Now).Comment("签字时间"), field.Int("round").Default(1).Comment("返修重做轮次(1=首做)"), diff --git a/bj_power_mes/tools/plcdiag/main.go b/bj_power_mes/tools/plcdiag/main.go index c4dfb33..ad5662c 100644 --- a/bj_power_mes/tools/plcdiag/main.go +++ b/bj_power_mes/tools/plcdiag/main.go @@ -25,6 +25,8 @@ import ( "bj_power_mes/internal/netutil" "github.com/robinson/gos7" + + "bj_power_mes/common/dockcode" ) func main() { @@ -191,9 +193,9 @@ func printBits(buf []byte) { for i := 1; i <= 15; i++ { fmt.Printf(" C%-2d %s\n", i, mark(rawBit(buf, 11+i))) } - fmt.Println(" 工位接驳台 DOCK01..DOCK20 / 库房接驳台 JBT21:") + fmt.Println(" 工位接驳台 GW1Z..GW10Y(序号1~20)/ 库房接驳台 JBT21:") for i := 1; i <= 20; i++ { - fmt.Printf(" DOCK%02d %s\n", i, mark(rawBit(buf, 39+i))) + fmt.Printf(" %-6s %s\n", dockcode.CodeOfSeq(i), mark(rawBit(buf, 39+i))) } fmt.Printf(" JBT21 %s\n", mark(rawBit(buf, 60))) } diff --git a/bj_power_wms/etc/aitest_wms.yaml b/bj_power_wms/etc/aitest_wms.yaml deleted file mode 100644 index d8e201c..0000000 --- a/bj_power_wms/etc/aitest_wms.yaml +++ /dev/null @@ -1,64 +0,0 @@ -Name: bj_power_wms -Host: 0.0.0.0 -Port: 8890 -Timeout: 10000 -# 请求体上限:go-zero 默认仅 1MB,会拦住照片/PDF/Excel 上传;取各文件类型上限的最大值(50MB) -MaxBytes: 52428800 - -# PostgreSQL -Postgres: - Host: 127.0.0.1 - Port: 5432 - User: postgres - Password: postgres - DBName: bj_power_wms - SSLMode: disable - -# JWT(短有效期 + 滑动续签) -Auth: - AccessSecret: Hardman_2026 - AccessExpire: 3600 - -# 项目间内部 API 写死 token -Internal: - Token: Hardman_2026 - -# MES 服务对接(备料单拉取/状态回写,AGV 配送用) -Mes: - BaseURL: http://127.0.0.1:8888 - Token: Hardman_2026 - -Log: - Mode: file - Path: logs - Level: info - -# 海康 AGV(RCS-2000) 对接:未接真实 RCS 前保持 mock(模拟下发成功/到位) -# 现场对接时填 EnableMock: false + RCS 服务地址 + appKey/appSecret -Agv: - EnableMock: true - BaseURL: "" - AppKey: "" - AppSecret: "" - -# 前端页面托管(原库房客户端 8891 已合并进主服务) -Web: - OpenBrowser: false - -# 命令行敏感操作门禁密码(migrate/reset-all/seed 需输入,独立于后台登录账号密码) -Cli: - AdminPassword: "Hardman_2026" - -# 附件存储(年/月/日/文件类型/uuid.ext,库内只存相对路径,不存绝对路径) -# 生产环境改 RootDir: /data/bj_power/attachments -Attachment: - RootDir: "D:/hardman/bj_power/attachments" - DefaultMaxSize: 20971520 # 默认单文件 20MB - MaxSize: - PROCESS_PDF: 52428800 # 工艺流程作业指导书 50MB - INSPECTION_PHOTO: 20971520 # 检验照片 20MB - EXCEL_IMPORT: 10485760 # Excel 导入 10MB - LocalRetentionYears: 1 # 本地保留最近 1 年 - DiskWarnPercent: 20 # 剩余空间 <20% 告警 - DiskCriticalPercent: 10 # 剩余空间 <10% 提示清理/归档 - DiskCheckHour: 7 # 每天 07:00 检测 diff --git a/bj_power_wms/etc/bj_power_wms-api-verify.yaml b/bj_power_wms/etc/bj_power_wms-api-verify.yaml deleted file mode 100644 index a6f6fc2..0000000 --- a/bj_power_wms/etc/bj_power_wms-api-verify.yaml +++ /dev/null @@ -1,39 +0,0 @@ -Name: bj_power_wms -Host: 0.0.0.0 -Port: 8902 -Timeout: 10000 -MaxBytes: 52428800 - -# PostgreSQL -Postgres: - Host: 127.0.0.1 - Port: 5432 - User: postgres - Password: postgres - DBName: bj_power_wms - SSLMode: disable - -# JWT -Auth: - AccessSecret: Hardman_2026 - AccessExpire: 3600 - -Internal: - Token: Hardman_2026 - -Log: - Mode: console - Level: info - -# 前端页面托管 -Web: - OpenBrowser: false - -# 附件存储(校验环境用临时目录,避免污染开发附件根目录) -Attachment: - RootDir: "D:/hardman/bj_power/attachments_verify" - DefaultMaxSize: 20971520 - LocalRetentionYears: 1 - DiskWarnPercent: 20 - DiskCriticalPercent: 10 - DiskCheckHour: 7 diff --git a/bj_power_wms/etc/test-8899.yaml b/bj_power_wms/etc/test-8899.yaml deleted file mode 100644 index ba5202d..0000000 --- a/bj_power_wms/etc/test-8899.yaml +++ /dev/null @@ -1,64 +0,0 @@ -Name: bj_power_wms -Host: 0.0.0.0 -Port: 8899 -Timeout: 10000 -# 请求体上限:go-zero 默认仅 1MB,会拦住照片/PDF/Excel 上传;取各文件类型上限的最大值(50MB) -MaxBytes: 52428800 - -# PostgreSQL -Postgres: - Host: 127.0.0.1 - Port: 5432 - User: postgres - Password: postgres - DBName: bj_power_wms - SSLMode: disable - -# JWT(短有效期 + 滑动续签) -Auth: - AccessSecret: Hardman_2026 - AccessExpire: 3600 - -# 项目间内部 API 写死 token -Internal: - Token: Hardman_2026 - -# MES 服务对接(备料单拉取/状态回写,AGV 配送用) -Mes: - BaseURL: http://127.0.0.1:8888 - Token: Hardman_2026 - -Log: - Mode: file - Path: logs - Level: info - -# 海康 AGV(RCS-2000) 对接:未接真实 RCS 前保持 mock(模拟下发成功/到位) -# 现场对接时填 EnableMock: false + RCS 服务地址 + appKey/appSecret -Agv: - EnableMock: true - BaseURL: "" - AppKey: "" - AppSecret: "" - -# 前端页面托管(原库房客户端 8891 已合并进主服务) -Web: - OpenBrowser: true - -# 命令行敏感操作门禁密码(migrate/reset-all/seed 需输入,独立于后台登录账号密码) -Cli: - AdminPassword: "Hardman_2026" - -# 附件存储(年/月/日/文件类型/uuid.ext,库内只存相对路径,不存绝对路径) -# 生产环境改 RootDir: /data/bj_power/attachments -Attachment: - RootDir: "D:/hardman/bj_power/attachments" - DefaultMaxSize: 20971520 # 默认单文件 20MB - MaxSize: - PROCESS_PDF: 52428800 # 工艺流程作业指导书 50MB - INSPECTION_PHOTO: 20971520 # 检验照片 20MB - EXCEL_IMPORT: 10485760 # Excel 导入 10MB - LocalRetentionYears: 1 # 本地保留最近 1 年 - DiskWarnPercent: 20 # 剩余空间 <20% 告警 - DiskCriticalPercent: 10 # 剩余空间 <10% 提示清理/归档 - DiskCheckHour: 7 # 每天 07:00 检测 diff --git a/bj_power_wms/frontend/src/components/InboundEntry.vue b/bj_power_wms/frontend/src/components/InboundEntry.vue index f5148a2..6fd0172 100644 --- a/bj_power_wms/frontend/src/components/InboundEntry.vue +++ b/bj_power_wms/frontend/src/components/InboundEntry.vue @@ -4,12 +4,13 @@ // 录入方式(批次数量 vs SN 逐件扫码)由所选物料的「序列号」(sn_mode)决定: // 是(1)=序列号=是(按 SN 记账) → SN 扫码录入;否(2)=序列号=否(按批次记账) → 批次号+数量(2026-09-30 类型与序列号(sn_mode)解耦)。 defineOptions({ name: 'InboundEntry' }) -import { computed, onMounted, reactive, ref, watch } from 'vue' +import { computed, reactive, ref, watch } from 'vue' import { ElMessage, ElMessageBox } from 'element-plus' import axios from 'axios' import request from '../utils/request' import { getRealName, getToken } from '../utils/auth' import MaterialSelect from './MaterialSelect.vue' +import LocationCascade from './LocationCascade.vue' const props = defineProps({ manageMode: { type: Number, required: true } // 1结构件 / 2电气件 / 3其他 @@ -41,21 +42,17 @@ async function checkWorkNo() { /* ---------- 表单 ---------- */ const formRef = ref() +const locRef = ref() const submitting = ref(false) const lastInboundNo = ref('') const form = reactive({ - inboundNo: '', materialCode: '', batchNo: '', quantity: 1, + inboundNo: '', materialCode: '', quantity: 1, zoneCode: '', shelfNo: '', layerNo: '', positionNo: '', ownershipType: '', ownershipNo: '', productWorkNo: '', productionDate: '', supplier: '', remark: '', inspectionNo: '' }) const rules = { materialCode: [{ required: true, message: '请选择物料', trigger: 'change' }], - zoneCode: [{ required: true, message: '请选择入库区域', trigger: 'change' }], - shelfNo: [{ validator: (r, v, cb) => { - if (!form.shelfNo || !form.layerNo || !form.positionNo) cb(new Error('货架/层/位置必填,不允许只填区域不填货架')) - else cb() - }, trigger: 'change' }], inspectionNo: [{ required: true, message: '请填写检测单号', trigger: 'blur' }], ownershipType: [{ required: true, message: '请选择归属类型', trigger: 'change' }], ownershipNo: [{ validator: (r, v, cb) => { if ((form.ownershipType === 'workorder' || form.ownershipType === 'project') && !String(v || '').trim()) cb(new Error('请填写归属编号')); else cb() }, trigger: 'blur' }] @@ -87,42 +84,7 @@ async function uploadStaged(inboundNo) { return okCount } -/* ---------- 区域/库位字典(每个页签独立缓存,展开下拉时强制刷新取最新货位) ---------- */ -const zones = ref([]) -async function loadZones(force = false) { - if (!force && zones.value.length) return - const zs = await request.get('/zone/picker') - zones.value = Array.isArray(zs) ? zs : zs?.list || [] -} -const zoneOptions = computed(() => { - const map = new Map() - zones.value.forEach(z => { - if (!z.zoneCode) return - if (!map.has(z.zoneCode)) map.set(z.zoneCode, { zoneCode: z.zoneCode, zoneName: z.zoneName || '' }) - }) - return [...map.values()] -}) -function zoneShelves(zoneCode) { - const set = new Set() - zones.value.forEach(z => { if (z.zoneCode === zoneCode && z.shelfNo) set.add(z.shelfNo) }) - return [...set].sort() -} -function zoneLayers(zoneCode, shelfNo) { - const set = new Set() - zones.value.forEach(z => { if (z.zoneCode === zoneCode && z.shelfNo === shelfNo && z.layerNo) set.add(z.layerNo) }) - return [...set].sort() -} -function zonePositions(zoneCode, shelfNo, layerNo) { - const set = new Set() - zones.value.forEach(z => { if (z.zoneCode === zoneCode && z.shelfNo === shelfNo && z.layerNo === layerNo && z.positionNo) set.add(z.positionNo) }) - return [...set].sort() -} -function onZoneChange() { - form.shelfNo = ''; form.layerNo = ''; form.positionNo = '' - if (form.materialCode) suggestVacant() -} -function onShelfChange() { form.layerNo = ''; form.positionNo = '' } -function onLayerChange() { form.positionNo = '' } +/* ---------- 末级库位:统一四级联动组件(数据源仅启用的 level=4 节点) ---------- */ function onOwnershipChange() { if (!form.ownershipType) form.ownershipNo = '' } @@ -183,6 +145,7 @@ function removeSn(index) { /* ---------- 提交 ---------- */ async function submit() { + if (!locRef.value?.validate()) return const res = await formRef.value.validate().then(() => null).catch((f) => f) if (res) { const first = Object.values(res || {})[0]?.[0]?.message @@ -203,7 +166,7 @@ async function submit() { } const confirmMsg = isSn.value ? '确认入库:物料 ' + form.materialCode + '|产品序号(SN) ' + snList.value.length + ' 件|区域 ' + form.zoneCode + '?' - : '确认入库:物料 ' + form.materialCode + '|批次 ' + form.batchNo + '|数量 ' + form.quantity + '|区域 ' + form.zoneCode + '?' + : '确认入库:物料 ' + form.materialCode + '|批次由系统自动生成|数量 ' + form.quantity + '|库位 ' + [form.zoneCode, form.shelfNo, form.layerNo, form.positionNo].filter(Boolean).join('/') + '?' try { await ElMessageBox.confirm(confirmMsg, '入库提交确认', { type: 'warning' }) } catch { return } @@ -228,7 +191,6 @@ async function submit() { if (isSn.value) { payload.snList = [...snList.value] } else { - payload.batchNo = form.batchNo.trim() payload.quantity = form.quantity payload.productionDate = form.productionDate payload.supplier = form.supplier.trim() @@ -236,14 +198,14 @@ async function submit() { const data = await request.post('/inbound/create', payload) lastInboundNo.value = data?.inboundNo || '' const qtyText = isSn.value ? `序列号共 ${snList.value.length} 条` : `数量 ${data?.quantity ?? form.quantity}` - ElMessage.success(`入库成功:入库单号 ${lastInboundNo.value},${qtyText}`) + const batchText = data?.batchNo ? `|批次 ${data.batchNo}` : '' + ElMessage.success(`入库成功:入库单号 ${lastInboundNo.value},${qtyText}${batchText}`) const att = await uploadStaged(lastInboundNo.value) if (att) ElMessage.success(`已挂载 ${att} 个附件`) if (isSn.value) { snList.value = [] snInput.value = '' } else { - form.batchNo = '' form.quantity = 1 } emit('submitted') @@ -252,7 +214,6 @@ async function submit() { } } -onMounted(() => loadZones()) - - - - - - -
- - - - - - - - - -
-
选择物料后自动带入该物料最近一次入库库位,可手动修改;货架/层/位置均必填
+ + +
选择物料后自动带入最近一次入库库位,可手动修改;区域/货架/层/位置均必填且须为末级位置
diff --git a/bj_power_wms/frontend/src/components/LocationCascade.vue b/bj_power_wms/frontend/src/components/LocationCascade.vue new file mode 100644 index 0000000..546c0a6 --- /dev/null +++ b/bj_power_wms/frontend/src/components/LocationCascade.vue @@ -0,0 +1,117 @@ + + + diff --git a/bj_power_wms/frontend/src/pages/AlertRule.vue b/bj_power_wms/frontend/src/pages/AlertRule.vue index 5365c22..e88b06f 100644 --- a/bj_power_wms/frontend/src/pages/AlertRule.vue +++ b/bj_power_wms/frontend/src/pages/AlertRule.vue @@ -29,6 +29,11 @@ +
+ +
说明:阈值仅对「来料检超期未检」(超期小时) 与「库龄超档」(超期天) 生效;其余规则阈值不参与判定。
@@ -62,7 +67,7 @@ + diff --git a/bj_power_workstation/frontend/src/help.js b/bj_power_workstation/frontend/src/help.js index c241fbe..f53bbc7 100644 --- a/bj_power_workstation/frontend/src/help.js +++ b/bj_power_workstation/frontend/src/help.js @@ -23,18 +23,19 @@ const scrollPagingSection = { // ── 六个页签 ──────────────────────────────────────────────────── -export const helpWorkstation = S('作业', '本屏回答一句话:这台工件现在轮到我做什么、做完没有。扫入或选中工件 → 按步骤采集 → 报工完成。', [ - '工位一登录,本工位绑定的工艺和步骤就定了,跟有没有扫工件无关;没选工件时步骤区是灰的,先扫 SN 或上料。这就是「当前任务」里先显示流程步骤的原因——步骤属于工位,工件只是还没点名。', - '步骤填完、检测确认勾好、拧紧数据齐了、物料绑齐了,「报工完成」才会亮。按钮下面会直接写清楚还差哪一项。', - '这道工序如果设了要签字,步骤全干完后先点「呼叫签字」,等检验员在巡检端签合格,报工按钮才亮——检验员签完不用刷新页面,5 秒内自动变亮。判了不合格会显示「待整改」,改完再点一次呼叫,检验员重新签。', - '呼叫签字后别再改步骤录入值、检测勾选或拧紧数据:一改本轮签字就作废,得重新呼叫。装配物料绑定不受这条限制——绑定是单独落台账的,有自己的齐套校验。', - '拧紧枪的数据由设备打进对应步骤的输入框,回车录一条;本工位设了「禁止手填」时输入框不让人工输。', +export const helpWorkstation = S('作业', '本屏回答一句话:这台工件现在轮到我做什么、做完没有。扫入或选中工件 → 按步骤采集并自检 → 需要时报检 → 确认后报工完成。', [ + '工位一登录,本工位绑定的工艺和步骤就定了,跟有没有扫工件无关;没扫工件时步骤照常显示、只是不能操作,先扫 SN 或等工件流转到位。这就是「当前任务」里先显示流程步骤的原因——步骤属于工位,工件只是还没点名。', + '需要自检的步骤勾「本步已自检合格(不勾不能报工)」;步骤填完、自检勾好、拧紧数据齐了、物料绑齐了,「报工完成」才会亮。按钮下面会直接写清楚还差哪一项。', + '这道工序如果设了要检验,步骤全干完后点「报检」,等检验员在巡检端签合格,报工按钮才亮——检验员签完不用刷新页面,5 秒内自动变亮。判了不合格会显示「待整改」并列出 NG 意见和签字时间,按意见整改后再点「整改后重新报检」。', + '报检后别再改步骤录入值、自检勾选或拧紧数据:一改本轮签字就作废,得重新报检。装配物料绑定不受这条限制——绑定是单独落台账的,有自己的齐套校验。', + '拧紧枪的数据由设备上报到对应步骤,回车录一条;本工位设了「禁止手填」时输入框不让人工输。', + '点「报工完成」会先弹引导确认:本轮哪些步骤自检合格、检验员逐项签字明细、NG 意见都在里面;确认后才提交报工,完工(DONE)留痕同步写入,不再需要单独做完工确认。', '报工成功后工件从当前工位清掉,系统按工单路线自动推进它的物理位置,下一道工艺由下一位工人接着做;扫码即到位凭证,不需要另外下发移料指令。' ], [ '网络断了就直接失败并提示,不会排队、也不会联网后自动补传——看到失败就当场重做一次,不要以为系统稍后会自己发。', '拧紧出现 NG 会拦住后续报工,要先处置,不能跳过。', '「暂存退库」是暂时下线、以后还能重新上线;「报废/取走」是永久退出产线、不可恢复。两者别点反。', - '报工、完工一旦提交就收不回来,错了要由计划员在后台收口,不是在这里撤销。' + '报工一旦提交,连同完工留痕都收不回来,错了要由计划员在后台收口,不是在这里撤销。' ], [ { t: '功能定位', text: '工人一上班就看这一屏:我是哪个工位、当前这台工件做到哪一步、还差什么才能报工。工艺文件、物料、巡检都是它的旁支。' }, { t: '什么会触发一次校验', items: [ @@ -59,6 +60,7 @@ export const helpPdf = S('工艺文件', '看这一步的图纸和作业指导 export const helpOnline = S('上线', '扫 SN 自动认工单、自动判断该走哪一步;不用选流程,确认实物和位置就行。', [ '这一页只做四件事:首次上线、暂存后回线、虚拟位做完送入产线、已在产线时提醒去作业。扫 SN 后页面自己判是哪种,工人不单选、也不用选工单。', + '扫出工单后上方会出现横向工艺路线,像地铁站一样按工艺顺序排:绿色 ✓ 是已完成,蓝色是当前这道,灰色是后面还没开始;每一站写清工艺名、工位号和实体/虚拟,虚拟站用橙色标出。「送入产线」的提示也按这条路线告诉你上一道、这一道和后面还有几道。', '首次上线:新件扫 SN 认出工单和首道工艺。首道是实体工位时选上料位置(默认 C1),提交=建档+台账占位+PLC 送到首道工位;首道是虚拟位时不用选上料位置,提交只建档、不发 PLC,到虚拟工位扫码作业。', '回线建档:件在半成品库,扫 SN 后提示回线。确认上料位置后提交,系统先从库房出库,再送到下一道工艺工位。', '送入产线:件已经在制、刚从虚拟位做完,台账里没有点位。把实物放到上料位置后提交,系统只占位并发 PLC 到下一道实体工位,不再出入半成品库。', @@ -96,13 +98,14 @@ export const helpOnline = S('上线', '扫 SN 自动认工单、自动判断该 scrollPagingSection ]) -export const helpMaterial = S('物料 / 叫料', '本工位只在这里看账、叫料、退料和流水;叫料数量默认拉满待叫、直接在主表填,叫料日和期望接驳台也在主表,填完就提交,不需要再过第二个弹窗;派车由库管负责。', [ +export const helpMaterial = S('物料 / 叫料', '本工位只在这里看账、叫料、退料和流水;叫料数量默认拉满待叫、直接在主表填,叫料日和左/右接驳台也在主表,填完就提交,不需要再过第二个弹窗;派车由库管负责。', [ '主表七列一起看:可用是已到货未装未退的实物,=已收−已装−已退;待叫是账上还能叫的额度;需求是排产分到这道工艺要料的总量(含调整);已发是库房累计出库,已收是 AGV 送到工位接驳台的累计,已装是装到工件的数量,已退是实际退回库房的累计。借料工位按借出方记额度账、借入方记实物账,借入方在途可能为负,这是两套账并存的表现,不是算错。', '待备料的叫料单可以「取消」,取消会把占用释放掉。', '本工位一点余量都没有时才会出现「去借料」小窗;借的是同工艺兄弟工位的份额,在弹窗里手动分配借出工位和数量,系统不自动扣,总量不增加,属于零和转移。', - '主表底部会直接提示今天排产还有没叫完的量、跨日未叫量;这两条只是提醒,实时算、不落库,也不拦提交。', + '主表底部会直接提示今天排产还有没叫完的量、跨日未叫量;这两条只是提醒,实时算、不落库,也不拦提交。标题后的灰色小字是本工位当前在产工单(带数量的会写明数量),鼠标停上去看全量。', '补料(额度调增、需主管审批)和数量不符上报不在这里发起:补料由班组长 / 计划员在 MES 代提,或由 WMS 库管代提交申请;数量不符在「巡检 / 异常」页上报。', - '已经绑上的标签点 × 可以撤销重绑。退料要选从左还是右接驳台退回。', + '已经绑上的标签点 × 可以撤销重绑。叫料必须点「左」或「右」选定期望接驳台,再点已选的按钮不会取消;退料和托盘回库的下拉同样只列「左」「右」且必须选。没有接驳台配置时提交按钮禁用并提示联系管理员,不会再交给仓库临时定台。', + '叫料/配送流水的「叫料物料」列和退料流水的「退料物料」列按「名称(图号)×数量」写,多种物料用「、」分隔;长文本会换行,鼠标停上去看全量,不另加工单号列。', '叫料/配送流水里:「已完成」是物料已签收、本单闭环,可以正常投产;剩余料走本页「申请退料」或退出时的引导退料,不能在这张单上直接退。「退库中」是等待仓库收回,收回后已发额度才回补;「已退库」是仓库已收货、额度已回补,这份额度可以重新叫料。', '一次申请退料可以填多行,提交后生成一个退料包,包内每行各一张退库单;退料流水里的「退料包号」列可以把它们串起来看。每行填 0 表示本次不退。', '「托盘回库」和「退料」是两个不同的按钮:回库是物理拉回空托盘、账不变,退料是盘上还有余料要回库房,看清楚再点。' @@ -122,7 +125,7 @@ export const helpMaterial = S('物料 / 叫料', '本工位只在这里看账、 export const helpInspect = S('巡检 / 异常', '处理工位上的过程记录和异常上报;页签上的小红点就是「有几条等你处理」。', [ '小红点只提示待处理数量,不是设备故障报警;点进来按待办逐条收口,处理完自然消失。', - '步骤没做完或物料没齐套时,「完工确认」按钮是禁用的。', + '完工确认已经并入作业页的「报工完成」:步骤没做完、自检没勾或物料没齐套时报工按钮禁用,通过后弹窗确认即同时写入完工留痕;本页不再有独立的完工确认入口。', '实收与应发不一致走「数量不符上报」,由 MES 生成差异单,仓管 / 班组长在「收料差异登记」里派单处置(补发 / 退库 / 调整关闭),本页不做审批。', '退料不在本页发起:余料退库、拒收退库、接驳台有托盘都统一到「物料 / 叫料」页处理,流水也都在那一页看。', '应急呼叫只是通知,不会让设备自己恢复。' diff --git a/bj_power_workstation/frontend/src/store/station.js b/bj_power_workstation/frontend/src/store/station.js index e186a12..15dc81f 100644 --- a/bj_power_workstation/frontend/src/store/station.js +++ b/bj_power_workstation/frontend/src/store/station.js @@ -237,13 +237,10 @@ export const myPoint = computed(() => state.points.find((p) => p.pointType === 'STATION' && String(p.pointNo) === String(state.stationNo)) ) export const myPointSn = computed(() => (myPoint.value?.occupied ? myPoint.value.currentSn : '')) -// 本工位接驳台(AGV 点位,工位 1~10 各 左L/右R) -export const myDocks = computed(() => - state.points.filter((p) => p.pointType === 'DOCK' && Number(p.stationNo) === Number(state.stationNo)) -) // 传送带主线点位(主线停靠位/缓存位/工位/末端),按 seq 排序 +// 接驳台是 AGV 点位(dock 表维护),不在点位台账里,不会出现在本列表。 export const beltPoints = computed(() => - [...state.points].filter((p) => p.pointType !== 'DOCK').sort((a, b) => (a.seq || 0) - (b.seq || 0)) + [...state.points].sort((a, b) => (a.seq || 0) - (b.seq || 0)) ) export const pointByNo = (no) => state.points.find((p) => p.pointNo === no) diff --git a/bj_power_workstation/frontend/src/views/Main.vue b/bj_power_workstation/frontend/src/views/Main.vue index 20ef202..01984d3 100644 --- a/bj_power_workstation/frontend/src/views/Main.vue +++ b/bj_power_workstation/frontend/src/views/Main.vue @@ -93,30 +93,42 @@ - - + + + title="系统已按实物账带出本工位各工单的领用、实际装机、已退和实物剩余;建议退库量可改。实际退回少于建议基数的差额就是真实损耗,必须填原因。选 AGV 时只建退料单,工人把料放上接驳台后由库管确认并派车;提交后即可退出,库管收货+托盘拉走后班次自动结班。" /> - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + - + - - - @@ -147,8 +156,13 @@ +
- 添加一行 + + + + 物料清单里的行都已添加