feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段

- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统
- 为BomItem实体添加relatedStandard字段及相关CRUD方法
- 为InspectionRecord实体添加reportNo、materialCode、materialName等字段
- 更新ent schema确保新字段的验证和默认值设置
- 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
SunYF
2026-09-17 12:49:07 +08:00
parent b4b274301d
commit 1cc93795ce
191 changed files with 24504 additions and 1250 deletions
+59
View File
@@ -11,6 +11,7 @@ import (
"entgo.io/ent/dialect/sql"
"entgo.io/ent/dialect/sql/sqlgraph"
"entgo.io/ent/dialect/sql/sqljson"
"entgo.io/ent/schema/field"
)
@@ -132,6 +133,24 @@ func (_u *ProcessStepUpdate) SetNillableNeedCheck(v *bool) *ProcessStepUpdate {
return _u
}
// SetAttachment sets the "attachment" field.
func (_u *ProcessStepUpdate) SetAttachment(v []map[string]string) *ProcessStepUpdate {
_u.mutation.SetAttachment(v)
return _u
}
// AppendAttachment appends value to the "attachment" field.
func (_u *ProcessStepUpdate) AppendAttachment(v []map[string]string) *ProcessStepUpdate {
_u.mutation.AppendAttachment(v)
return _u
}
// ClearAttachment clears the value of the "attachment" field.
func (_u *ProcessStepUpdate) ClearAttachment() *ProcessStepUpdate {
_u.mutation.ClearAttachment()
return _u
}
// SetRemark sets the "remark" field.
func (_u *ProcessStepUpdate) SetRemark(v string) *ProcessStepUpdate {
_u.mutation.SetRemark(v)
@@ -243,6 +262,17 @@ func (_u *ProcessStepUpdate) sqlSave(ctx context.Context) (_node int, err error)
if value, ok := _u.mutation.NeedCheck(); ok {
_spec.SetField(processstep.FieldNeedCheck, field.TypeBool, value)
}
if value, ok := _u.mutation.Attachment(); ok {
_spec.SetField(processstep.FieldAttachment, field.TypeJSON, value)
}
if value, ok := _u.mutation.AppendedAttachment(); ok {
_spec.AddModifier(func(u *sql.UpdateBuilder) {
sqljson.Append(u, processstep.FieldAttachment, value)
})
}
if _u.mutation.AttachmentCleared() {
_spec.ClearField(processstep.FieldAttachment, field.TypeJSON)
}
if value, ok := _u.mutation.Remark(); ok {
_spec.SetField(processstep.FieldRemark, field.TypeString, value)
}
@@ -372,6 +402,24 @@ func (_u *ProcessStepUpdateOne) SetNillableNeedCheck(v *bool) *ProcessStepUpdate
return _u
}
// SetAttachment sets the "attachment" field.
func (_u *ProcessStepUpdateOne) SetAttachment(v []map[string]string) *ProcessStepUpdateOne {
_u.mutation.SetAttachment(v)
return _u
}
// AppendAttachment appends value to the "attachment" field.
func (_u *ProcessStepUpdateOne) AppendAttachment(v []map[string]string) *ProcessStepUpdateOne {
_u.mutation.AppendAttachment(v)
return _u
}
// ClearAttachment clears the value of the "attachment" field.
func (_u *ProcessStepUpdateOne) ClearAttachment() *ProcessStepUpdateOne {
_u.mutation.ClearAttachment()
return _u
}
// SetRemark sets the "remark" field.
func (_u *ProcessStepUpdateOne) SetRemark(v string) *ProcessStepUpdateOne {
_u.mutation.SetRemark(v)
@@ -513,6 +561,17 @@ func (_u *ProcessStepUpdateOne) sqlSave(ctx context.Context) (_node *ProcessStep
if value, ok := _u.mutation.NeedCheck(); ok {
_spec.SetField(processstep.FieldNeedCheck, field.TypeBool, value)
}
if value, ok := _u.mutation.Attachment(); ok {
_spec.SetField(processstep.FieldAttachment, field.TypeJSON, value)
}
if value, ok := _u.mutation.AppendedAttachment(); ok {
_spec.AddModifier(func(u *sql.UpdateBuilder) {
sqljson.Append(u, processstep.FieldAttachment, value)
})
}
if _u.mutation.AttachmentCleared() {
_spec.ClearField(processstep.FieldAttachment, field.TypeJSON)
}
if value, ok := _u.mutation.Remark(); ok {
_spec.SetField(processstep.FieldRemark, field.TypeString, value)
}