重构排产/叫料配送/时钟/终端事件驱动,清理 SHIPPED 废弃状态
时钟与 JWT:验签按「谁签发谁的时间为准」,向签发方取 /api/server-time, 对端地址由既有 BaseURL 自动推导;不再要求现场人工 w32tm 对时。 排产 C 方案:工单状态不再回写排产,排产只表示启用开关;启用排产是唯一 开工开关,未启用不允许建档上件;完工/取消后工单进度从工单派生、叫料池 按工单状态重算;逐日手改后合计为准;日期筛选默认空=全部日期。 叫料配送 B 方案:新增 DELIVERED 待签收态,货真到工位才从 PREPARED 转 DELIVERED、工人签收再转 DONE;PREPARED 在途不可签收/退库;叫料队列一屏 显示 PENDING+PREPARED、支持批量完成备料;配送链改按工位凑车,一张配送单 =一个托盘=一个工位,只在配送单页新建,未派车可删可改;新建弹窗直列有货 工位;派车硬门禁要求接驳台传感器检测到托盘;删除改为事务内复核状态、 带 PENDING 条件删单头,防止并发派车时误删。 装配记账:新增已装量 installedQty 与追溯绑定 traceBind,落实「总账=分账 之和」;追溯件绑定/撤销回补、非序列号件报工按单台用量自动扣已装;报工前 按工位×物料核对累计已签收 ≥ 已消耗,不够拦下。 工件与工位终端:建档/重上线增加上料位可达性校验与 PLC 送件、半截补齐防 重复扣库;终端去轮询改事件驱动(报警/工件到位/点位/停单即时推送),铃铛 只挂消息类预警、与待办角标分家;刷新保留拧紧录入;跨服务连线失败不再 误报成数据库故障;新增 BJ_POWER_DEV=1 单进程调试模式(不起守护/托盘)。 告警:新增处置字段 resolved_at/resolved_by,红点=待处置数,确认关闭才消。 清理:删除 migrate 中 SHIPPED→DELIVERED 兼容补丁;场景1测试断言改为 现行 PREPARED / DELIVERED;同步更新案例.md、现场对时操作卡.md 与 ent 生成代码。
This commit is contained in:
@@ -81,6 +81,34 @@ func (_c *AlertCreate) SetNillableStatus(v *string) *AlertCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetResolvedAt sets the "resolved_at" field.
|
||||
func (_c *AlertCreate) SetResolvedAt(v int64) *AlertCreate {
|
||||
_c.mutation.SetResolvedAt(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableResolvedAt sets the "resolved_at" field if the given value is not nil.
|
||||
func (_c *AlertCreate) SetNillableResolvedAt(v *int64) *AlertCreate {
|
||||
if v != nil {
|
||||
_c.SetResolvedAt(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetResolvedBy sets the "resolved_by" field.
|
||||
func (_c *AlertCreate) SetResolvedBy(v string) *AlertCreate {
|
||||
_c.mutation.SetResolvedBy(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableResolvedBy sets the "resolved_by" field if the given value is not nil.
|
||||
func (_c *AlertCreate) SetNillableResolvedBy(v *string) *AlertCreate {
|
||||
if v != nil {
|
||||
_c.SetResolvedBy(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_c *AlertCreate) SetCreatedAt(v int64) *AlertCreate {
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -152,6 +180,10 @@ func (_c *AlertCreate) defaults() {
|
||||
v := alert.DefaultStatus
|
||||
_c.mutation.SetStatus(v)
|
||||
}
|
||||
if _, ok := _c.mutation.ResolvedBy(); !ok {
|
||||
v := alert.DefaultResolvedBy
|
||||
_c.mutation.SetResolvedBy(v)
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
v := alert.DefaultCreatedAt()
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -189,6 +221,9 @@ func (_c *AlertCreate) check() error {
|
||||
return &ValidationError{Name: "status", err: fmt.Errorf(`ent: validator failed for field "Alert.status": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.ResolvedBy(); !ok {
|
||||
return &ValidationError{Name: "resolved_by", err: errors.New(`ent: missing required field "Alert.resolved_by"`)}
|
||||
}
|
||||
if _, ok := _c.mutation.CreatedAt(); !ok {
|
||||
return &ValidationError{Name: "created_at", err: errors.New(`ent: missing required field "Alert.created_at"`)}
|
||||
}
|
||||
@@ -246,6 +281,14 @@ func (_c *AlertCreate) createSpec() (*Alert, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(alert.FieldStatus, field.TypeString, value)
|
||||
_node.Status = value
|
||||
}
|
||||
if value, ok := _c.mutation.ResolvedAt(); ok {
|
||||
_spec.SetField(alert.FieldResolvedAt, field.TypeInt64, value)
|
||||
_node.ResolvedAt = value
|
||||
}
|
||||
if value, ok := _c.mutation.ResolvedBy(); ok {
|
||||
_spec.SetField(alert.FieldResolvedBy, field.TypeString, value)
|
||||
_node.ResolvedBy = value
|
||||
}
|
||||
if value, ok := _c.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(alert.FieldCreatedAt, field.TypeInt64, value)
|
||||
_node.CreatedAt = value
|
||||
@@ -384,6 +427,42 @@ func (u *AlertUpsert) UpdateStatus() *AlertUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetResolvedAt sets the "resolved_at" field.
|
||||
func (u *AlertUpsert) SetResolvedAt(v int64) *AlertUpsert {
|
||||
u.Set(alert.FieldResolvedAt, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateResolvedAt sets the "resolved_at" field to the value that was provided on create.
|
||||
func (u *AlertUpsert) UpdateResolvedAt() *AlertUpsert {
|
||||
u.SetExcluded(alert.FieldResolvedAt)
|
||||
return u
|
||||
}
|
||||
|
||||
// AddResolvedAt adds v to the "resolved_at" field.
|
||||
func (u *AlertUpsert) AddResolvedAt(v int64) *AlertUpsert {
|
||||
u.Add(alert.FieldResolvedAt, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearResolvedAt clears the value of the "resolved_at" field.
|
||||
func (u *AlertUpsert) ClearResolvedAt() *AlertUpsert {
|
||||
u.SetNull(alert.FieldResolvedAt)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetResolvedBy sets the "resolved_by" field.
|
||||
func (u *AlertUpsert) SetResolvedBy(v string) *AlertUpsert {
|
||||
u.Set(alert.FieldResolvedBy, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateResolvedBy sets the "resolved_by" field to the value that was provided on create.
|
||||
func (u *AlertUpsert) UpdateResolvedBy() *AlertUpsert {
|
||||
u.SetExcluded(alert.FieldResolvedBy)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *AlertUpsert) SetCreatedAt(v int64) *AlertUpsert {
|
||||
u.Set(alert.FieldCreatedAt, v)
|
||||
@@ -551,6 +630,48 @@ func (u *AlertUpsertOne) UpdateStatus() *AlertUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetResolvedAt sets the "resolved_at" field.
|
||||
func (u *AlertUpsertOne) SetResolvedAt(v int64) *AlertUpsertOne {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.SetResolvedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddResolvedAt adds v to the "resolved_at" field.
|
||||
func (u *AlertUpsertOne) AddResolvedAt(v int64) *AlertUpsertOne {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.AddResolvedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateResolvedAt sets the "resolved_at" field to the value that was provided on create.
|
||||
func (u *AlertUpsertOne) UpdateResolvedAt() *AlertUpsertOne {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.UpdateResolvedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearResolvedAt clears the value of the "resolved_at" field.
|
||||
func (u *AlertUpsertOne) ClearResolvedAt() *AlertUpsertOne {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.ClearResolvedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// SetResolvedBy sets the "resolved_by" field.
|
||||
func (u *AlertUpsertOne) SetResolvedBy(v string) *AlertUpsertOne {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.SetResolvedBy(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateResolvedBy sets the "resolved_by" field to the value that was provided on create.
|
||||
func (u *AlertUpsertOne) UpdateResolvedBy() *AlertUpsertOne {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.UpdateResolvedBy()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *AlertUpsertOne) SetCreatedAt(v int64) *AlertUpsertOne {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
@@ -888,6 +1009,48 @@ func (u *AlertUpsertBulk) UpdateStatus() *AlertUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetResolvedAt sets the "resolved_at" field.
|
||||
func (u *AlertUpsertBulk) SetResolvedAt(v int64) *AlertUpsertBulk {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.SetResolvedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// AddResolvedAt adds v to the "resolved_at" field.
|
||||
func (u *AlertUpsertBulk) AddResolvedAt(v int64) *AlertUpsertBulk {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.AddResolvedAt(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateResolvedAt sets the "resolved_at" field to the value that was provided on create.
|
||||
func (u *AlertUpsertBulk) UpdateResolvedAt() *AlertUpsertBulk {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.UpdateResolvedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearResolvedAt clears the value of the "resolved_at" field.
|
||||
func (u *AlertUpsertBulk) ClearResolvedAt() *AlertUpsertBulk {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.ClearResolvedAt()
|
||||
})
|
||||
}
|
||||
|
||||
// SetResolvedBy sets the "resolved_by" field.
|
||||
func (u *AlertUpsertBulk) SetResolvedBy(v string) *AlertUpsertBulk {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.SetResolvedBy(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateResolvedBy sets the "resolved_by" field to the value that was provided on create.
|
||||
func (u *AlertUpsertBulk) UpdateResolvedBy() *AlertUpsertBulk {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
s.UpdateResolvedBy()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *AlertUpsertBulk) SetCreatedAt(v int64) *AlertUpsertBulk {
|
||||
return u.Update(func(s *AlertUpsert) {
|
||||
|
||||
Reference in New Issue
Block a user