重构排产/叫料配送/时钟/终端事件驱动,清理 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:
@@ -23,6 +23,10 @@ const (
|
||||
FieldTarget = "target"
|
||||
// FieldStatus holds the string denoting the status field in the database.
|
||||
FieldStatus = "status"
|
||||
// FieldResolvedAt holds the string denoting the resolved_at field in the database.
|
||||
FieldResolvedAt = "resolved_at"
|
||||
// FieldResolvedBy holds the string denoting the resolved_by field in the database.
|
||||
FieldResolvedBy = "resolved_by"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
|
||||
@@ -40,6 +44,8 @@ var Columns = []string{
|
||||
FieldContent,
|
||||
FieldTarget,
|
||||
FieldStatus,
|
||||
FieldResolvedAt,
|
||||
FieldResolvedBy,
|
||||
FieldCreatedAt,
|
||||
FieldUpdatedAt,
|
||||
}
|
||||
@@ -63,6 +69,8 @@ var (
|
||||
DefaultStatus string
|
||||
// StatusValidator is a validator for the "status" field. It is called by the builders before save.
|
||||
StatusValidator func(string) error
|
||||
// DefaultResolvedBy holds the default value on creation for the "resolved_by" field.
|
||||
DefaultResolvedBy string
|
||||
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
|
||||
DefaultCreatedAt func() int64
|
||||
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
|
||||
@@ -107,6 +115,16 @@ func ByStatus(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldStatus, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByResolvedAt orders the results by the resolved_at field.
|
||||
func ByResolvedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldResolvedAt, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByResolvedBy orders the results by the resolved_by field.
|
||||
func ByResolvedBy(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldResolvedBy, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
|
||||
@@ -83,6 +83,16 @@ func Status(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldEQ(FieldStatus, v))
|
||||
}
|
||||
|
||||
// ResolvedAt applies equality check predicate on the "resolved_at" field. It's identical to ResolvedAtEQ.
|
||||
func ResolvedAt(v int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldEQ(FieldResolvedAt, v))
|
||||
}
|
||||
|
||||
// ResolvedBy applies equality check predicate on the "resolved_by" field. It's identical to ResolvedByEQ.
|
||||
func ResolvedBy(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldEQ(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldEQ(FieldCreatedAt, v))
|
||||
@@ -493,6 +503,121 @@ func StatusContainsFold(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldContainsFold(FieldStatus, v))
|
||||
}
|
||||
|
||||
// ResolvedAtEQ applies the EQ predicate on the "resolved_at" field.
|
||||
func ResolvedAtEQ(v int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldEQ(FieldResolvedAt, v))
|
||||
}
|
||||
|
||||
// ResolvedAtNEQ applies the NEQ predicate on the "resolved_at" field.
|
||||
func ResolvedAtNEQ(v int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldNEQ(FieldResolvedAt, v))
|
||||
}
|
||||
|
||||
// ResolvedAtIn applies the In predicate on the "resolved_at" field.
|
||||
func ResolvedAtIn(vs ...int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldIn(FieldResolvedAt, vs...))
|
||||
}
|
||||
|
||||
// ResolvedAtNotIn applies the NotIn predicate on the "resolved_at" field.
|
||||
func ResolvedAtNotIn(vs ...int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldNotIn(FieldResolvedAt, vs...))
|
||||
}
|
||||
|
||||
// ResolvedAtGT applies the GT predicate on the "resolved_at" field.
|
||||
func ResolvedAtGT(v int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldGT(FieldResolvedAt, v))
|
||||
}
|
||||
|
||||
// ResolvedAtGTE applies the GTE predicate on the "resolved_at" field.
|
||||
func ResolvedAtGTE(v int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldGTE(FieldResolvedAt, v))
|
||||
}
|
||||
|
||||
// ResolvedAtLT applies the LT predicate on the "resolved_at" field.
|
||||
func ResolvedAtLT(v int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldLT(FieldResolvedAt, v))
|
||||
}
|
||||
|
||||
// ResolvedAtLTE applies the LTE predicate on the "resolved_at" field.
|
||||
func ResolvedAtLTE(v int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldLTE(FieldResolvedAt, v))
|
||||
}
|
||||
|
||||
// ResolvedAtIsNil applies the IsNil predicate on the "resolved_at" field.
|
||||
func ResolvedAtIsNil() predicate.Alert {
|
||||
return predicate.Alert(sql.FieldIsNull(FieldResolvedAt))
|
||||
}
|
||||
|
||||
// ResolvedAtNotNil applies the NotNil predicate on the "resolved_at" field.
|
||||
func ResolvedAtNotNil() predicate.Alert {
|
||||
return predicate.Alert(sql.FieldNotNull(FieldResolvedAt))
|
||||
}
|
||||
|
||||
// ResolvedByEQ applies the EQ predicate on the "resolved_by" field.
|
||||
func ResolvedByEQ(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldEQ(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByNEQ applies the NEQ predicate on the "resolved_by" field.
|
||||
func ResolvedByNEQ(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldNEQ(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByIn applies the In predicate on the "resolved_by" field.
|
||||
func ResolvedByIn(vs ...string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldIn(FieldResolvedBy, vs...))
|
||||
}
|
||||
|
||||
// ResolvedByNotIn applies the NotIn predicate on the "resolved_by" field.
|
||||
func ResolvedByNotIn(vs ...string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldNotIn(FieldResolvedBy, vs...))
|
||||
}
|
||||
|
||||
// ResolvedByGT applies the GT predicate on the "resolved_by" field.
|
||||
func ResolvedByGT(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldGT(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByGTE applies the GTE predicate on the "resolved_by" field.
|
||||
func ResolvedByGTE(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldGTE(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByLT applies the LT predicate on the "resolved_by" field.
|
||||
func ResolvedByLT(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldLT(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByLTE applies the LTE predicate on the "resolved_by" field.
|
||||
func ResolvedByLTE(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldLTE(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByContains applies the Contains predicate on the "resolved_by" field.
|
||||
func ResolvedByContains(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldContains(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByHasPrefix applies the HasPrefix predicate on the "resolved_by" field.
|
||||
func ResolvedByHasPrefix(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldHasPrefix(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByHasSuffix applies the HasSuffix predicate on the "resolved_by" field.
|
||||
func ResolvedByHasSuffix(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldHasSuffix(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByEqualFold applies the EqualFold predicate on the "resolved_by" field.
|
||||
func ResolvedByEqualFold(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldEqualFold(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// ResolvedByContainsFold applies the ContainsFold predicate on the "resolved_by" field.
|
||||
func ResolvedByContainsFold(v string) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldContainsFold(FieldResolvedBy, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v int64) predicate.Alert {
|
||||
return predicate.Alert(sql.FieldEQ(FieldCreatedAt, v))
|
||||
|
||||
Reference in New Issue
Block a user