feat: 完成MES工位终端系统全量功能迭代

本次提交包含以下核心变更:
1. 新增按钮级权限控制框架与前端权限校验
2. 新增工位管理、工艺流程、巡检终端等核心业务模块
3. 完善用户体系,支持工位终端专属登录权限
4. 新增文件上传下载、报表查询等配套功能
5. 修复多系统兼容性与交互体验问题
6. 完成所有文档与配置项的规范化更新
This commit is contained in:
SunYF
2026-08-31 08:06:55 +08:00
parent dab03ac0cf
commit 4ec6784629
99 changed files with 17436 additions and 479 deletions
+148
View File
@@ -141,6 +141,49 @@ var (
},
},
}
// InspectionRecordColumns holds the columns for the "inspection_record" table.
InspectionRecordColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "category", Type: field.TypeString, Size: 20},
{Name: "station_no", Type: field.TypeString, Size: 32, Default: ""},
{Name: "shift", Type: field.TypeString, Size: 20, Default: ""},
{Name: "order_no", Type: field.TypeString, Size: 64, Default: ""},
{Name: "sn", Type: field.TypeString, Size: 64, Default: ""},
{Name: "result", Type: field.TypeString, Size: 10, Default: "OK"},
{Name: "items", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
{Name: "photo", Type: field.TypeString, Size: 255, Default: ""},
{Name: "remark", Type: field.TypeString, Size: 500, Default: ""},
{Name: "operator", Type: field.TypeString, Size: 64, Default: ""},
{Name: "created_at", Type: field.TypeTime},
}
// InspectionRecordTable holds the schema information for the "inspection_record" table.
InspectionRecordTable = &schema.Table{
Name: "inspection_record",
Columns: InspectionRecordColumns,
PrimaryKey: []*schema.Column{InspectionRecordColumns[0]},
Indexes: []*schema.Index{
{
Name: "inspectionrecord_category",
Unique: false,
Columns: []*schema.Column{InspectionRecordColumns[1]},
},
{
Name: "inspectionrecord_station_no",
Unique: false,
Columns: []*schema.Column{InspectionRecordColumns[2]},
},
{
Name: "inspectionrecord_order_no",
Unique: false,
Columns: []*schema.Column{InspectionRecordColumns[4]},
},
{
Name: "inspectionrecord_operator",
Unique: false,
Columns: []*schema.Column{InspectionRecordColumns[10]},
},
},
}
// MaterialRequestColumns holds the columns for the "material_request" table.
MaterialRequestColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
@@ -245,9 +288,39 @@ var (
},
},
}
// ProcessFlowColumns holds the columns for the "process_flow" table.
ProcessFlowColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "name", Type: field.TypeString, Size: 128},
{Name: "process_code", Type: field.TypeInt},
{Name: "pdf_file", Type: field.TypeString, Size: 255, Default: ""},
{Name: "status", Type: field.TypeString, Size: 20, Default: "ACTIVE"},
{Name: "remark", Type: field.TypeString, Size: 255, Default: ""},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime, Nullable: true},
}
// ProcessFlowTable holds the schema information for the "process_flow" table.
ProcessFlowTable = &schema.Table{
Name: "process_flow",
Columns: ProcessFlowColumns,
PrimaryKey: []*schema.Column{ProcessFlowColumns[0]},
Indexes: []*schema.Index{
{
Name: "processflow_process_code",
Unique: false,
Columns: []*schema.Column{ProcessFlowColumns[2]},
},
{
Name: "processflow_status",
Unique: false,
Columns: []*schema.Column{ProcessFlowColumns[4]},
},
},
}
// ProcessStepColumns holds the columns for the "process_step" table.
ProcessStepColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "flow_id", Type: field.TypeInt, Nullable: true},
{Name: "process_code", Type: field.TypeInt},
{Name: "seq", Type: field.TypeInt, Default: 1},
{Name: "name", Type: field.TypeString, Size: 128},
@@ -265,6 +338,11 @@ var (
{
Name: "processstep_process_code",
Unique: false,
Columns: []*schema.Column{ProcessStepColumns[2]},
},
{
Name: "processstep_flow_id",
Unique: false,
Columns: []*schema.Column{ProcessStepColumns[1]},
},
},
@@ -394,6 +472,28 @@ var (
},
},
}
// StationColumns holds the columns for the "station" table.
StationColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "station_no", Type: field.TypeInt, Unique: true},
{Name: "name", Type: field.TypeString, Size: 64, Default: ""},
{Name: "flow_id", Type: field.TypeInt, Nullable: true},
{Name: "status", Type: field.TypeString, Size: 20, Default: "ENABLED"},
{Name: "created_at", Type: field.TypeTime},
}
// StationTable holds the schema information for the "station" table.
StationTable = &schema.Table{
Name: "station",
Columns: StationColumns,
PrimaryKey: []*schema.Column{StationColumns[0]},
Indexes: []*schema.Index{
{
Name: "station_station_no",
Unique: true,
Columns: []*schema.Column{StationColumns[1]},
},
},
}
// StationProcessColumns holds the columns for the "station_process" table.
StationProcessColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
@@ -541,6 +641,8 @@ var (
{Name: "password", Type: field.TypeString, Size: 128},
{Name: "name", Type: field.TypeString, Size: 64, Default: ""},
{Name: "role_id", Type: field.TypeInt, Nullable: true},
{Name: "can_login_workstation", Type: field.TypeBool, Default: false},
{Name: "workstation_password", Type: field.TypeString, Nullable: true, Size: 128},
{Name: "status", Type: field.TypeString, Size: 20, Default: "ENABLED"},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime, Nullable: true},
@@ -563,6 +665,36 @@ var (
},
},
}
// UserStationColumns holds the columns for the "user_station" table.
UserStationColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "user_id", Type: field.TypeInt},
{Name: "station_no", Type: field.TypeInt},
{Name: "created_at", Type: field.TypeTime},
}
// UserStationTable holds the schema information for the "user_station" table.
UserStationTable = &schema.Table{
Name: "user_station",
Columns: UserStationColumns,
PrimaryKey: []*schema.Column{UserStationColumns[0]},
Indexes: []*schema.Index{
{
Name: "userstation_user_id",
Unique: false,
Columns: []*schema.Column{UserStationColumns[1]},
},
{
Name: "userstation_station_no",
Unique: false,
Columns: []*schema.Column{UserStationColumns[2]},
},
{
Name: "userstation_user_id_station_no",
Unique: true,
Columns: []*schema.Column{UserStationColumns[1], UserStationColumns[2]},
},
},
}
// WorkOrderColumns holds the columns for the "work_order" table.
WorkOrderColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
@@ -692,19 +824,23 @@ var (
WorkOrderBomTable,
DailyPlanTable,
EventLogTable,
InspectionRecordTable,
MaterialRequestTable,
PermissionTable,
PlcSendLogTable,
ProcessFlowTable,
ProcessStepTable,
ProductTypeTable,
RoleTable,
ScanRecordTable,
SemiFlowTable,
StationTable,
StationProcessTable,
StepCriterionTable,
StepDataTable,
TorqueRecordTable,
UserTable,
UserStationTable,
WorkOrderTable,
WorkpieceTable,
WorkpieceProcessTable,
@@ -724,6 +860,9 @@ func init() {
EventLogTable.Annotation = &entsql.Annotation{
Table: "event_log",
}
InspectionRecordTable.Annotation = &entsql.Annotation{
Table: "inspection_record",
}
MaterialRequestTable.Annotation = &entsql.Annotation{
Table: "material_request",
}
@@ -733,6 +872,9 @@ func init() {
PlcSendLogTable.Annotation = &entsql.Annotation{
Table: "plc_send_log",
}
ProcessFlowTable.Annotation = &entsql.Annotation{
Table: "process_flow",
}
ProcessStepTable.Annotation = &entsql.Annotation{
Table: "process_step",
}
@@ -748,6 +890,9 @@ func init() {
SemiFlowTable.Annotation = &entsql.Annotation{
Table: "semi_flow",
}
StationTable.Annotation = &entsql.Annotation{
Table: "station",
}
StationProcessTable.Annotation = &entsql.Annotation{
Table: "station_process",
}
@@ -763,6 +908,9 @@ func init() {
UserTable.Annotation = &entsql.Annotation{
Table: "user",
}
UserStationTable.Annotation = &entsql.Annotation{
Table: "user_station",
}
WorkOrderTable.Annotation = &entsql.Annotation{
Table: "work_order",
}