feat: 新增装机绑定功能与权限、BOM工序配置
1. 新增装机绑定实体与相关CRUD逻辑,支持工件工序物料绑定/解绑 2. 为BOM物料新增装配工序字段,支持按工序校验绑定 3. 扩展权限表,新增父权限码字段支持菜单按钮关联 4. 统一各页面帮助弹窗参数,新增角色管理帮助文档 5. 新增公共格式化工具函数,优化侧边栏菜单展开逻辑 6. 新增工位终端绑定代理接口与MES内部绑定API 7. 修复主入口数据库连接与schema初始化逻辑,新增一键迁移工具
This commit is contained in:
@@ -46,6 +46,20 @@ func (_c *PermissionCreate) SetNillableType(v *string) *PermissionCreate {
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetParentCode sets the "parentCode" field.
|
||||
func (_c *PermissionCreate) SetParentCode(v string) *PermissionCreate {
|
||||
_c.mutation.SetParentCode(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableParentCode sets the "parentCode" field if the given value is not nil.
|
||||
func (_c *PermissionCreate) SetNillableParentCode(v *string) *PermissionCreate {
|
||||
if v != nil {
|
||||
_c.SetParentCode(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetPath sets the "path" field.
|
||||
func (_c *PermissionCreate) SetPath(v string) *PermissionCreate {
|
||||
_c.mutation.SetPath(v)
|
||||
@@ -161,6 +175,10 @@ func (_c *PermissionCreate) defaults() {
|
||||
v := permission.DefaultType
|
||||
_c.mutation.SetType(v)
|
||||
}
|
||||
if _, ok := _c.mutation.ParentCode(); !ok {
|
||||
v := permission.DefaultParentCode
|
||||
_c.mutation.SetParentCode(v)
|
||||
}
|
||||
if _, ok := _c.mutation.Path(); !ok {
|
||||
v := permission.DefaultPath
|
||||
_c.mutation.SetPath(v)
|
||||
@@ -209,6 +227,14 @@ func (_c *PermissionCreate) check() error {
|
||||
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Permission.type": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.ParentCode(); !ok {
|
||||
return &ValidationError{Name: "parentCode", err: errors.New(`ent: missing required field "Permission.parentCode"`)}
|
||||
}
|
||||
if v, ok := _c.mutation.ParentCode(); ok {
|
||||
if err := permission.ParentCodeValidator(v); err != nil {
|
||||
return &ValidationError{Name: "parentCode", err: fmt.Errorf(`ent: validator failed for field "Permission.parentCode": %w`, err)}
|
||||
}
|
||||
}
|
||||
if _, ok := _c.mutation.Path(); !ok {
|
||||
return &ValidationError{Name: "path", err: errors.New(`ent: missing required field "Permission.path"`)}
|
||||
}
|
||||
@@ -285,6 +311,10 @@ func (_c *PermissionCreate) createSpec() (*Permission, *sqlgraph.CreateSpec) {
|
||||
_spec.SetField(permission.FieldType, field.TypeString, value)
|
||||
_node.Type = value
|
||||
}
|
||||
if value, ok := _c.mutation.ParentCode(); ok {
|
||||
_spec.SetField(permission.FieldParentCode, field.TypeString, value)
|
||||
_node.ParentCode = value
|
||||
}
|
||||
if value, ok := _c.mutation.Path(); ok {
|
||||
_spec.SetField(permission.FieldPath, field.TypeString, value)
|
||||
_node.Path = value
|
||||
|
||||
Reference in New Issue
Block a user