feat: 新增装机绑定功能与权限、BOM工序配置

1.  新增装机绑定实体与相关CRUD逻辑,支持工件工序物料绑定/解绑
2.  为BOM物料新增装配工序字段,支持按工序校验绑定
3.  扩展权限表,新增父权限码字段支持菜单按钮关联
4.  统一各页面帮助弹窗参数,新增角色管理帮助文档
5.  新增公共格式化工具函数,优化侧边栏菜单展开逻辑
6.  新增工位终端绑定代理接口与MES内部绑定API
7.  修复主入口数据库连接与schema初始化逻辑,新增一键迁移工具
This commit is contained in:
SunYF
2026-09-07 11:58:19 +08:00
parent 92f0439d89
commit 6ee131a4bd
70 changed files with 6966 additions and 365 deletions
+44
View File
@@ -70,6 +70,20 @@ func (_u *PermissionUpdate) SetNillableType(v *string) *PermissionUpdate {
return _u
}
// SetParentCode sets the "parentCode" field.
func (_u *PermissionUpdate) SetParentCode(v string) *PermissionUpdate {
_u.mutation.SetParentCode(v)
return _u
}
// SetNillableParentCode sets the "parentCode" field if the given value is not nil.
func (_u *PermissionUpdate) SetNillableParentCode(v *string) *PermissionUpdate {
if v != nil {
_u.SetParentCode(*v)
}
return _u
}
// SetPath sets the "path" field.
func (_u *PermissionUpdate) SetPath(v string) *PermissionUpdate {
_u.mutation.SetPath(v)
@@ -188,6 +202,11 @@ func (_u *PermissionUpdate) check() error {
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Permission.type": %w`, err)}
}
}
if v, ok := _u.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 v, ok := _u.mutation.Path(); ok {
if err := permission.PathValidator(v); err != nil {
return &ValidationError{Name: "path", err: fmt.Errorf(`ent: validator failed for field "Permission.path": %w`, err)}
@@ -233,6 +252,9 @@ func (_u *PermissionUpdate) sqlSave(ctx context.Context) (_node int, err error)
if value, ok := _u.mutation.GetType(); ok {
_spec.SetField(permission.FieldType, field.TypeString, value)
}
if value, ok := _u.mutation.ParentCode(); ok {
_spec.SetField(permission.FieldParentCode, field.TypeString, value)
}
if value, ok := _u.mutation.Path(); ok {
_spec.SetField(permission.FieldPath, field.TypeString, value)
}
@@ -315,6 +337,20 @@ func (_u *PermissionUpdateOne) SetNillableType(v *string) *PermissionUpdateOne {
return _u
}
// SetParentCode sets the "parentCode" field.
func (_u *PermissionUpdateOne) SetParentCode(v string) *PermissionUpdateOne {
_u.mutation.SetParentCode(v)
return _u
}
// SetNillableParentCode sets the "parentCode" field if the given value is not nil.
func (_u *PermissionUpdateOne) SetNillableParentCode(v *string) *PermissionUpdateOne {
if v != nil {
_u.SetParentCode(*v)
}
return _u
}
// SetPath sets the "path" field.
func (_u *PermissionUpdateOne) SetPath(v string) *PermissionUpdateOne {
_u.mutation.SetPath(v)
@@ -446,6 +482,11 @@ func (_u *PermissionUpdateOne) check() error {
return &ValidationError{Name: "type", err: fmt.Errorf(`ent: validator failed for field "Permission.type": %w`, err)}
}
}
if v, ok := _u.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 v, ok := _u.mutation.Path(); ok {
if err := permission.PathValidator(v); err != nil {
return &ValidationError{Name: "path", err: fmt.Errorf(`ent: validator failed for field "Permission.path": %w`, err)}
@@ -508,6 +549,9 @@ func (_u *PermissionUpdateOne) sqlSave(ctx context.Context) (_node *Permission,
if value, ok := _u.mutation.GetType(); ok {
_spec.SetField(permission.FieldType, field.TypeString, value)
}
if value, ok := _u.mutation.ParentCode(); ok {
_spec.SetField(permission.FieldParentCode, field.TypeString, value)
}
if value, ok := _u.mutation.Path(); ok {
_spec.SetField(permission.FieldPath, field.TypeString, value)
}