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
+312
View File
@@ -103,6 +103,48 @@ func (_c *InboundOrderCreate) SetNillableZoneCode(v *string) *InboundOrderCreate
return _c
}
// SetShelfNo sets the "shelf_no" field.
func (_c *InboundOrderCreate) SetShelfNo(v string) *InboundOrderCreate {
_c.mutation.SetShelfNo(v)
return _c
}
// SetNillableShelfNo sets the "shelf_no" field if the given value is not nil.
func (_c *InboundOrderCreate) SetNillableShelfNo(v *string) *InboundOrderCreate {
if v != nil {
_c.SetShelfNo(*v)
}
return _c
}
// SetLayerNo sets the "layer_no" field.
func (_c *InboundOrderCreate) SetLayerNo(v string) *InboundOrderCreate {
_c.mutation.SetLayerNo(v)
return _c
}
// SetNillableLayerNo sets the "layer_no" field if the given value is not nil.
func (_c *InboundOrderCreate) SetNillableLayerNo(v *string) *InboundOrderCreate {
if v != nil {
_c.SetLayerNo(*v)
}
return _c
}
// SetPositionNo sets the "position_no" field.
func (_c *InboundOrderCreate) SetPositionNo(v string) *InboundOrderCreate {
_c.mutation.SetPositionNo(v)
return _c
}
// SetNillablePositionNo sets the "position_no" field if the given value is not nil.
func (_c *InboundOrderCreate) SetNillablePositionNo(v *string) *InboundOrderCreate {
if v != nil {
_c.SetPositionNo(*v)
}
return _c
}
// SetQuantity sets the "quantity" field.
func (_c *InboundOrderCreate) SetQuantity(v int) *InboundOrderCreate {
_c.mutation.SetQuantity(v)
@@ -179,6 +221,20 @@ func (_c *InboundOrderCreate) SetNillableOwnershipNo(v *string) *InboundOrderCre
return _c
}
// SetQualityStatus sets the "quality_status" field.
func (_c *InboundOrderCreate) SetQualityStatus(v string) *InboundOrderCreate {
_c.mutation.SetQualityStatus(v)
return _c
}
// SetNillableQualityStatus sets the "quality_status" field if the given value is not nil.
func (_c *InboundOrderCreate) SetNillableQualityStatus(v *string) *InboundOrderCreate {
if v != nil {
_c.SetQualityStatus(*v)
}
return _c
}
// SetCreatedAt sets the "created_at" field.
func (_c *InboundOrderCreate) SetCreatedAt(v int64) *InboundOrderCreate {
_c.mutation.SetCreatedAt(v)
@@ -331,6 +387,18 @@ func (_c *InboundOrderCreate) createSpec() (*InboundOrder, *sqlgraph.CreateSpec)
_spec.SetField(inboundorder.FieldZoneCode, field.TypeString, value)
_node.ZoneCode = value
}
if value, ok := _c.mutation.ShelfNo(); ok {
_spec.SetField(inboundorder.FieldShelfNo, field.TypeString, value)
_node.ShelfNo = value
}
if value, ok := _c.mutation.LayerNo(); ok {
_spec.SetField(inboundorder.FieldLayerNo, field.TypeString, value)
_node.LayerNo = value
}
if value, ok := _c.mutation.PositionNo(); ok {
_spec.SetField(inboundorder.FieldPositionNo, field.TypeString, value)
_node.PositionNo = value
}
if value, ok := _c.mutation.Quantity(); ok {
_spec.SetField(inboundorder.FieldQuantity, field.TypeInt, value)
_node.Quantity = value
@@ -355,6 +423,10 @@ func (_c *InboundOrderCreate) createSpec() (*InboundOrder, *sqlgraph.CreateSpec)
_spec.SetField(inboundorder.FieldOwnershipNo, field.TypeString, value)
_node.OwnershipNo = value
}
if value, ok := _c.mutation.QualityStatus(); ok {
_spec.SetField(inboundorder.FieldQualityStatus, field.TypeString, value)
_node.QualityStatus = value
}
if value, ok := _c.mutation.CreatedAt(); ok {
_spec.SetField(inboundorder.FieldCreatedAt, field.TypeInt64, value)
_node.CreatedAt = value
@@ -519,6 +591,60 @@ func (u *InboundOrderUpsert) ClearZoneCode() *InboundOrderUpsert {
return u
}
// SetShelfNo sets the "shelf_no" field.
func (u *InboundOrderUpsert) SetShelfNo(v string) *InboundOrderUpsert {
u.Set(inboundorder.FieldShelfNo, v)
return u
}
// UpdateShelfNo sets the "shelf_no" field to the value that was provided on create.
func (u *InboundOrderUpsert) UpdateShelfNo() *InboundOrderUpsert {
u.SetExcluded(inboundorder.FieldShelfNo)
return u
}
// ClearShelfNo clears the value of the "shelf_no" field.
func (u *InboundOrderUpsert) ClearShelfNo() *InboundOrderUpsert {
u.SetNull(inboundorder.FieldShelfNo)
return u
}
// SetLayerNo sets the "layer_no" field.
func (u *InboundOrderUpsert) SetLayerNo(v string) *InboundOrderUpsert {
u.Set(inboundorder.FieldLayerNo, v)
return u
}
// UpdateLayerNo sets the "layer_no" field to the value that was provided on create.
func (u *InboundOrderUpsert) UpdateLayerNo() *InboundOrderUpsert {
u.SetExcluded(inboundorder.FieldLayerNo)
return u
}
// ClearLayerNo clears the value of the "layer_no" field.
func (u *InboundOrderUpsert) ClearLayerNo() *InboundOrderUpsert {
u.SetNull(inboundorder.FieldLayerNo)
return u
}
// SetPositionNo sets the "position_no" field.
func (u *InboundOrderUpsert) SetPositionNo(v string) *InboundOrderUpsert {
u.Set(inboundorder.FieldPositionNo, v)
return u
}
// UpdatePositionNo sets the "position_no" field to the value that was provided on create.
func (u *InboundOrderUpsert) UpdatePositionNo() *InboundOrderUpsert {
u.SetExcluded(inboundorder.FieldPositionNo)
return u
}
// ClearPositionNo clears the value of the "position_no" field.
func (u *InboundOrderUpsert) ClearPositionNo() *InboundOrderUpsert {
u.SetNull(inboundorder.FieldPositionNo)
return u
}
// SetQuantity sets the "quantity" field.
func (u *InboundOrderUpsert) SetQuantity(v int) *InboundOrderUpsert {
u.Set(inboundorder.FieldQuantity, v)
@@ -615,6 +741,24 @@ func (u *InboundOrderUpsert) ClearOwnershipNo() *InboundOrderUpsert {
return u
}
// SetQualityStatus sets the "quality_status" field.
func (u *InboundOrderUpsert) SetQualityStatus(v string) *InboundOrderUpsert {
u.Set(inboundorder.FieldQualityStatus, v)
return u
}
// UpdateQualityStatus sets the "quality_status" field to the value that was provided on create.
func (u *InboundOrderUpsert) UpdateQualityStatus() *InboundOrderUpsert {
u.SetExcluded(inboundorder.FieldQualityStatus)
return u
}
// ClearQualityStatus clears the value of the "quality_status" field.
func (u *InboundOrderUpsert) ClearQualityStatus() *InboundOrderUpsert {
u.SetNull(inboundorder.FieldQualityStatus)
return u
}
// SetCreatedAt sets the "created_at" field.
func (u *InboundOrderUpsert) SetCreatedAt(v int64) *InboundOrderUpsert {
u.Set(inboundorder.FieldCreatedAt, v)
@@ -799,6 +943,69 @@ func (u *InboundOrderUpsertOne) ClearZoneCode() *InboundOrderUpsertOne {
})
}
// SetShelfNo sets the "shelf_no" field.
func (u *InboundOrderUpsertOne) SetShelfNo(v string) *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.SetShelfNo(v)
})
}
// UpdateShelfNo sets the "shelf_no" field to the value that was provided on create.
func (u *InboundOrderUpsertOne) UpdateShelfNo() *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.UpdateShelfNo()
})
}
// ClearShelfNo clears the value of the "shelf_no" field.
func (u *InboundOrderUpsertOne) ClearShelfNo() *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.ClearShelfNo()
})
}
// SetLayerNo sets the "layer_no" field.
func (u *InboundOrderUpsertOne) SetLayerNo(v string) *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.SetLayerNo(v)
})
}
// UpdateLayerNo sets the "layer_no" field to the value that was provided on create.
func (u *InboundOrderUpsertOne) UpdateLayerNo() *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.UpdateLayerNo()
})
}
// ClearLayerNo clears the value of the "layer_no" field.
func (u *InboundOrderUpsertOne) ClearLayerNo() *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.ClearLayerNo()
})
}
// SetPositionNo sets the "position_no" field.
func (u *InboundOrderUpsertOne) SetPositionNo(v string) *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.SetPositionNo(v)
})
}
// UpdatePositionNo sets the "position_no" field to the value that was provided on create.
func (u *InboundOrderUpsertOne) UpdatePositionNo() *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.UpdatePositionNo()
})
}
// ClearPositionNo clears the value of the "position_no" field.
func (u *InboundOrderUpsertOne) ClearPositionNo() *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.ClearPositionNo()
})
}
// SetQuantity sets the "quantity" field.
func (u *InboundOrderUpsertOne) SetQuantity(v int) *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
@@ -911,6 +1118,27 @@ func (u *InboundOrderUpsertOne) ClearOwnershipNo() *InboundOrderUpsertOne {
})
}
// SetQualityStatus sets the "quality_status" field.
func (u *InboundOrderUpsertOne) SetQualityStatus(v string) *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.SetQualityStatus(v)
})
}
// UpdateQualityStatus sets the "quality_status" field to the value that was provided on create.
func (u *InboundOrderUpsertOne) UpdateQualityStatus() *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.UpdateQualityStatus()
})
}
// ClearQualityStatus clears the value of the "quality_status" field.
func (u *InboundOrderUpsertOne) ClearQualityStatus() *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
s.ClearQualityStatus()
})
}
// SetCreatedAt sets the "created_at" field.
func (u *InboundOrderUpsertOne) SetCreatedAt(v int64) *InboundOrderUpsertOne {
return u.Update(func(s *InboundOrderUpsert) {
@@ -1262,6 +1490,69 @@ func (u *InboundOrderUpsertBulk) ClearZoneCode() *InboundOrderUpsertBulk {
})
}
// SetShelfNo sets the "shelf_no" field.
func (u *InboundOrderUpsertBulk) SetShelfNo(v string) *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.SetShelfNo(v)
})
}
// UpdateShelfNo sets the "shelf_no" field to the value that was provided on create.
func (u *InboundOrderUpsertBulk) UpdateShelfNo() *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.UpdateShelfNo()
})
}
// ClearShelfNo clears the value of the "shelf_no" field.
func (u *InboundOrderUpsertBulk) ClearShelfNo() *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.ClearShelfNo()
})
}
// SetLayerNo sets the "layer_no" field.
func (u *InboundOrderUpsertBulk) SetLayerNo(v string) *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.SetLayerNo(v)
})
}
// UpdateLayerNo sets the "layer_no" field to the value that was provided on create.
func (u *InboundOrderUpsertBulk) UpdateLayerNo() *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.UpdateLayerNo()
})
}
// ClearLayerNo clears the value of the "layer_no" field.
func (u *InboundOrderUpsertBulk) ClearLayerNo() *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.ClearLayerNo()
})
}
// SetPositionNo sets the "position_no" field.
func (u *InboundOrderUpsertBulk) SetPositionNo(v string) *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.SetPositionNo(v)
})
}
// UpdatePositionNo sets the "position_no" field to the value that was provided on create.
func (u *InboundOrderUpsertBulk) UpdatePositionNo() *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.UpdatePositionNo()
})
}
// ClearPositionNo clears the value of the "position_no" field.
func (u *InboundOrderUpsertBulk) ClearPositionNo() *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.ClearPositionNo()
})
}
// SetQuantity sets the "quantity" field.
func (u *InboundOrderUpsertBulk) SetQuantity(v int) *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
@@ -1374,6 +1665,27 @@ func (u *InboundOrderUpsertBulk) ClearOwnershipNo() *InboundOrderUpsertBulk {
})
}
// SetQualityStatus sets the "quality_status" field.
func (u *InboundOrderUpsertBulk) SetQualityStatus(v string) *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.SetQualityStatus(v)
})
}
// UpdateQualityStatus sets the "quality_status" field to the value that was provided on create.
func (u *InboundOrderUpsertBulk) UpdateQualityStatus() *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.UpdateQualityStatus()
})
}
// ClearQualityStatus clears the value of the "quality_status" field.
func (u *InboundOrderUpsertBulk) ClearQualityStatus() *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {
s.ClearQualityStatus()
})
}
// SetCreatedAt sets the "created_at" field.
func (u *InboundOrderUpsertBulk) SetCreatedAt(v int64) *InboundOrderUpsertBulk {
return u.Update(func(s *InboundOrderUpsert) {