feat: 完成区域管理、装箱功能优化与接口标准化
- 新增区域状态字段与增删改查接口,支持区域启用/停用 - 重构实体字段JSON标签为camelCase格式统一接口规范 - 优化入库、盘点、装箱流程的交互与提示文案 - 新增装箱管理功能,支持合同号关联与装箱编辑 - 调整前端菜单与帮助文档适配业务场景变更
This commit is contained in:
@@ -17,13 +17,17 @@ type Zone struct {
|
||||
// ID of the ent.
|
||||
ID int `json:"id,omitempty"`
|
||||
// 区域编码
|
||||
ZoneCode string `json:"zone_code,omitempty"`
|
||||
ZoneCode string `json:"zoneCode,omitempty"`
|
||||
// 区域名称
|
||||
ZoneName string `json:"zone_name,omitempty"`
|
||||
ZoneName string `json:"zoneName,omitempty"`
|
||||
// 描述
|
||||
Description string `json:"description,omitempty"`
|
||||
// 状态:启用/停用
|
||||
Status string `json:"status,omitempty"`
|
||||
// CreatedAt holds the value of the "created_at" field.
|
||||
CreatedAt int64 `json:"created_at,omitempty"`
|
||||
CreatedAt int64 `json:"createdAt,omitempty"`
|
||||
// 更新时间
|
||||
UpdatedAt int64 `json:"updatedAt,omitempty"`
|
||||
selectValues sql.SelectValues
|
||||
}
|
||||
|
||||
@@ -32,9 +36,9 @@ func (*Zone) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case zone.FieldID, zone.FieldCreatedAt:
|
||||
case zone.FieldID, zone.FieldCreatedAt, zone.FieldUpdatedAt:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case zone.FieldZoneCode, zone.FieldZoneName, zone.FieldDescription:
|
||||
case zone.FieldZoneCode, zone.FieldZoneName, zone.FieldDescription, zone.FieldStatus:
|
||||
values[i] = new(sql.NullString)
|
||||
default:
|
||||
values[i] = new(sql.UnknownType)
|
||||
@@ -75,12 +79,24 @@ func (_m *Zone) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
_m.Description = value.String
|
||||
}
|
||||
case zone.FieldStatus:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field status", values[i])
|
||||
} else if value.Valid {
|
||||
_m.Status = value.String
|
||||
}
|
||||
case zone.FieldCreatedAt:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field created_at", values[i])
|
||||
} else if value.Valid {
|
||||
_m.CreatedAt = value.Int64
|
||||
}
|
||||
case zone.FieldUpdatedAt:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field updated_at", values[i])
|
||||
} else if value.Valid {
|
||||
_m.UpdatedAt = value.Int64
|
||||
}
|
||||
default:
|
||||
_m.selectValues.Set(columns[i], values[i])
|
||||
}
|
||||
@@ -126,8 +142,14 @@ func (_m *Zone) String() string {
|
||||
builder.WriteString("description=")
|
||||
builder.WriteString(_m.Description)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("status=")
|
||||
builder.WriteString(_m.Status)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("created_at=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.CreatedAt))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("updated_at=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.UpdatedAt))
|
||||
builder.WriteByte(')')
|
||||
return builder.String()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user