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
@@ -57,6 +57,8 @@ const (
FieldDisposalType = "disposal_type"
// FieldDisposalRemark holds the string denoting the disposalremark field in the database.
FieldDisposalRemark = "disposal_remark"
// FieldBatchSn holds the string denoting the batchsn field in the database.
FieldBatchSn = "batch_sn"
// FieldCreatedAt holds the string denoting the createdat field in the database.
FieldCreatedAt = "created_at"
// Table holds the table name of the inspectionrecord in the database.
@@ -88,6 +90,7 @@ var Columns = []string{
FieldAttachmentIds,
FieldDisposalType,
FieldDisposalRemark,
FieldBatchSn,
FieldCreatedAt,
}
@@ -180,6 +183,8 @@ var (
DefaultDisposalRemark string
// DisposalRemarkValidator is a validator for the "disposalRemark" field. It is called by the builders before save.
DisposalRemarkValidator func(string) error
// BatchSnValidator is a validator for the "batchSn" field. It is called by the builders before save.
BatchSnValidator func(string) error
// DefaultCreatedAt holds the default value on creation for the "createdAt" field.
DefaultCreatedAt func() time.Time
// IDValidator is a validator for the "id" field. It is called by the builders before save.
@@ -299,6 +304,11 @@ func ByDisposalRemark(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDisposalRemark, opts...).ToFunc()
}
// ByBatchSn orders the results by the batchSn field.
func ByBatchSn(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldBatchSn, opts...).ToFunc()
}
// ByCreatedAt orders the results by the createdAt field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
@@ -159,6 +159,11 @@ func DisposalRemark(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldDisposalRemark, v))
}
// BatchSn applies equality check predicate on the "batchSn" field. It's identical to BatchSnEQ.
func BatchSn(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldBatchSn, v))
}
// CreatedAt applies equality check predicate on the "createdAt" field. It's identical to CreatedAtEQ.
func CreatedAt(v time.Time) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldCreatedAt, v))
@@ -1489,6 +1494,81 @@ func DisposalRemarkContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldDisposalRemark, v))
}
// BatchSnEQ applies the EQ predicate on the "batchSn" field.
func BatchSnEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldBatchSn, v))
}
// BatchSnNEQ applies the NEQ predicate on the "batchSn" field.
func BatchSnNEQ(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNEQ(FieldBatchSn, v))
}
// BatchSnIn applies the In predicate on the "batchSn" field.
func BatchSnIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIn(FieldBatchSn, vs...))
}
// BatchSnNotIn applies the NotIn predicate on the "batchSn" field.
func BatchSnNotIn(vs ...string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotIn(FieldBatchSn, vs...))
}
// BatchSnGT applies the GT predicate on the "batchSn" field.
func BatchSnGT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGT(FieldBatchSn, v))
}
// BatchSnGTE applies the GTE predicate on the "batchSn" field.
func BatchSnGTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldGTE(FieldBatchSn, v))
}
// BatchSnLT applies the LT predicate on the "batchSn" field.
func BatchSnLT(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLT(FieldBatchSn, v))
}
// BatchSnLTE applies the LTE predicate on the "batchSn" field.
func BatchSnLTE(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldLTE(FieldBatchSn, v))
}
// BatchSnContains applies the Contains predicate on the "batchSn" field.
func BatchSnContains(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContains(FieldBatchSn, v))
}
// BatchSnHasPrefix applies the HasPrefix predicate on the "batchSn" field.
func BatchSnHasPrefix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasPrefix(FieldBatchSn, v))
}
// BatchSnHasSuffix applies the HasSuffix predicate on the "batchSn" field.
func BatchSnHasSuffix(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldHasSuffix(FieldBatchSn, v))
}
// BatchSnIsNil applies the IsNil predicate on the "batchSn" field.
func BatchSnIsNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldIsNull(FieldBatchSn))
}
// BatchSnNotNil applies the NotNil predicate on the "batchSn" field.
func BatchSnNotNil() predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldNotNull(FieldBatchSn))
}
// BatchSnEqualFold applies the EqualFold predicate on the "batchSn" field.
func BatchSnEqualFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEqualFold(FieldBatchSn, v))
}
// BatchSnContainsFold applies the ContainsFold predicate on the "batchSn" field.
func BatchSnContainsFold(v string) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldContainsFold(FieldBatchSn, v))
}
// CreatedAtEQ applies the EQ predicate on the "createdAt" field.
func CreatedAtEQ(v time.Time) predicate.InspectionRecord {
return predicate.InspectionRecord(sql.FieldEQ(FieldCreatedAt, v))