feat: 两库对等物料管理及产品工号贯通全流程

- 新增 MES 本地物料表及双向同步接口,WMS 物料变更自动同步
- 全流程新增产品工号字段,贯通入库/库存/出库/检验环节
- 工单管理支持多工单混产,移除单工单互斥限制
- 新增批次号/SN 字段支持质量检验联动 WMS 库存处置
- 修复权限规则,仅内置管理员账号不允许修改删除
- 工位终端新增 SN 扫码自动切换所属工单功能
This commit is contained in:
SunYF
2026-09-29 14:55:03 +08:00
parent a229b6727a
commit 76c9b6a7e2
103 changed files with 9412 additions and 1726 deletions
+40
View File
@@ -309,6 +309,7 @@ var (
{Name: "attachment_ids", Type: field.TypeString, Size: 512, Default: ""},
{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: "created_at", Type: field.TypeTime},
}
// InspectionRecordTable holds the schema information for the "inspection_record" table.
@@ -365,6 +366,41 @@ var (
},
},
}
// MaterialsColumns holds the columns for the "materials" table.
MaterialsColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "code", Type: field.TypeString, Unique: true, Size: 64},
{Name: "name", Type: field.TypeString, Size: 128},
{Name: "spec", Type: field.TypeString, Size: 128, Default: ""},
{Name: "unit", Type: field.TypeString, Size: 32, Default: ""},
{Name: "description", Type: field.TypeString, Size: 255, Default: ""},
{Name: "item_type", Type: field.TypeInt, Default: 1},
{Name: "manage_mode", Type: field.TypeInt, Default: 1},
{Name: "template_code", Type: field.TypeString, Size: 64, Default: ""},
{Name: "safety_stock", Type: field.TypeInt, Default: 0},
{Name: "is_active", Type: field.TypeBool, Default: true},
{Name: "sync_pending", Type: field.TypeBool, Default: false},
{Name: "created_at", Type: field.TypeTime},
{Name: "updated_at", Type: field.TypeTime},
}
// MaterialsTable holds the schema information for the "materials" table.
MaterialsTable = &schema.Table{
Name: "materials",
Columns: MaterialsColumns,
PrimaryKey: []*schema.Column{MaterialsColumns[0]},
Indexes: []*schema.Index{
{
Name: "material_code",
Unique: true,
Columns: []*schema.Column{MaterialsColumns[1]},
},
{
Name: "material_item_type",
Unique: false,
Columns: []*schema.Column{MaterialsColumns[6]},
},
},
}
// MaterialQtyReportColumns holds the columns for the "material_qty_report" table.
MaterialQtyReportColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
@@ -1135,6 +1171,7 @@ var (
FlowMaterialTable,
InspectionRecordTable,
LinePointTable,
MaterialsTable,
MaterialQtyReportTable,
MaterialRequestTable,
PermissionTable,
@@ -1191,6 +1228,9 @@ func init() {
LinePointTable.Annotation = &entsql.Annotation{
Table: "line_point",
}
MaterialsTable.Annotation = &entsql.Annotation{
Table: "materials",
}
MaterialQtyReportTable.Annotation = &entsql.Annotation{
Table: "material_qty_report",
}