feat(mes/wms): 接驳台编码统一为GW点位码 + 签字模型改报检呼叫 + 台账续流修复 + 末级库位强校验(2026-12-01 终版整改)

【全系统 · 接驳台编码终版统一(12-01 用户拍板)】
- 新增 dockcode 包作为唯一真源:工位接驳台 = GW{工位号}{Z|Y}(Z=左/Y=右,工位1~10同一规则,废除左右互换),库房 = JBT21 不变
- 编码即海康 RCS 地图点位码:落库/界面/下发 RCS/读 PLC 传感器全用同一套;旧 DOCK01~20 全量废弃,系统内无第二套编号、无换算层
- dock 表去 side 字段;agv_task.target_dock、line_point、看板点位态与中文名、dockLabel 工具全部改 GW 规则
- 产线布局说明.md 同步终版(图纸名 GxZ/GxY 与 AGV 码 GWxZ/GWxY 一一对应;注明 RCS 图与主线流向图相差 180°,读图一律以 GW 码为准)

【MES · 签字模型二次重构(11-30 实测后定稿)】
- _OPERATOR 签字整体废除:工艺步骤删 needOperatorSign / needAudit / auditRole 字段,签字角色改 CALL(工人报检呼叫)+ INSPECTOR(检验员审核签)
- 呼叫时落步骤录入快照(stepValue/stepText/stepChecked/processId),供检验员查看与指纹比对;「待签任务」只认检验员签名步骤
- 「签字复核」(AuditPending 页面 + produce.audit 菜单 + 路由)整套删除

【MES · 台账续流根因修复(11-30 对账发现)】
- 流转目标「G6」与 line_point.point_no「6」对不上导致到位落账查不到、却先释放源位→工件从调度消失;新增 ledgerPointByTarget 归一
- settleDirect/settleInTransit 改为先占目标位、成功才释放源位;目标被占原样保留,工件进缓存位排队(实测 C2 排队不再丢件)

【WMS · 末级库位强校验与上架移库】
- 新增 LocationCascade 四级联动选择器(区/架/层/号,只从启用 level=4 节点派生);手工入库、半成品/成品入库、隔离库位一律四级必填且命中启用节点
- 新增上架/移库 relocate:只改四级库位与 updated_at,不动质量状态/数量/锁定量;不合格与锁定行同样允许移库;支持 ids 逐行指定或 scope 按物料+原库位整组搬
- MES 新增 WMS 自动回流库位配置(半成品/成品各一组末级库位,默认值 1区/1架/1层/1号,存 sys_config 可改)

【MES · 统一口径与工程整改】
- 新增 workpiece_location:工单详情工件列表/WIP/追溯三处共用位置判定(SCRAPPED→DONE→SEMI_STORED→在 StationNo→在途→待流转)
- 新增 workorder_close_warn:工单完工/取消时汇总各工位实物余料出一条预警,不阻断关单
- 分页下沉:新增 pagination 工具,同步失败台账(两端)改 Count+LIMIT/OFFSET 真分页,列表不再全量切片
- 全网对账/孤儿扫描(问题临时.md 第25/26节):10 类关系边断言实测,给出 8 条可重复巡检项

