feat: 完成产线与仓储系统多模块迭代升级

本次迭代覆盖MES与WMS核心业务:
1. 新增接驳台托盘传感器读取与AGV对接能力
2. 完善工单排产、备料流程与权限体系拆分
3. 优化看板接口与前端路由、样式
4. 新增操作日志、库存盘点与角色保护逻辑
5. 修复代理地址、BOM保存等已知问题
This commit is contained in:
SunYF
2026-09-04 14:18:53 +08:00
parent c1fc6d32b2
commit b6799c9de4
138 changed files with 20613 additions and 2220 deletions
+114
View File
@@ -9,6 +9,114 @@ import (
)
var (
// AgvTasksColumns holds the columns for the "agv_tasks" table.
AgvTasksColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "task_no", Type: field.TypeString, Unique: true, Size: 64},
{Name: "hik_task_code", Type: field.TypeString, Size: 64, Default: ""},
{Name: "source_dock", Type: field.TypeString, Size: 20, Default: ""},
{Name: "target_dock", Type: field.TypeString, Size: 20, Default: ""},
{Name: "materials_json", Type: field.TypeString, Size: 4000, Default: ""},
{Name: "related_outbound_no", Type: field.TypeString, Nullable: true, Size: 64, Default: ""},
{Name: "status", Type: field.TypeString, Size: 20, Default: "PENDING"},
{Name: "operator", Type: field.TypeString, Size: 64, Default: ""},
{Name: "dispatched_at", Type: field.TypeInt64, Default: 0},
{Name: "arrived_at", Type: field.TypeInt64, Default: 0},
{Name: "remark", Type: field.TypeString, Nullable: true, Size: 500, Default: ""},
{Name: "created_at", Type: field.TypeInt64},
}
// AgvTasksTable holds the schema information for the "agv_tasks" table.
AgvTasksTable = &schema.Table{
Name: "agv_tasks",
Columns: AgvTasksColumns,
PrimaryKey: []*schema.Column{AgvTasksColumns[0]},
Indexes: []*schema.Index{
{
Name: "agvtask_task_no",
Unique: true,
Columns: []*schema.Column{AgvTasksColumns[1]},
},
{
Name: "agvtask_target_dock",
Unique: false,
Columns: []*schema.Column{AgvTasksColumns[4]},
},
{
Name: "agvtask_status",
Unique: false,
Columns: []*schema.Column{AgvTasksColumns[7]},
},
{
Name: "agvtask_hik_task_code",
Unique: false,
Columns: []*schema.Column{AgvTasksColumns[2]},
},
},
}
// DocksColumns holds the columns for the "docks" table.
DocksColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "dock_code", Type: field.TypeString, Unique: true, Size: 20},
{Name: "name", Type: field.TypeString, Size: 64, Default: ""},
{Name: "dock_type", Type: field.TypeString, Size: 16, Default: "line"},
{Name: "station_no", Type: field.TypeInt, Default: 0},
{Name: "has_pallet", Type: field.TypeBool, Default: false},
{Name: "pallet_ref", Type: field.TypeString, Nullable: true, Size: 64, Default: ""},
{Name: "status", Type: field.TypeString, Size: 20, Default: "ENABLED"},
{Name: "created_at", Type: field.TypeInt64},
}
// DocksTable holds the schema information for the "docks" table.
DocksTable = &schema.Table{
Name: "docks",
Columns: DocksColumns,
PrimaryKey: []*schema.Column{DocksColumns[0]},
Indexes: []*schema.Index{
{
Name: "dock_dock_code",
Unique: true,
Columns: []*schema.Column{DocksColumns[1]},
},
{
Name: "dock_dock_type",
Unique: false,
Columns: []*schema.Column{DocksColumns[3]},
},
},
}
// EventLogColumns holds the columns for the "event_log" table.
EventLogColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "event_type", Type: field.TypeString, Size: 64},
{Name: "operator", Type: field.TypeString, Size: 64, Default: ""},
{Name: "entity_type", Type: field.TypeString, Size: 32, Default: ""},
{Name: "entity_id", Type: field.TypeString, Size: 64, Default: ""},
{Name: "description", Type: field.TypeString, Size: 2147483647, Default: ""},
{Name: "payload", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
{Name: "created_at", Type: field.TypeInt64},
}
// EventLogTable holds the schema information for the "event_log" table.
EventLogTable = &schema.Table{
Name: "event_log",
Columns: EventLogColumns,
PrimaryKey: []*schema.Column{EventLogColumns[0]},
Indexes: []*schema.Index{
{
Name: "eventlog_event_type",
Unique: false,
Columns: []*schema.Column{EventLogColumns[1]},
},
{
Name: "eventlog_operator",
Unique: false,
Columns: []*schema.Column{EventLogColumns[2]},
},
{
Name: "eventlog_created_at",
Unique: false,
Columns: []*schema.Column{EventLogColumns[7]},
},
},
}
// InboundDetailsColumns holds the columns for the "inbound_details" table.
InboundDetailsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
@@ -546,6 +654,9 @@ var (
}
// Tables holds all the tables in the schema.
Tables = []*schema.Table{
AgvTasksTable,
DocksTable,
EventLogTable,
InboundDetailsTable,
InboundOrdersTable,
InspectionRecordsTable,
@@ -566,6 +677,9 @@ var (
)
func init() {
EventLogTable.Annotation = &entsql.Annotation{
Table: "event_log",
}
PermissionsTable.Annotation = &entsql.Annotation{
Table: "permissions",
}