docs(business): 生成业务契约文档并重构MES客户端代码
- 创建案例.md文档,包含业务场景清单、业务流程、案例和回归测试三份完整文档 - WMS库房管理系统涵盖入库、出库、库存、检验、盘点等24个业务场景 - MES产线控制系统包含工单、排产、BOM、备料、质检、追溯等23个业务场景 - 工位终端系统支持上线、报工、下线、领料、巡检等15个现场作业场景 - 主链路从合同到成品入库,异常链路处理不合格、数量不符、退料等情况 - 删除MES客户端中的ScanRecord相关代码,精简客户端结构 - 更新客户端初始化逻辑,移除扫描记录相关的依赖注入配置
This commit is contained in:
@@ -4,8 +4,6 @@ package ent
|
||||
|
||||
import (
|
||||
"context"
|
||||
stdsql "database/sql"
|
||||
"fmt"
|
||||
"sync"
|
||||
|
||||
"entgo.io/ent/dialect"
|
||||
@@ -50,8 +48,6 @@ type Tx struct {
|
||||
ProductType *ProductTypeClient
|
||||
// Role is the client for interacting with the Role builders.
|
||||
Role *RoleClient
|
||||
// ScanRecord is the client for interacting with the ScanRecord builders.
|
||||
ScanRecord *ScanRecordClient
|
||||
// SemiFlow is the client for interacting with the SemiFlow builders.
|
||||
SemiFlow *SemiFlowClient
|
||||
// Station is the client for interacting with the Station builders.
|
||||
@@ -227,7 +223,6 @@ func (tx *Tx) init() {
|
||||
tx.ProcessStep = NewProcessStepClient(tx.config)
|
||||
tx.ProductType = NewProductTypeClient(tx.config)
|
||||
tx.Role = NewRoleClient(tx.config)
|
||||
tx.ScanRecord = NewScanRecordClient(tx.config)
|
||||
tx.SemiFlow = NewSemiFlowClient(tx.config)
|
||||
tx.Station = NewStationClient(tx.config)
|
||||
tx.StationProcess = NewStationProcessClient(tx.config)
|
||||
@@ -303,27 +298,3 @@ func (tx *txDriver) Query(ctx context.Context, query string, args, v any) error
|
||||
}
|
||||
|
||||
var _ dialect.Driver = (*txDriver)(nil)
|
||||
|
||||
// ExecContext allows calling the underlying ExecContext method of the transaction if it is supported by it.
|
||||
// See, database/sql#Tx.ExecContext for more information.
|
||||
func (tx *txDriver) ExecContext(ctx context.Context, query string, args ...any) (stdsql.Result, error) {
|
||||
ex, ok := tx.tx.(interface {
|
||||
ExecContext(context.Context, string, ...any) (stdsql.Result, error)
|
||||
})
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("Tx.ExecContext is not supported")
|
||||
}
|
||||
return ex.ExecContext(ctx, query, args...)
|
||||
}
|
||||
|
||||
// QueryContext allows calling the underlying QueryContext method of the transaction if it is supported by it.
|
||||
// See, database/sql#Tx.QueryContext for more information.
|
||||
func (tx *txDriver) QueryContext(ctx context.Context, query string, args ...any) (*stdsql.Rows, error) {
|
||||
q, ok := tx.tx.(interface {
|
||||
QueryContext(context.Context, string, ...any) (*stdsql.Rows, error)
|
||||
})
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("Tx.QueryContext is not supported")
|
||||
}
|
||||
return q.QueryContext(ctx, query, args...)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user