refactor: 清理MES端本地product_type冗余代码,对齐WMS主数据架构
1. 移除MES端本地product_type实体、schema及相关CRUD代码,改为通过WMS内部API代理获取物料主数据 2. 更新物料管理粒度逻辑,新增"其他"类型(3)支持,同步更新入库校验规则 3. 修复前端物料选择、库存筛选等页面的类型判断逻辑,统一使用manage_mode区分管理类型 4. 清理静态资源文件冗余的样式代码,调整前端页面展示逻辑 5. 更新帮助文档,修正物料类型的说明描述
This commit is contained in:
@@ -1,43 +0,0 @@
|
||||
package schema
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"entgo.io/ent"
|
||||
"entgo.io/ent/dialect/entsql"
|
||||
"entgo.io/ent/schema"
|
||||
"entgo.io/ent/schema/field"
|
||||
"entgo.io/ent/schema/index"
|
||||
)
|
||||
|
||||
// ProductType 产品类型
|
||||
type ProductType struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (ProductType) Annotations() []schema.Annotation {
|
||||
return []schema.Annotation{entsql.Annotation{Table: "product_type"}}
|
||||
}
|
||||
|
||||
func (ProductType) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.Int("id").Positive(),
|
||||
field.String("name").MaxLen(50).Comment("产品名称"),
|
||||
field.String("code").MaxLen(20).Comment("产品代号"),
|
||||
field.String("category").Default("").MaxLen(30).Comment("产品分类"),
|
||||
// 原 remark(备注)随 WMS 物料档案「简称」一并删除(2026-09-19);
|
||||
// 改存「规格 / 单位」,与 WMS 物料档案必填口径保持一致(离线兜底缓存)。
|
||||
field.String("spec").Default("").MaxLen(128).Comment("规格型号"),
|
||||
field.String("unit").Default("").MaxLen(32).Comment("单位"),
|
||||
field.Bool("isActive").Default(true),
|
||||
field.Time("createdAt").Default(time.Now).Immutable(),
|
||||
field.Time("updatedAt").Default(time.Now).UpdateDefault(time.Now).Optional().Nillable(),
|
||||
}
|
||||
}
|
||||
|
||||
func (ProductType) Indexes() []ent.Index {
|
||||
return []ent.Index{
|
||||
index.Fields("code"),
|
||||
index.Fields("isActive"),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user