feat(mes): 添加定时同步可生产数量到WMS及BOM项相关标准字段
- 在main.go中添加定时任务每10分钟同步可生产数量到WMS系统 - 为BomItem实体添加relatedStandard字段及相关CRUD方法 - 为InspectionRecord实体添加reportNo、materialCode、materialName等字段 - 更新ent schema确保新字段的验证和默认值设置 - 添加必要的数据库迁移和字段映射逻辑
This commit is contained in:
@@ -5,17 +5,19 @@ import (
|
||||
"entgo.io/ent/schema/field"
|
||||
)
|
||||
|
||||
// Zone 库房区域
|
||||
// 客户诉求(问题记录 L32/L169 + 本轮 D5):区域要能定位到「货架号 + 第几层 + 位置号」,
|
||||
// 且用户明确"编码规则手填"(L584)——故仅加三个可填文本字段,不做编号规则校验、不做级联实体。
|
||||
// 完整库位串 = 区域编码 / 货架号 / 层 / 位置号(示例 Z01 / A / 3 / 12)。
|
||||
// Zone 库房货位主数据(区域 → 货架 → 层 → 位置 四级)
|
||||
// 客户诉求(问题记录 L32/L169 + U18):货位按「区域(zone_code) + 货架号 + 第几层 + 位置号」四级定位,
|
||||
// 四级均手填、不做编号规则校验(L584)。每一行 = 一个货位。
|
||||
// zone_code 只是四级中的“区域”这一级,同一区域下可有多个货位,故 zone_code 不再单列唯一;
|
||||
// 货位唯一性由组合唯一索引 ux_zones_location(zone_code, shelf_no, layer_no, position_no) 保证
|
||||
// (见 internal/db/db.go applyColumnPatches,用 COALESCE 归一空值,防止同一货位重复登记)。
|
||||
type Zone struct {
|
||||
ent.Schema
|
||||
}
|
||||
|
||||
func (Zone) Fields() []ent.Field {
|
||||
return []ent.Field{
|
||||
field.String("zone_code").Unique().Comment("区域编码"),
|
||||
field.String("zone_code").Comment("区域编码(货位四级第一级;同区域可多货位,故不单列唯一)"),
|
||||
field.String("zone_name").Comment("区域名称"),
|
||||
field.String("description").Optional().Comment("描述"),
|
||||
// 货架号(手填,如 A/03)
|
||||
|
||||
Reference in New Issue
Block a user