feat: 新增工序签字功能,移除移料指令模块

新增操作工/检验员工序签字功能,支持工艺步骤配置签字要求;删除移料指令相关代码,将移料页签重命名为产线点位(上料/下料);新增成品入库功能及相关权限;优化备料单状态、质量状态逻辑,新增批次序号字段;修复AGV取消后备料单回退状态问题。
This commit is contained in:
SunYF
2026-10-05 20:15:38 +08:00
parent c33acab9c8
commit f1cf57e9b2
181 changed files with 9785 additions and 9699 deletions
+54 -78
View File
@@ -310,6 +310,8 @@ var (
{Name: "disposal_type", Type: field.TypeString, Size: 20, Default: ""},
{Name: "disposal_remark", Type: field.TypeString, Size: 500, Default: ""},
{Name: "batch_sn", Type: field.TypeString, Nullable: true, Size: 128},
{Name: "related_standard", Type: field.TypeString, Nullable: true, Size: 255},
{Name: "test_record_no", Type: field.TypeString, Nullable: true, Size: 128},
{Name: "created_at", Type: field.TypeTime},
}
// InspectionRecordTable holds the schema information for the "inspection_record" table.
@@ -530,43 +532,6 @@ var (
},
},
}
// PlcMoveCmdColumns holds the columns for the "plc_move_cmd" table.
PlcMoveCmdColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "cmd_no", Type: field.TypeString, Size: 64},
{Name: "sn", Type: field.TypeString, Size: 128},
{Name: "order_no", Type: field.TypeString, Size: 64, Default: ""},
{Name: "from_point", Type: field.TypeString, Size: 32},
{Name: "to_point", Type: field.TypeString, Size: 32},
{Name: "status", Type: field.TypeString, Size: 20, Default: "ISSUED"},
{Name: "operator", Type: field.TypeString, Size: 64, Default: ""},
{Name: "message", Type: field.TypeString, Size: 255, Default: ""},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime},
}
// PlcMoveCmdTable holds the schema information for the "plc_move_cmd" table.
PlcMoveCmdTable = &schema.Table{
Name: "plc_move_cmd",
Columns: PlcMoveCmdColumns,
PrimaryKey: []*schema.Column{PlcMoveCmdColumns[0]},
Indexes: []*schema.Index{
{
Name: "plcmovecmd_cmd_no",
Unique: true,
Columns: []*schema.Column{PlcMoveCmdColumns[1]},
},
{
Name: "plcmovecmd_sn",
Unique: false,
Columns: []*schema.Column{PlcMoveCmdColumns[2]},
},
{
Name: "plcmovecmd_status",
Unique: false,
Columns: []*schema.Column{PlcMoveCmdColumns[6]},
},
},
}
// PlcSendLogColumns holds the columns for the "plc_send_log" table.
PlcSendLogColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
@@ -638,6 +603,8 @@ var (
{Name: "collect_type", Type: field.TypeString, Size: 20, Default: "NONE"},
{Name: "is_torque", Type: field.TypeBool, Default: false},
{Name: "need_check", Type: field.TypeBool, Default: false},
{Name: "need_operator_sign", Type: field.TypeBool, Default: false},
{Name: "need_inspector_sign", Type: field.TypeBool, Default: false},
{Name: "attachment", Type: field.TypeJSON, Nullable: true, SchemaType: map[string]string{"postgres": "jsonb"}},
{Name: "remark", Type: field.TypeString, Size: 255, Default: ""},
{Name: "created_at", Type: field.TypeTime},
@@ -827,6 +794,51 @@ var (
},
},
}
// StepSignRecordColumns holds the columns for the "step_sign_record" table.
StepSignRecordColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "sn", Type: field.TypeString, Size: 64, Default: ""},
{Name: "order_no", Type: field.TypeString, Size: 64, Default: ""},
{Name: "flow_id", Type: field.TypeInt, Default: 0},
{Name: "station_no", Type: field.TypeString, Size: 32, Default: ""},
{Name: "step_id", Type: field.TypeInt, Default: 0},
{Name: "step_name", Type: field.TypeString, Size: 128, Default: ""},
{Name: "sign_role", Type: field.TypeString, Size: 16, Default: "OPERATOR"},
{Name: "result", Type: field.TypeString, Size: 10, Default: "OK"},
{Name: "signed_by", Type: field.TypeString, Size: 64, Default: ""},
{Name: "signed_at", Type: field.TypeTime},
{Name: "round", Type: field.TypeInt, Default: 1},
{Name: "source", Type: field.TypeString, Size: 20, Default: "station"},
{Name: "remark", Type: field.TypeString, Size: 256, Default: ""},
{Name: "revoked", Type: field.TypeBool, Default: false},
{Name: "revoked_by", Type: field.TypeString, Size: 64, Default: ""},
{Name: "revoked_at", Type: field.TypeTime, Nullable: true},
{Name: "revoke_reason", Type: field.TypeString, Size: 256, Default: ""},
{Name: "created_at", Type: field.TypeTime},
}
// StepSignRecordTable holds the schema information for the "step_sign_record" table.
StepSignRecordTable = &schema.Table{
Name: "step_sign_record",
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]},
},
{
Name: "stepsignrecord_sn",
Unique: false,
Columns: []*schema.Column{StepSignRecordColumns[1]},
},
{
Name: "stepsignrecord_order_no",
Unique: false,
Columns: []*schema.Column{StepSignRecordColumns[2]},
},
},
}
// SysConfigColumns holds the columns for the "sys_config" table.
SysConfigColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
@@ -840,36 +852,6 @@ var (
Columns: SysConfigColumns,
PrimaryKey: []*schema.Column{SysConfigColumns[0]},
}
// TorqueAuditLogColumns holds the columns for the "torque_audit_log" table.
TorqueAuditLogColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "torque_record_id", Type: field.TypeInt},
{Name: "action", Type: field.TypeString, Size: 20},
{Name: "field_name", Type: field.TypeString, Size: 40, Default: ""},
{Name: "old_val", Type: field.TypeString, Size: 255, Default: ""},
{Name: "new_val", Type: field.TypeString, Size: 255, Default: ""},
{Name: "operator", Type: field.TypeString, Size: 64},
{Name: "remark", Type: field.TypeString, Size: 255, Default: ""},
{Name: "created_at", Type: field.TypeTime},
}
// TorqueAuditLogTable holds the schema information for the "torque_audit_log" table.
TorqueAuditLogTable = &schema.Table{
Name: "torque_audit_log",
Columns: TorqueAuditLogColumns,
PrimaryKey: []*schema.Column{TorqueAuditLogColumns[0]},
Indexes: []*schema.Index{
{
Name: "torqueauditlog_torque_record_id",
Unique: false,
Columns: []*schema.Column{TorqueAuditLogColumns[1]},
},
{
Name: "torqueauditlog_created_at",
Unique: false,
Columns: []*schema.Column{TorqueAuditLogColumns[8]},
},
},
}
// TorqueRecordColumns holds the columns for the "torque_record" table.
TorqueRecordColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
@@ -883,8 +865,6 @@ var (
{Name: "operator", Type: field.TypeString, Size: 64, Default: ""},
{Name: "station_no", Type: field.TypeString, Size: 32, Default: ""},
{Name: "time", Type: field.TypeTime},
{Name: "audit_by", Type: field.TypeString, Size: 64, Default: ""},
{Name: "audit_at", Type: field.TypeTime, Nullable: true},
{Name: "created_at", Type: field.TypeTime},
}
// TorqueRecordTable holds the schema information for the "torque_record" table.
@@ -906,7 +886,7 @@ var (
{
Name: "torquerecord_created_at",
Unique: false,
Columns: []*schema.Column{TorqueRecordColumns[13]},
Columns: []*schema.Column{TorqueRecordColumns[11]},
},
{
Name: "torquerecord_time",
@@ -1177,7 +1157,6 @@ var (
MaterialQtyReportTable,
MaterialRequestTable,
PermissionTable,
PlcMoveCmdTable,
PlcSendLogTable,
ProcessFlowTable,
ProcessStepTable,
@@ -1187,8 +1166,8 @@ var (
StationStateTable,
StepCriterionTable,
StepDataTable,
StepSignRecordTable,
SysConfigTable,
TorqueAuditLogTable,
TorqueRecordTable,
UserTable,
UserStationTable,
@@ -1242,9 +1221,6 @@ func init() {
PermissionTable.Annotation = &entsql.Annotation{
Table: "permission",
}
PlcMoveCmdTable.Annotation = &entsql.Annotation{
Table: "plc_move_cmd",
}
PlcSendLogTable.Annotation = &entsql.Annotation{
Table: "plc_send_log",
}
@@ -1272,12 +1248,12 @@ func init() {
StepDataTable.Annotation = &entsql.Annotation{
Table: "step_data",
}
StepSignRecordTable.Annotation = &entsql.Annotation{
Table: "step_sign_record",
}
SysConfigTable.Annotation = &entsql.Annotation{
Table: "sys_config",
}
TorqueAuditLogTable.Annotation = &entsql.Annotation{
Table: "torque_audit_log",
}
TorqueRecordTable.Annotation = &entsql.Annotation{
Table: "torque_record",
}