feat: 新增预警定时扫描器,移除附件归档字段并为角色表补充更新时间
This commit is contained in:
@@ -323,24 +323,22 @@ func (s *Service) ListWorkpieceBinds(ctx context.Context, sn string) ([]*ent.Wor
|
||||
return q.Order(ent.Asc(workpiecebind.FieldFlowId), ent.Asc(workpiecebind.FieldID)).Limit(2000).All(ctx)
|
||||
}
|
||||
|
||||
// BindTraceVO 追溯页:装机绑定明细 + 每工艺齐套状态 + 物料组成树
|
||||
// BindTraceVO 追溯页:装机绑定明细 + 每工艺齐套状态 + 装机物料明细
|
||||
type BindTraceVO struct {
|
||||
Binds []*ent.WorkpieceBind `json:"binds"`
|
||||
Complete bool `json:"complete"`
|
||||
Missing string `json:"missing"`
|
||||
BomTree []BindNode `json:"bomTree"` // 递归展开成品零部件到叶子的物料组成树
|
||||
BomTree []BindNode `json:"bomTree"` // 装机物料明细(按工单工艺组合×工艺物料清单平铺一层,无多级树)
|
||||
}
|
||||
|
||||
// BindNode 追溯用的物料组成节点(递归展开成品零部件,不依赖 WMS)
|
||||
// BindNode 追溯用的装机物料明细节点(平铺一层;多级 BOM 已于 2026-09-23 退役,无下级展开)
|
||||
type BindNode struct {
|
||||
MaterialCode string `json:"materialCode"`
|
||||
MaterialName string `json:"materialName"`
|
||||
Spec string `json:"spec"`
|
||||
Unit string `json:"unit"`
|
||||
SnMode int `json:"snMode"` // 1 序列号=是 / 2 序列号=否
|
||||
Qty float64 `json:"qty"` // 折算到单台成品的用量
|
||||
Level int `json:"level"` // 0=顶层装配物料,1+=下级
|
||||
Children []BindNode `json:"children,omitempty"`
|
||||
MaterialCode string `json:"materialCode"`
|
||||
MaterialName string `json:"materialName"`
|
||||
Spec string `json:"spec"`
|
||||
Unit string `json:"unit"`
|
||||
SnMode int `json:"snMode"` // 1 序列号=是 / 2 序列号=否
|
||||
Qty float64 `json:"qty"` // 折算到单台成品的用量
|
||||
}
|
||||
|
||||
// BuildBindTrace 组装某工件装机绑定追溯(含全工艺齐套状态 + 物料组成树,供成品档案/追溯页展示)
|
||||
@@ -363,7 +361,7 @@ func (s *Service) BuildBindTrace(ctx context.Context, sn string) (*BindTraceVO,
|
||||
tree = append(tree, BindNode{
|
||||
MaterialCode: it.MaterialCode, MaterialName: it.MaterialName,
|
||||
Spec: it.Spec, Unit: it.Unit, SnMode: it.SnMode,
|
||||
Qty: it.UnitQty, Level: 0,
|
||||
Qty: it.UnitQty,
|
||||
})
|
||||
}
|
||||
return &BindTraceVO{Binds: binds, Complete: missing == "", Missing: missing, BomTree: tree}, nil
|
||||
|
||||
Reference in New Issue
Block a user