feat: AGV三段链安全机制、补料/损耗/下班闭环、接驳台左右互换

AGV 调度:
- 任务重构为 GO_LOAD/TRANSPORT/EMPTY_RETURN/FREE 三段链,到位即停(ARRIVED)需人工确认装卸
- 自由调度单点步进,每段强制弹"请确保路径畅通无杂物";托盘回收独立工作台
- 接驳台 PLC 传感器检测到托盘即自动卸货放行,传感器故障由人工按钮兜底(无轮询)
- 车辆状态只读展示(海康3.1.7 queryAgvStatus),调度仍由 RCS 负责

物料闭环:
- 补料管理(SHORTAGE):工位申请 + 主管审批调增叫料池额度,与借料/差异补发三轨并行
- 损耗台账(loss_ledger):退料实际 < 理论必填原因、后审核,工单不记损耗
- 退料强制指定左/右接驳台,WMS 库管可代工位退料

下班闭环:
- 工位终端自检接驳台剩余物料后下班;库管收货 + 托盘拉走后事件驱动自动结班
- 退出登录未下班仅作安全提示(不强制拦截、不新增责任审批)

接驳台左右按操作员朝向建模(dock.side 字段),废除"奇左偶右"隐式约定;
看板标签 / seed / 迁移补丁 / 布局文档统一为中文左/右。

