Files
bj_power/bj_power_wms/ent/material/material.go
T
SunYF 0ab21b1234 feat&refactor: 完成多模块功能迭代与配置优化
本次提交覆盖多个业务模块的功能完善与体验优化:
1.  **鉴权与配置调整**:
    - 统一JWT滑动续签逻辑,简化Token存储,移除RefreshToken相关冗余代码
    - 调整多项目配置文件中JWT过期时间为3600秒,统一会话闲置窗口
    - 工位配置放开1~12限制,改为仅校验大于0
2.  **术语统一替换**:全链路将"精密件"替换为"电气件",修正物料管理描述
3.  **功能新增**:
    - 新增工位类型、工艺路线与产线点位台账模块
    - 添加工艺PDF预览面板、工位终端代理转发接口
    - 新增操作日志按操作人列表筛选、工位登出日志记录
    - 新增PLC移料指令与产线点位状态管理
4.  **业务流程优化**:
    - 调整BOM物料删除校验逻辑,优化工单备料计算
    - 补充物料图号、检测单号等追溯字段
    - 完善工艺流程图与工位绑定关系说明
    - 优化前端页面文案与交互细节
5.  **代码规范与维护**:
    - 新增通用工具函数与前端静态资源
    - 整理路由权限与中间件逻辑
    - 修复部分接口与配置的不兼容问题
2026-09-10 16:59:15 +08:00

177 lines
6.2 KiB
Go

// Code generated by ent, DO NOT EDIT.
package material
import (
"entgo.io/ent/dialect/sql"
)
const (
// Label holds the string label denoting the material type in the database.
Label = "material"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCode holds the string denoting the code field in the database.
FieldCode = "code"
// FieldName holds the string denoting the name field in the database.
FieldName = "name"
// FieldShortName holds the string denoting the short_name field in the database.
FieldShortName = "short_name"
// FieldSpec holds the string denoting the spec field in the database.
FieldSpec = "spec"
// FieldUnit holds the string denoting the unit field in the database.
FieldUnit = "unit"
// FieldDescription holds the string denoting the description field in the database.
FieldDescription = "description"
// FieldItemType holds the string denoting the item_type field in the database.
FieldItemType = "item_type"
// FieldManageMode holds the string denoting the manage_mode field in the database.
FieldManageMode = "manage_mode"
// FieldIsBatchManaged holds the string denoting the is_batch_managed field in the database.
FieldIsBatchManaged = "is_batch_managed"
// FieldIsSerialManaged holds the string denoting the is_serial_managed field in the database.
FieldIsSerialManaged = "is_serial_managed"
// FieldTemplateCode holds the string denoting the template_code field in the database.
FieldTemplateCode = "template_code"
// FieldDrawingNo holds the string denoting the drawing_no field in the database.
FieldDrawingNo = "drawing_no"
// FieldIsActive holds the string denoting the is_active field in the database.
FieldIsActive = "is_active"
// FieldCreatedAt holds the string denoting the created_at field in the database.
FieldCreatedAt = "created_at"
// FieldUpdatedAt holds the string denoting the updated_at field in the database.
FieldUpdatedAt = "updated_at"
// Table holds the table name of the material in the database.
Table = "materials"
)
// Columns holds all SQL columns for material fields.
var Columns = []string{
FieldID,
FieldCode,
FieldName,
FieldShortName,
FieldSpec,
FieldUnit,
FieldDescription,
FieldItemType,
FieldManageMode,
FieldIsBatchManaged,
FieldIsSerialManaged,
FieldTemplateCode,
FieldDrawingNo,
FieldIsActive,
FieldCreatedAt,
FieldUpdatedAt,
}
// ValidColumn reports if the column name is valid (part of the table columns).
func ValidColumn(column string) bool {
for i := range Columns {
if column == Columns[i] {
return true
}
}
return false
}
var (
// DefaultItemType holds the default value on creation for the "item_type" field.
DefaultItemType int
// DefaultManageMode holds the default value on creation for the "manage_mode" field.
DefaultManageMode int
// DefaultIsBatchManaged holds the default value on creation for the "is_batch_managed" field.
DefaultIsBatchManaged bool
// DefaultIsSerialManaged holds the default value on creation for the "is_serial_managed" field.
DefaultIsSerialManaged bool
// DefaultIsActive holds the default value on creation for the "is_active" field.
DefaultIsActive bool
// DefaultCreatedAt holds the default value on creation for the "created_at" field.
DefaultCreatedAt func() int64
// DefaultUpdatedAt holds the default value on creation for the "updated_at" field.
DefaultUpdatedAt func() int64
)
// OrderOption defines the ordering options for the Material queries.
type OrderOption func(*sql.Selector)
// ByID orders the results by the id field.
func ByID(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldID, opts...).ToFunc()
}
// ByCode orders the results by the code field.
func ByCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCode, opts...).ToFunc()
}
// ByName orders the results by the name field.
func ByName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldName, opts...).ToFunc()
}
// ByShortName orders the results by the short_name field.
func ByShortName(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldShortName, opts...).ToFunc()
}
// BySpec orders the results by the spec field.
func BySpec(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldSpec, opts...).ToFunc()
}
// ByUnit orders the results by the unit field.
func ByUnit(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUnit, opts...).ToFunc()
}
// ByDescription orders the results by the description field.
func ByDescription(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDescription, opts...).ToFunc()
}
// ByItemType orders the results by the item_type field.
func ByItemType(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldItemType, opts...).ToFunc()
}
// ByManageMode orders the results by the manage_mode field.
func ByManageMode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldManageMode, opts...).ToFunc()
}
// ByIsBatchManaged orders the results by the is_batch_managed field.
func ByIsBatchManaged(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsBatchManaged, opts...).ToFunc()
}
// ByIsSerialManaged orders the results by the is_serial_managed field.
func ByIsSerialManaged(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsSerialManaged, opts...).ToFunc()
}
// ByTemplateCode orders the results by the template_code field.
func ByTemplateCode(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldTemplateCode, opts...).ToFunc()
}
// ByDrawingNo orders the results by the drawing_no field.
func ByDrawingNo(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldDrawingNo, opts...).ToFunc()
}
// ByIsActive orders the results by the is_active field.
func ByIsActive(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldIsActive, opts...).ToFunc()
}
// ByCreatedAt orders the results by the created_at field.
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
}
// ByUpdatedAt orders the results by the updated_at field.
func ByUpdatedAt(opts ...sql.OrderTermOption) OrderOption {
return sql.OrderByField(FieldUpdatedAt, opts...).ToFunc()
}