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
@@ -23,6 +23,8 @@ const (
FieldOwnershipType = "ownership_type"
// FieldOwnershipNo holds the string denoting the ownership_no field in the database.
FieldOwnershipNo = "ownership_no"
// FieldProductWorkNo holds the string denoting the product_work_no field in the database.
FieldProductWorkNo = "product_work_no"
// FieldRelatedStandard holds the string denoting the related_standard field in the database.
FieldRelatedStandard = "related_standard"
// FieldManufacturer holds the string denoting the manufacturer field in the database.
@@ -72,6 +74,7 @@ var Columns = []string{
FieldMaterialName,
FieldOwnershipType,
FieldOwnershipNo,
FieldProductWorkNo,
FieldRelatedStandard,
FieldManufacturer,
FieldInspectionType,
@@ -159,6 +162,11 @@ func ByOwnershipNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldOwnershipNo, opts...).ToFunc()
}
// ByProductWorkNo orders the results by the product_work_no field.
func ByProductWorkNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProductWorkNo, opts...).ToFunc()
}
// ByRelatedStandard orders the results by the related_standard field.
func ByRelatedStandard(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldRelatedStandard, opts...).ToFunc()
@@ -83,6 +83,11 @@ func OwnershipNo(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldOwnershipNo, v))
}
// ProductWorkNo applies equality check predicate on the "product_work_no" field. It's identical to ProductWorkNoEQ.
func ProductWorkNo(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldProductWorkNo, v))
}
// RelatedStandard applies equality check predicate on the "related_standard" field. It's identical to RelatedStandardEQ.
func RelatedStandard(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldRelatedStandard, v))
@@ -593,6 +598,81 @@ func OwnershipNoContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldOwnershipNo, v))
}
// ProductWorkNoEQ applies the EQ predicate on the "product_work_no" field.
func ProductWorkNoEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldProductWorkNo, v))
}
// ProductWorkNoNEQ applies the NEQ predicate on the "product_work_no" field.
func ProductWorkNoNEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNEQ(FieldProductWorkNo, v))
}
// ProductWorkNoIn applies the In predicate on the "product_work_no" field.
func ProductWorkNoIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIn(FieldProductWorkNo, vs...))
}
// ProductWorkNoNotIn applies the NotIn predicate on the "product_work_no" field.
func ProductWorkNoNotIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotIn(FieldProductWorkNo, vs...))
}
// ProductWorkNoGT applies the GT predicate on the "product_work_no" field.
func ProductWorkNoGT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGT(FieldProductWorkNo, v))
}
// ProductWorkNoGTE applies the GTE predicate on the "product_work_no" field.
func ProductWorkNoGTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGTE(FieldProductWorkNo, v))
}
// ProductWorkNoLT applies the LT predicate on the "product_work_no" field.
func ProductWorkNoLT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLT(FieldProductWorkNo, v))
}
// ProductWorkNoLTE applies the LTE predicate on the "product_work_no" field.
func ProductWorkNoLTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLTE(FieldProductWorkNo, v))
}
// ProductWorkNoContains applies the Contains predicate on the "product_work_no" field.
func ProductWorkNoContains(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContains(FieldProductWorkNo, v))
}
// ProductWorkNoHasPrefix applies the HasPrefix predicate on the "product_work_no" field.
func ProductWorkNoHasPrefix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasPrefix(FieldProductWorkNo, v))
}
// ProductWorkNoHasSuffix applies the HasSuffix predicate on the "product_work_no" field.
func ProductWorkNoHasSuffix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasSuffix(FieldProductWorkNo, v))
}
// ProductWorkNoIsNil applies the IsNil predicate on the "product_work_no" field.
func ProductWorkNoIsNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIsNull(FieldProductWorkNo))
}
// ProductWorkNoNotNil applies the NotNil predicate on the "product_work_no" field.
func ProductWorkNoNotNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotNull(FieldProductWorkNo))
}
// ProductWorkNoEqualFold applies the EqualFold predicate on the "product_work_no" field.
func ProductWorkNoEqualFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEqualFold(FieldProductWorkNo, v))
}
// ProductWorkNoContainsFold applies the ContainsFold predicate on the "product_work_no" field.
func ProductWorkNoContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldProductWorkNo, v))
}
// RelatedStandardEQ applies the EQ predicate on the "related_standard" field.
func RelatedStandardEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldRelatedStandard, v))