产线布局说明:C1 前线头 AGV 点、C15 后线尾 AGV 点、外部 O1/O2/O3 散点,
清理修订痕迹为最终态描述。
This commit is contained in:
SunYF
2026-11-03 18:29:31 +08:00
parent 2ccf9bb9ca
commit 42bcf395d2
123 changed files with 19472 additions and 247 deletions
+365
View File
@@ -93,6 +93,36 @@ func Status(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldStatus, v))
}
// Kind applies equality check predicate on the "kind" field. It's identical to KindEQ.
func Kind(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldKind, v))
}
// BizType applies equality check predicate on the "biz_type" field. It's identical to BizTypeEQ.
func BizType(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldBizType, v))
}
// BizNo applies equality check predicate on the "biz_no" field. It's identical to BizNoEQ.
func BizNo(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldBizNo, v))
}
// ChainNo applies equality check predicate on the "chain_no" field. It's identical to ChainNoEQ.
func ChainNo(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldChainNo, v))
}
// AutoEnd applies equality check predicate on the "auto_end" field. It's identical to AutoEndEQ.
func AutoEnd(v bool) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldAutoEnd, v))
}
// AgvCode applies equality check predicate on the "agv_code" field. It's identical to AgvCodeEQ.
func AgvCode(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldAgvCode, v))
}
// Operator applies equality check predicate on the "operator" field. It's identical to OperatorEQ.
func Operator(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldOperator, v))
@@ -658,6 +688,341 @@ func StatusContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldStatus, v))
}
// KindEQ applies the EQ predicate on the "kind" field.
func KindEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldKind, v))
}
// KindNEQ applies the NEQ predicate on the "kind" field.
func KindNEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNEQ(FieldKind, v))
}
// KindIn applies the In predicate on the "kind" field.
func KindIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldIn(FieldKind, vs...))
}
// KindNotIn applies the NotIn predicate on the "kind" field.
func KindNotIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNotIn(FieldKind, vs...))
}
// KindGT applies the GT predicate on the "kind" field.
func KindGT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGT(FieldKind, v))
}
// KindGTE applies the GTE predicate on the "kind" field.
func KindGTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGTE(FieldKind, v))
}
// KindLT applies the LT predicate on the "kind" field.
func KindLT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLT(FieldKind, v))
}
// KindLTE applies the LTE predicate on the "kind" field.
func KindLTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLTE(FieldKind, v))
}
// KindContains applies the Contains predicate on the "kind" field.
func KindContains(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContains(FieldKind, v))
}
// KindHasPrefix applies the HasPrefix predicate on the "kind" field.
func KindHasPrefix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasPrefix(FieldKind, v))
}
// KindHasSuffix applies the HasSuffix predicate on the "kind" field.
func KindHasSuffix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasSuffix(FieldKind, v))
}
// KindEqualFold applies the EqualFold predicate on the "kind" field.
func KindEqualFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEqualFold(FieldKind, v))
}
// KindContainsFold applies the ContainsFold predicate on the "kind" field.
func KindContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldKind, v))
}
// BizTypeEQ applies the EQ predicate on the "biz_type" field.
func BizTypeEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldBizType, v))
}
// BizTypeNEQ applies the NEQ predicate on the "biz_type" field.
func BizTypeNEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNEQ(FieldBizType, v))
}
// BizTypeIn applies the In predicate on the "biz_type" field.
func BizTypeIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldIn(FieldBizType, vs...))
}
// BizTypeNotIn applies the NotIn predicate on the "biz_type" field.
func BizTypeNotIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNotIn(FieldBizType, vs...))
}
// BizTypeGT applies the GT predicate on the "biz_type" field.
func BizTypeGT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGT(FieldBizType, v))
}
// BizTypeGTE applies the GTE predicate on the "biz_type" field.
func BizTypeGTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGTE(FieldBizType, v))
}
// BizTypeLT applies the LT predicate on the "biz_type" field.
func BizTypeLT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLT(FieldBizType, v))
}
// BizTypeLTE applies the LTE predicate on the "biz_type" field.
func BizTypeLTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLTE(FieldBizType, v))
}
// BizTypeContains applies the Contains predicate on the "biz_type" field.
func BizTypeContains(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContains(FieldBizType, v))
}
// BizTypeHasPrefix applies the HasPrefix predicate on the "biz_type" field.
func BizTypeHasPrefix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasPrefix(FieldBizType, v))
}
// BizTypeHasSuffix applies the HasSuffix predicate on the "biz_type" field.
func BizTypeHasSuffix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasSuffix(FieldBizType, v))
}
// BizTypeEqualFold applies the EqualFold predicate on the "biz_type" field.
func BizTypeEqualFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEqualFold(FieldBizType, v))
}
// BizTypeContainsFold applies the ContainsFold predicate on the "biz_type" field.
func BizTypeContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldBizType, v))
}
// BizNoEQ applies the EQ predicate on the "biz_no" field.
func BizNoEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldBizNo, v))
}
// BizNoNEQ applies the NEQ predicate on the "biz_no" field.
func BizNoNEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNEQ(FieldBizNo, v))
}
// BizNoIn applies the In predicate on the "biz_no" field.
func BizNoIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldIn(FieldBizNo, vs...))
}
// BizNoNotIn applies the NotIn predicate on the "biz_no" field.
func BizNoNotIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNotIn(FieldBizNo, vs...))
}
// BizNoGT applies the GT predicate on the "biz_no" field.
func BizNoGT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGT(FieldBizNo, v))
}
// BizNoGTE applies the GTE predicate on the "biz_no" field.
func BizNoGTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGTE(FieldBizNo, v))
}
// BizNoLT applies the LT predicate on the "biz_no" field.
func BizNoLT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLT(FieldBizNo, v))
}
// BizNoLTE applies the LTE predicate on the "biz_no" field.
func BizNoLTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLTE(FieldBizNo, v))
}
// BizNoContains applies the Contains predicate on the "biz_no" field.
func BizNoContains(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContains(FieldBizNo, v))
}
// BizNoHasPrefix applies the HasPrefix predicate on the "biz_no" field.
func BizNoHasPrefix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasPrefix(FieldBizNo, v))
}
// BizNoHasSuffix applies the HasSuffix predicate on the "biz_no" field.
func BizNoHasSuffix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasSuffix(FieldBizNo, v))
}
// BizNoEqualFold applies the EqualFold predicate on the "biz_no" field.
func BizNoEqualFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEqualFold(FieldBizNo, v))
}
// BizNoContainsFold applies the ContainsFold predicate on the "biz_no" field.
func BizNoContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldBizNo, v))
}
// ChainNoEQ applies the EQ predicate on the "chain_no" field.
func ChainNoEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldChainNo, v))
}
// ChainNoNEQ applies the NEQ predicate on the "chain_no" field.
func ChainNoNEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNEQ(FieldChainNo, v))
}
// ChainNoIn applies the In predicate on the "chain_no" field.
func ChainNoIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldIn(FieldChainNo, vs...))
}
// ChainNoNotIn applies the NotIn predicate on the "chain_no" field.
func ChainNoNotIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNotIn(FieldChainNo, vs...))
}
// ChainNoGT applies the GT predicate on the "chain_no" field.
func ChainNoGT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGT(FieldChainNo, v))
}
// ChainNoGTE applies the GTE predicate on the "chain_no" field.
func ChainNoGTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGTE(FieldChainNo, v))
}
// ChainNoLT applies the LT predicate on the "chain_no" field.
func ChainNoLT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLT(FieldChainNo, v))
}
// ChainNoLTE applies the LTE predicate on the "chain_no" field.
func ChainNoLTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLTE(FieldChainNo, v))
}
// ChainNoContains applies the Contains predicate on the "chain_no" field.
func ChainNoContains(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContains(FieldChainNo, v))
}
// ChainNoHasPrefix applies the HasPrefix predicate on the "chain_no" field.
func ChainNoHasPrefix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasPrefix(FieldChainNo, v))
}
// ChainNoHasSuffix applies the HasSuffix predicate on the "chain_no" field.
func ChainNoHasSuffix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasSuffix(FieldChainNo, v))
}
// ChainNoEqualFold applies the EqualFold predicate on the "chain_no" field.
func ChainNoEqualFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEqualFold(FieldChainNo, v))
}
// ChainNoContainsFold applies the ContainsFold predicate on the "chain_no" field.
func ChainNoContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldChainNo, v))
}
// AutoEndEQ applies the EQ predicate on the "auto_end" field.
func AutoEndEQ(v bool) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldAutoEnd, v))
}
// AutoEndNEQ applies the NEQ predicate on the "auto_end" field.
func AutoEndNEQ(v bool) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNEQ(FieldAutoEnd, v))
}
// AgvCodeEQ applies the EQ predicate on the "agv_code" field.
func AgvCodeEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldAgvCode, v))
}
// AgvCodeNEQ applies the NEQ predicate on the "agv_code" field.
func AgvCodeNEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNEQ(FieldAgvCode, v))
}
// AgvCodeIn applies the In predicate on the "agv_code" field.
func AgvCodeIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldIn(FieldAgvCode, vs...))
}
// AgvCodeNotIn applies the NotIn predicate on the "agv_code" field.
func AgvCodeNotIn(vs ...string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldNotIn(FieldAgvCode, vs...))
}
// AgvCodeGT applies the GT predicate on the "agv_code" field.
func AgvCodeGT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGT(FieldAgvCode, v))
}
// AgvCodeGTE applies the GTE predicate on the "agv_code" field.
func AgvCodeGTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldGTE(FieldAgvCode, v))
}
// AgvCodeLT applies the LT predicate on the "agv_code" field.
func AgvCodeLT(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLT(FieldAgvCode, v))
}
// AgvCodeLTE applies the LTE predicate on the "agv_code" field.
func AgvCodeLTE(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldLTE(FieldAgvCode, v))
}
// AgvCodeContains applies the Contains predicate on the "agv_code" field.
func AgvCodeContains(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContains(FieldAgvCode, v))
}
// AgvCodeHasPrefix applies the HasPrefix predicate on the "agv_code" field.
func AgvCodeHasPrefix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasPrefix(FieldAgvCode, v))
}
// AgvCodeHasSuffix applies the HasSuffix predicate on the "agv_code" field.
func AgvCodeHasSuffix(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldHasSuffix(FieldAgvCode, v))
}
// AgvCodeEqualFold applies the EqualFold predicate on the "agv_code" field.
func AgvCodeEqualFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEqualFold(FieldAgvCode, v))
}
// AgvCodeContainsFold applies the ContainsFold predicate on the "agv_code" field.
func AgvCodeContainsFold(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldContainsFold(FieldAgvCode, v))
}
// OperatorEQ applies the EQ predicate on the "operator" field.
func OperatorEQ(v string) predicate.AgvTask {
return predicate.AgvTask(sql.FieldEQ(FieldOperator, v))