【文档】
- 产线布局说明.md 按 GW 编码终版重写;问题临时.md 新增 24.7 闭环实测、25 全网对账、26 补料→配送→报工人库闭环
This commit is contained in:
SunYF
2026-12-01 22:15:28 +08:00
parent f9eaebad28
commit f930a1325f
170 changed files with 8569 additions and 4431 deletions
@@ -29,6 +29,14 @@ const (
FieldSignRole = "sign_role"
// FieldResult holds the string denoting the result field in the database.
FieldResult = "result"
// FieldStepValue holds the string denoting the stepvalue field in the database.
FieldStepValue = "step_value"
// FieldStepText holds the string denoting the steptext field in the database.
FieldStepText = "step_text"
// FieldStepChecked holds the string denoting the stepchecked field in the database.
FieldStepChecked = "step_checked"
// FieldProcessId holds the string denoting the processid field in the database.
FieldProcessId = "process_id"
// FieldSignedBy holds the string denoting the signedby field in the database.
FieldSignedBy = "signed_by"
// FieldSignedAt holds the string denoting the signedat field in the database.
@@ -66,6 +74,10 @@ var Columns = []string{
FieldStepName,
FieldSignRole,
FieldResult,
FieldStepValue,
FieldStepText,
FieldStepChecked,
FieldProcessId,
FieldSignedBy,
FieldSignedAt,
FieldRound,
@@ -118,6 +130,16 @@ var (
DefaultResult string
// ResultValidator is a validator for the "result" field. It is called by the builders before save.
ResultValidator func(string) error
// DefaultStepValue holds the default value on creation for the "stepValue" field.
DefaultStepValue string
// StepValueValidator is a validator for the "stepValue" field. It is called by the builders before save.
StepValueValidator func(string) error
// DefaultStepText holds the default value on creation for the "stepText" field.
DefaultStepText string
// StepTextValidator is a validator for the "stepText" field. It is called by the builders before save.
StepTextValidator func(string) error
// DefaultStepChecked holds the default value on creation for the "stepChecked" field.
DefaultStepChecked bool
// DefaultSignedBy holds the default value on creation for the "signedBy" field.
DefaultSignedBy string
// SignedByValidator is a validator for the "signedBy" field. It is called by the builders before save.
@@ -202,6 +224,26 @@ func ByResult(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldResult, opts...).ToFunc()
}
// ByStepValue orders the results by the stepValue field.
func ByStepValue(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStepValue, opts...).ToFunc()
}
// ByStepText orders the results by the stepText field.
func ByStepText(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStepText, opts...).ToFunc()
}
// ByStepChecked orders the results by the stepChecked field.
func ByStepChecked(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldStepChecked, opts...).ToFunc()
}
// ByProcessId orders the results by the processId field.
func ByProcessId(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldProcessId, opts...).ToFunc()
}
// BySignedBy orders the results by the signedBy field.
func BySignedBy(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSignedBy, opts...).ToFunc()
+210
View File
@@ -94,6 +94,26 @@ func Result(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldResult, v))
}
// StepValue applies equality check predicate on the "stepValue" field. It's identical to StepValueEQ.
func StepValue(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldStepValue, v))
}
// StepText applies equality check predicate on the "stepText" field. It's identical to StepTextEQ.
func StepText(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldStepText, v))
}
// StepChecked applies equality check predicate on the "stepChecked" field. It's identical to StepCheckedEQ.
func StepChecked(v bool) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldStepChecked, v))
}
// ProcessId applies equality check predicate on the "processId" field. It's identical to ProcessIdEQ.
func ProcessId(v int64) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldProcessId, v))
}
// SignedBy applies equality check predicate on the "signedBy" field. It's identical to SignedByEQ.
func SignedBy(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldSignedBy, v))
@@ -619,6 +639,196 @@ func ResultContainsFold(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldContainsFold(FieldResult, v))
}
// StepValueEQ applies the EQ predicate on the "stepValue" field.
func StepValueEQ(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldStepValue, v))
}
// StepValueNEQ applies the NEQ predicate on the "stepValue" field.
func StepValueNEQ(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldNEQ(FieldStepValue, v))
}
// StepValueIn applies the In predicate on the "stepValue" field.
func StepValueIn(vs ...string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldIn(FieldStepValue, vs...))
}
// StepValueNotIn applies the NotIn predicate on the "stepValue" field.
func StepValueNotIn(vs ...string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldNotIn(FieldStepValue, vs...))
}
// StepValueGT applies the GT predicate on the "stepValue" field.
func StepValueGT(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldGT(FieldStepValue, v))
}
// StepValueGTE applies the GTE predicate on the "stepValue" field.
func StepValueGTE(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldGTE(FieldStepValue, v))
}
// StepValueLT applies the LT predicate on the "stepValue" field.
func StepValueLT(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldLT(FieldStepValue, v))
}
// StepValueLTE applies the LTE predicate on the "stepValue" field.
func StepValueLTE(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldLTE(FieldStepValue, v))
}
// StepValueContains applies the Contains predicate on the "stepValue" field.
func StepValueContains(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldContains(FieldStepValue, v))
}
// StepValueHasPrefix applies the HasPrefix predicate on the "stepValue" field.
func StepValueHasPrefix(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldHasPrefix(FieldStepValue, v))
}
// StepValueHasSuffix applies the HasSuffix predicate on the "stepValue" field.
func StepValueHasSuffix(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldHasSuffix(FieldStepValue, v))
}
// StepValueEqualFold applies the EqualFold predicate on the "stepValue" field.
func StepValueEqualFold(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEqualFold(FieldStepValue, v))
}
// StepValueContainsFold applies the ContainsFold predicate on the "stepValue" field.
func StepValueContainsFold(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldContainsFold(FieldStepValue, v))
}
// StepTextEQ applies the EQ predicate on the "stepText" field.
func StepTextEQ(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldStepText, v))
}
// StepTextNEQ applies the NEQ predicate on the "stepText" field.
func StepTextNEQ(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldNEQ(FieldStepText, v))
}
// StepTextIn applies the In predicate on the "stepText" field.
func StepTextIn(vs ...string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldIn(FieldStepText, vs...))
}
// StepTextNotIn applies the NotIn predicate on the "stepText" field.
func StepTextNotIn(vs ...string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldNotIn(FieldStepText, vs...))
}
// StepTextGT applies the GT predicate on the "stepText" field.
func StepTextGT(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldGT(FieldStepText, v))
}
// StepTextGTE applies the GTE predicate on the "stepText" field.
func StepTextGTE(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldGTE(FieldStepText, v))
}
// StepTextLT applies the LT predicate on the "stepText" field.
func StepTextLT(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldLT(FieldStepText, v))
}
// StepTextLTE applies the LTE predicate on the "stepText" field.
func StepTextLTE(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldLTE(FieldStepText, v))
}
// StepTextContains applies the Contains predicate on the "stepText" field.
func StepTextContains(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldContains(FieldStepText, v))
}
// StepTextHasPrefix applies the HasPrefix predicate on the "stepText" field.
func StepTextHasPrefix(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldHasPrefix(FieldStepText, v))
}
// StepTextHasSuffix applies the HasSuffix predicate on the "stepText" field.
func StepTextHasSuffix(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldHasSuffix(FieldStepText, v))
}
// StepTextEqualFold applies the EqualFold predicate on the "stepText" field.
func StepTextEqualFold(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEqualFold(FieldStepText, v))
}
// StepTextContainsFold applies the ContainsFold predicate on the "stepText" field.
func StepTextContainsFold(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldContainsFold(FieldStepText, v))
}
// StepCheckedEQ applies the EQ predicate on the "stepChecked" field.
func StepCheckedEQ(v bool) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldStepChecked, v))
}
// StepCheckedNEQ applies the NEQ predicate on the "stepChecked" field.
func StepCheckedNEQ(v bool) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldNEQ(FieldStepChecked, v))
}
// ProcessIdEQ applies the EQ predicate on the "processId" field.
func ProcessIdEQ(v int64) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldProcessId, v))
}
// ProcessIdNEQ applies the NEQ predicate on the "processId" field.
func ProcessIdNEQ(v int64) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldNEQ(FieldProcessId, v))
}
// ProcessIdIn applies the In predicate on the "processId" field.
func ProcessIdIn(vs ...int64) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldIn(FieldProcessId, vs...))
}
// ProcessIdNotIn applies the NotIn predicate on the "processId" field.
func ProcessIdNotIn(vs ...int64) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldNotIn(FieldProcessId, vs...))
}
// ProcessIdGT applies the GT predicate on the "processId" field.
func ProcessIdGT(v int64) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldGT(FieldProcessId, v))
}
// ProcessIdGTE applies the GTE predicate on the "processId" field.
func ProcessIdGTE(v int64) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldGTE(FieldProcessId, v))
}
// ProcessIdLT applies the LT predicate on the "processId" field.
func ProcessIdLT(v int64) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldLT(FieldProcessId, v))
}
// ProcessIdLTE applies the LTE predicate on the "processId" field.
func ProcessIdLTE(v int64) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldLTE(FieldProcessId, v))
}
// ProcessIdIsNil applies the IsNil predicate on the "processId" field.
func ProcessIdIsNil() predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldIsNull(FieldProcessId))
}
// ProcessIdNotNil applies the NotNil predicate on the "processId" field.
func ProcessIdNotNil() predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldNotNull(FieldProcessId))
}
// SignedByEQ applies the EQ predicate on the "signedBy" field.
func SignedByEQ(v string) predicate.StepSignRecord {
return predicate.StepSignRecord(sql.FieldEQ(FieldSignedBy, v))