- MES 新增实体:混产模板、产品BOM、产品工艺物料、试制记录(schema + ent 生成码 + logic/handler/前端页) - WMS 实体增强:检验记录、库存、半成品重构;新增序列号库存与短缺代报 - AGV 与产能:AGV 手动点位与链路、物料守卫、短缺预测、原因字典 - 前端通用能力:新增下一步引导组件 NextStepBar,统一帮助文档/布局/请求拦截与操作列 - 工位终端:界面与各 handler 调整(api/store/绑定/PLC/拧紧/上报等) - 配置与文档:更新 mes-api.yaml、WMS README 及案例/产线API/问题记录/项目说明/流程说明
89 lines
2.5 KiB
Go
89 lines
2.5 KiB
Go
// Code generated by ent, DO NOT EDIT.
|
|
|
|
package ent
|
|
|
|
import (
|
|
"bj_power_mes/ent/predicate"
|
|
"bj_power_mes/ent/productprocessmaterial"
|
|
"context"
|
|
|
|
"entgo.io/ent/dialect/sql"
|
|
"entgo.io/ent/dialect/sql/sqlgraph"
|
|
"entgo.io/ent/schema/field"
|
|
)
|
|
|
|
// ProductProcessMaterialDelete is the builder for deleting a ProductProcessMaterial entity.
|
|
type ProductProcessMaterialDelete struct {
|
|
config
|
|
hooks []Hook
|
|
mutation *ProductProcessMaterialMutation
|
|
}
|
|
|
|
// Where appends a list predicates to the ProductProcessMaterialDelete builder.
|
|
func (_d *ProductProcessMaterialDelete) Where(ps ...predicate.ProductProcessMaterial) *ProductProcessMaterialDelete {
|
|
_d.mutation.Where(ps...)
|
|
return _d
|
|
}
|
|
|
|
// Exec executes the deletion query and returns how many vertices were deleted.
|
|
func (_d *ProductProcessMaterialDelete) Exec(ctx context.Context) (int, error) {
|
|
return withHooks(ctx, _d.sqlExec, _d.mutation, _d.hooks)
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_d *ProductProcessMaterialDelete) ExecX(ctx context.Context) int {
|
|
n, err := _d.Exec(ctx)
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
return n
|
|
}
|
|
|
|
func (_d *ProductProcessMaterialDelete) sqlExec(ctx context.Context) (int, error) {
|
|
_spec := sqlgraph.NewDeleteSpec(productprocessmaterial.Table, sqlgraph.NewFieldSpec(productprocessmaterial.FieldID, field.TypeInt))
|
|
if ps := _d.mutation.predicates; len(ps) > 0 {
|
|
_spec.Predicate = func(selector *sql.Selector) {
|
|
for i := range ps {
|
|
ps[i](selector)
|
|
}
|
|
}
|
|
}
|
|
affected, err := sqlgraph.DeleteNodes(ctx, _d.driver, _spec)
|
|
if err != nil && sqlgraph.IsConstraintError(err) {
|
|
err = &ConstraintError{msg: err.Error(), wrap: err}
|
|
}
|
|
_d.mutation.done = true
|
|
return affected, err
|
|
}
|
|
|
|
// ProductProcessMaterialDeleteOne is the builder for deleting a single ProductProcessMaterial entity.
|
|
type ProductProcessMaterialDeleteOne struct {
|
|
_d *ProductProcessMaterialDelete
|
|
}
|
|
|
|
// Where appends a list predicates to the ProductProcessMaterialDelete builder.
|
|
func (_d *ProductProcessMaterialDeleteOne) Where(ps ...predicate.ProductProcessMaterial) *ProductProcessMaterialDeleteOne {
|
|
_d._d.mutation.Where(ps...)
|
|
return _d
|
|
}
|
|
|
|
// Exec executes the deletion query.
|
|
func (_d *ProductProcessMaterialDeleteOne) Exec(ctx context.Context) error {
|
|
n, err := _d._d.Exec(ctx)
|
|
switch {
|
|
case err != nil:
|
|
return err
|
|
case n == 0:
|
|
return &NotFoundError{productprocessmaterial.Label}
|
|
default:
|
|
return nil
|
|
}
|
|
}
|
|
|
|
// ExecX is like Exec, but panics if an error occurs.
|
|
func (_d *ProductProcessMaterialDeleteOne) ExecX(ctx context.Context) {
|
|
if err := _d.Exec(ctx); err != nil {
|
|
panic(err)
|
|
}
|
|
}
|