docs: 统一修正全项目“SN管理”相关术语为“序列号”

本次 commit 统一修正了全项目范围内关于 SN 管理的术语表述,将原“SN管理”、“序列号件”、“批次件”等表述调整为“序列号”、“序列号=是”、“序列号=否”,同时同步更新了相关文档、代码注释、前端提示文本、数据库 schema 注释、API 文档等,确保全链路术语统一,消除理解歧义。
This commit is contained in:
SunYF
2026-10-10 15:58:59 +08:00
parent b032f47fc7
commit 8be6e03a15
335 changed files with 5742 additions and 1616 deletions
+31 -3
View File
@@ -48,7 +48,7 @@ type FlowVO struct {
CreatedAt time.Time `json:"createdAt"`
}
// ListFlows 查询工艺流程(可按工位号过滤:只认「关联工位」页的绑定关系 station.flow_id;
// ListFlows 查询工艺流程(可按工位号过滤:只认「工位绑定」页的绑定关系 station.flow_id;
// pp 非空时按引用该工艺的产品工艺名称反查过滤)。page>0 时真分页返回 map{total,list,page,pageSize}(管理页用);page=0 全量数组(工位终端兼容)
func (s *Service) ListFlows(ctx context.Context, stationNo int, pp string, page, pageSize int) (any, error) {
q := s.ctx.EntClient.ProcessFlow.Query().
@@ -419,6 +419,34 @@ func (s *Service) DeleteStation(ctx context.Context, id int, operator string) er
return nil
}
// SetStationStatus 工位启用/停用(切换 station status:ENABLED/DISABLED)。
// 内置/非内置均可切换;停用不影响历史引用(行保留),仅影响该工位能否被流程选用与终端拉取。
func (s *Service) SetStationStatus(ctx context.Context, id int, status, operator string) error {
if id <= 0 {
return errors.New("缺少 id")
}
if status != "ENABLED" && status != "DISABLED" {
return errors.New("非法状态")
}
st, err := s.ctx.EntClient.Station.Get(ctx, id)
if err != nil {
return errors.New("工位不存在")
}
if st.Status == status {
return nil
}
if err := s.ctx.EntClient.Station.UpdateOneID(id).SetStatus(status).Exec(ctx); err != nil {
return err
}
action := "停用工位"
if status == "ENABLED" {
action = "启用工位"
}
s.ctx.EventLog.Write(ctx, "station.status", "", operator, "station", fmt.Sprint(id), action,
map[string]any{"id": id, "stationNo": st.StationNo, "status": status})
return nil
}
// SetFlowStatus 工艺流程启用/停用。
// 新语义:绑定关系由「保存流程」显式维护(一个流程可绑多工位),启停只切换流程状态,
// 不再自动解绑/绑定工位;停用流程对已绑定工位不可用(工位取步骤时按 ACTIVE 过滤)。
@@ -479,7 +507,7 @@ func (s *Service) StationTask(ctx context.Context, stationNo int) (map[string]an
}
}
// M4:工位终端按「本工位绑定的工艺流程」驱动。
// 产线定义 = 关联工位(station.flow_id)+ 工位号 1→12 顺序,已无独立"工艺路线/路线段"对象。
// 产线定义 = 工位绑定(station.flow_id)+ 工位号 1→12 顺序,已无独立"工艺路线/路线段"对象。
// 本工位要干哪些步骤,完全取决于 station.flow_id 指向的流程图,工单的 processSeq 只决定走哪些工位。
activeFlowId := st.FlowId
var flow *ent.ProcessFlow
@@ -816,7 +844,7 @@ type FlowMaterialReq struct {
MaterialName string `json:"materialName"`
Spec string `json:"spec"`
Unit string `json:"unit"`
SnMode int `json:"snMode"` // 是否逐件SN管理 1序列号件(录SN)/2批次件(冗余自物料档案)
SnMode int `json:"snMode"` // 是否逐件SN管理 1序列号=是(录SN)/2序列号=否(冗余自物料档案)
UnitQty float64 `json:"unitQty"` // 单台用量
LossRate float64 `json:"lossRate"` // 损耗率(%)
}