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
+1 -1
View File
@@ -26,7 +26,7 @@ type InboundOrder struct {
MaterialName string `json:"materialName,omitempty"`
// 类型 1结构件/2电气件/3其他
ManageMode int `json:"manageMode,omitempty"`
// SN管理 1序列号件(逐件SN)/2批次件(数量)/0未选择
// 序列号 1=是(逐件SN)/2=否(按批次数量)/0未选择
SnMode int `json:"snMode,omitempty"`
// 批次号(结构件)
BatchNo string `json:"batchNo,omitempty"`
+2 -2
View File
@@ -44,9 +44,9 @@ type InspectionRecord struct {
InspectQty int `json:"inspectQty,omitempty"`
// 合格数量(≤检验数量)
PassQty int `json:"passQty,omitempty"`
// 第几批(批次件来料检验必填≥1,0=未填)
// 第几批(序列号=否来料检验必填≥1,0=未填)
BatchSeq int `json:"batchSeq,omitempty"`
// 共几件(批次件来料检验必填≥1,0=未填)
// 共几件(序列号=否来料检验必填≥1,0=未填)
BatchTotal int `json:"batchTotal,omitempty"`
// 不合格数量(=检验数量-合格数量)
RejectQty int `json:"rejectQty,omitempty"`
+7 -7
View File
@@ -18,21 +18,21 @@ type Inventory struct {
ID int `json:"id,omitempty"`
// 类型 1结构件/2电气件/3其他
ManageMode int `json:"manageMode,omitempty"`
// SN管理 1序列号件(逐件SN)/2批次件(数量)/0未选择
// 序列号 1=是(逐件SN)/2=否(按批次数量)/0未选择
SnMode int `json:"snMode,omitempty"`
// 品类 1=原材料 2=半成品 3=成品
// 物料类别 1=原材料 2=半成品 3=成品
Category int `json:"category,omitempty"`
// 物料编码(关联 materials 表)
MaterialCode string `json:"materialCode,omitempty"`
// 物料名称(冗余,便于直接展示)
MaterialName string `json:"materialName,omitempty"`
// 批次号(系统生成);序列号件可关联所属批次
// 批次号(系统生成);序列号=是可关联所属批次
BatchNo string `json:"batchNo,omitempty"`
// 序列号(SN,仅序列号件);全局唯一,空值表示非 SN 行
// 序列号(SN,仅序列号=是);全局唯一,空值表示非 SN 行
SnCode string `json:"snCode,omitempty"`
// 数量:批次件=批次余量;序列号件=1
// 数量:序列号=否=批次余量;序列号=是=1
Quantity int `json:"quantity,omitempty"`
// 已锁定数量(库存占用):批次件=件数;序列号件=0/1
// 已锁定数量(库存占用):序列号=否=件数;序列号=是=0/1
LockedQty int `json:"lockedQty,omitempty"`
// 检验状态 未检/合格/不合格
QualityStatus string `json:"qualityStatus,omitempty"`
@@ -44,7 +44,7 @@ type Inventory struct {
LayerNo string `json:"layerNo,omitempty"`
// 位置号(手填,如 12)
PositionNo string `json:"positionNo,omitempty"`
// 生命周期:在库/锁定/出库/使用/报废(序列号件用;批次件恒在库)
// 生命周期:在库/锁定/出库/使用/报废(序列号=是用;序列号=否恒在库)。使用=预留未启用:原 SN 件产线在制态,现统一走「出库」,枚举值保留不动以保持兼容
Status string `json:"status,omitempty"`
// 生产日期
ProductionDate string `json:"productionDate,omitempty"`
+2 -2
View File
@@ -26,11 +26,11 @@ type Material struct {
Unit string `json:"unit,omitempty"`
// 描述
Description string `json:"description,omitempty"`
// 品类 1原材料/3成品/4其他(半成品不是物料品类,由库存 category=2 承载)
// 物料类别 1原材料/3成品/4其他(半成品不是物料类别,由库存 category=2 承载)
ItemType int `json:"itemType,omitempty"`
// 类型 1结构件/2电气件/3其他
ManageMode int `json:"manageMode,omitempty"`
// SN管理 1序列号件(逐件SN)/2批次件(数量)/0未选择
// SN管理 1序列号=是(逐件SN)/2序列号=否(数量)/0未选择
SnMode int `json:"snMode,omitempty"`
// 是否批次管理(按 sn_mode=2 派生)
IsBatchManaged bool `json:"isBatchManaged,omitempty"`
+13 -13
View File
@@ -175,7 +175,7 @@ var (
{Name: "material_code", Type: field.TypeString, Comment: "物料编码"},
{Name: "material_name", Type: field.TypeString, Nullable: true, Comment: "物料名称(冗余)"},
{Name: "manage_mode", Type: field.TypeInt, Comment: "类型 1结构件/2电气件/3其他", Default: 1},
{Name: "sn_mode", Type: field.TypeInt, Comment: "SN管理 1序列号件(逐件SN)/2批次件(数量)/0未选择", Default: 0},
{Name: "sn_mode", Type: field.TypeInt, Comment: "序列号 1=是(逐件SN)/2=否(按批次数量)/0未选择", Default: 0},
{Name: "batch_no", Type: field.TypeString, Nullable: true, Comment: "批次号(结构件)"},
{Name: "zone_code", Type: field.TypeString, Nullable: true, Comment: "入库区域(大区)"},
{Name: "shelf_no", Type: field.TypeString, Nullable: true, Comment: "货架号(如 A)"},
@@ -236,8 +236,8 @@ var (
{Name: "result_value", Type: field.TypeString, Nullable: true, Comment: "实测值(部分检验项)"},
{Name: "inspect_qty", Type: field.TypeInt, Comment: "检验数量(抽检件数)", Default: 0},
{Name: "pass_qty", Type: field.TypeInt, Comment: "合格数量(≤检验数量)", Default: 0},
{Name: "batch_seq", Type: field.TypeInt, Comment: "第几批(批次件来料检验必填≥1,0=未填)", Default: 0},
{Name: "batch_total", Type: field.TypeInt, Comment: "共几件(批次件来料检验必填≥1,0=未填)", Default: 0},
{Name: "batch_seq", Type: field.TypeInt, Comment: "第几批(序列号=否来料检验必填≥1,0=未填)", Default: 0},
{Name: "batch_total", Type: field.TypeInt, Comment: "共几件(序列号=否来料检验必填≥1,0=未填)", Default: 0},
{Name: "reject_qty", Type: field.TypeInt, Comment: "不合格数量(=检验数量-合格数量)", Default: 0},
{Name: "check_desc", Type: field.TypeString, Nullable: true, Comment: "检测说明(检验项目/方法)"},
{Name: "inspector", Type: field.TypeString, Nullable: true, Comment: "检验人"},
@@ -283,20 +283,20 @@ var (
InventoriesColumns = []*schema.Column{
{Name: "id", Type: field.TypeInt, Increment: true},
{Name: "manage_mode", Type: field.TypeInt, Comment: "类型 1结构件/2电气件/3其他"},
{Name: "sn_mode", Type: field.TypeInt, Comment: "SN管理 1序列号件(逐件SN)/2批次件(数量)/0未选择", Default: 0},
{Name: "category", Type: field.TypeInt, Comment: "品类 1=原材料 2=半成品 3=成品", Default: 1},
{Name: "sn_mode", Type: field.TypeInt, Comment: "序列号 1=是(逐件SN)/2=否(按批次数量)/0未选择", Default: 0},
{Name: "category", Type: field.TypeInt, Comment: "物料类别 1=原材料 2=半成品 3=成品", Default: 1},
{Name: "material_code", Type: field.TypeString, Comment: "物料编码(关联 materials 表)"},
{Name: "material_name", Type: field.TypeString, Nullable: true, Comment: "物料名称(冗余,便于直接展示)"},
{Name: "batch_no", Type: field.TypeString, Nullable: true, Comment: "批次号(系统生成);序列号件可关联所属批次"},
{Name: "sn_code", Type: field.TypeString, Nullable: true, Comment: "序列号(SN,仅序列号件);全局唯一,空值表示非 SN 行"},
{Name: "quantity", Type: field.TypeInt, Comment: "数量:批次件=批次余量;序列号件=1", Default: 0},
{Name: "locked_qty", Type: field.TypeInt, Comment: "已锁定数量(库存占用):批次件=件数;序列号件=0/1", Default: 0},
{Name: "batch_no", Type: field.TypeString, Nullable: true, Comment: "批次号(系统生成);序列号=是可关联所属批次"},
{Name: "sn_code", Type: field.TypeString, Nullable: true, Comment: "序列号(SN,仅序列号=是);全局唯一,空值表示非 SN 行"},
{Name: "quantity", Type: field.TypeInt, Comment: "数量:序列号=否=批次余量;序列号=是=1", Default: 0},
{Name: "locked_qty", Type: field.TypeInt, Comment: "已锁定数量(库存占用):序列号=否=件数;序列号=是=0/1", Default: 0},
{Name: "quality_status", Type: field.TypeString, Comment: "检验状态 未检/合格/不合格", Default: "未检"},
{Name: "zone_code", Type: field.TypeString, Nullable: true, Comment: "所在区域(Z01~Z04 大分区)"},
{Name: "shelf_no", Type: field.TypeString, Nullable: true, Comment: "货架号(手填,如 A)"},
{Name: "layer_no", Type: field.TypeString, Nullable: true, Comment: "第几层(手填,如 3)"},
{Name: "position_no", Type: field.TypeString, Nullable: true, Comment: "位置号(手填,如 12)"},
{Name: "status", Type: field.TypeString, Comment: "生命周期:在库/锁定/出库/使用/报废(序列号件用;批次件恒在库)", Default: "在库"},
{Name: "status", Type: field.TypeString, Comment: "生命周期:在库/锁定/出库/使用/报废(序列号=是用;序列号=否恒在库)。使用=预留未启用:原 SN 件产线在制态,现统一走「出库」,枚举值保留不动以保持兼容", Default: "在库"},
{Name: "production_date", Type: field.TypeString, Nullable: true, Comment: "生产日期"},
{Name: "supplier", Type: field.TypeString, Nullable: true, Comment: "供应商"},
{Name: "inbound_no", Type: field.TypeString, Nullable: true, Comment: "关联入库单号"},
@@ -411,9 +411,9 @@ var (
{Name: "spec", Type: field.TypeString, Nullable: true, Comment: "规格型号"},
{Name: "unit", Type: field.TypeString, Nullable: true, Comment: "单位"},
{Name: "description", Type: field.TypeString, Nullable: true, Comment: "描述"},
{Name: "item_type", Type: field.TypeInt, Comment: "品类 1原材料/3成品/4其他(半成品不是物料品类,由库存 category=2 承载)", Default: 1},
{Name: "item_type", Type: field.TypeInt, Comment: "物料类别 1原材料/3成品/4其他(半成品不是物料类别,由库存 category=2 承载)", Default: 1},
{Name: "manage_mode", Type: field.TypeInt, Comment: "类型 1结构件/2电气件/3其他", Default: 1},
{Name: "sn_mode", Type: field.TypeInt, Comment: "SN管理 1序列号件(逐件SN)/2批次件(数量)/0未选择", Default: 0},
{Name: "sn_mode", Type: field.TypeInt, Comment: "SN管理 1序列号=是(逐件SN)/2序列号=否(数量)/0未选择", Default: 0},
{Name: "is_batch_managed", Type: field.TypeBool, Comment: "是否批次管理(按 sn_mode=2 派生)", Default: false},
{Name: "is_serial_managed", Type: field.TypeBool, Comment: "是否序列号管理(按 sn_mode=1 派生)", Default: false},
{Name: "template_code", Type: field.TypeString, Nullable: true, Comment: "物料模板编码(物料种类)"},
@@ -546,7 +546,7 @@ var (
{Name: "material_code", Type: field.TypeString, Comment: "物料编码"},
{Name: "material_name", Type: field.TypeString, Nullable: true, Comment: "物料名称(冗余)"},
{Name: "manage_mode", Type: field.TypeInt, Comment: "类型 1结构件/2电气件/3其他", Default: 1},
{Name: "sn_mode", Type: field.TypeInt, Comment: "SN管理 1序列号件(逐件SN)/2批次件(数量)/0未选择", Default: 0},
{Name: "sn_mode", Type: field.TypeInt, Comment: "SN管理 1序列号=是(逐件SN)/2序列号=否(数量)/0未选择", Default: 0},
{Name: "batch_no", Type: field.TypeString, Nullable: true, Comment: "批次号(结构件)"},
{Name: "zone_code", Type: field.TypeString, Nullable: true, Comment: "出库区域(大区)"},
{Name: "shelf_no", Type: field.TypeString, Nullable: true, Comment: "货架号(与入库同口径)"},
+1 -1
View File
@@ -40,7 +40,7 @@ type OutboundOrder struct {
MaterialName string `json:"materialName,omitempty"`
// 类型 1结构件/2电气件/3其他
ManageMode int `json:"manageMode,omitempty"`
// SN管理 1序列号件(逐件SN)/2批次件(数量)/0未选择
// SN管理 1序列号=是(逐件SN)/2序列号=否(数量)/0未选择
SnMode int `json:"snMode,omitempty"`
// 批次号(结构件)
BatchNo string `json:"batchNo,omitempty"`