Files
bj_power/bj_power_wms/schema/semi_finished.go
T
SunYF e852c7cd37 chore: 批量完成项目多模块迭代优化
1. 废弃半成品库存表并统一库存主表
2. 修复列表排序与搜索大小写不敏感问题
3. 新增用户最近登录时间、工单BOM名称字段
4. 完善角色管理、工位选择器功能
5. 增加拧紧数据补录、成品自动回流WMS能力
6. 统一导出时间范围校验规则
7. 丰富物料/备料单筛选条件
8. 调整菜单与权限命名适配产品型号业务
2026-09-08 11:44:04 +08:00

37 lines
1.2 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
"entgo.io/ent/schema/index"
)
// SemiFinished 半成品库存
// 【已废弃 2026-09-07】半成品已收编进统一库存主表 inventoriescategory=2),
// 本表仅保留历史数据(存量已迁移),新代码一律读写 inventories,禁止再写本表。
// 记录已完成工序,支持流转
type SemiFinished struct {
ent.Schema
}
func (SemiFinished) Fields() []ent.Field {
return []ent.Field{
field.String("sn").Unique().Comment("半成品 SN"),
field.String("material_code").Optional().Comment("物料编码(MES 未传时按 SN 反查,可空)"),
field.String("completed_process").Optional().Comment("已完成工序(如 135)"),
field.Int("quantity").Default(1).Comment("数量"),
field.String("zone_code").Optional().Comment("所在区域"),
field.String("status").Default("在库").Comment("在库/出库/使用"),
field.String("order_no").Optional().Comment("关联工单"),
field.Int64("created_at").DefaultFunc(nowUnix),
field.Int64("updated_at").DefaultFunc(nowUnix),
}
}
func (SemiFinished) Indexes() []ent.Index {
return []ent.Index{
index.Fields("material_code"),
index.Fields("status"),
}
}