feat: 新增检测单关联、基础数据优化与入库单升级
1. 新增出库单检测单号字段并添加索引支持溯源 2. 优化基础数据页面物料类型展示与选择逻辑 3. 升级入库单导入功能,支持自动生成单号并返回导入结果 4. 优化接驳台查询排序方式 5. 修复字符串拼接空格问题
This commit is contained in:
@@ -534,6 +534,7 @@ var (
|
||||
{Name: "box_no", Type: field.TypeString, Nullable: true},
|
||||
{Name: "box_sn_list", Type: field.TypeString, Nullable: true},
|
||||
{Name: "contract_no", Type: field.TypeString, Nullable: true},
|
||||
{Name: "inspection_no", Type: field.TypeString, Nullable: true},
|
||||
{Name: "created_at", Type: field.TypeInt64},
|
||||
}
|
||||
// OutboundOrdersTable holds the schema information for the "outbound_orders" table.
|
||||
@@ -562,6 +563,11 @@ var (
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{OutboundOrdersColumns[23]},
|
||||
},
|
||||
{
|
||||
Name: "outboundorder_inspection_no",
|
||||
Unique: false,
|
||||
Columns: []*schema.Column{OutboundOrdersColumns[26]},
|
||||
},
|
||||
},
|
||||
}
|
||||
// PermissionsColumns holds the columns for the "permissions" table.
|
||||
|
||||
@@ -15215,6 +15215,7 @@ type OutboundOrderMutation struct {
|
||||
box_no *string
|
||||
box_sn_list *string
|
||||
contract_no *string
|
||||
inspection_no *string
|
||||
created_at *int64
|
||||
addcreated_at *int64
|
||||
clearedFields map[string]struct{}
|
||||
@@ -16495,6 +16496,55 @@ func (m *OutboundOrderMutation) ResetContractNo() {
|
||||
delete(m.clearedFields, outboundorder.FieldContractNo)
|
||||
}
|
||||
|
||||
// SetInspectionNo sets the "inspection_no" field.
|
||||
func (m *OutboundOrderMutation) SetInspectionNo(s string) {
|
||||
m.inspection_no = &s
|
||||
}
|
||||
|
||||
// InspectionNo returns the value of the "inspection_no" field in the mutation.
|
||||
func (m *OutboundOrderMutation) InspectionNo() (r string, exists bool) {
|
||||
v := m.inspection_no
|
||||
if v == nil {
|
||||
return
|
||||
}
|
||||
return *v, true
|
||||
}
|
||||
|
||||
// OldInspectionNo returns the old "inspection_no" field's value of the OutboundOrder entity.
|
||||
// If the OutboundOrder object wasn't provided to the builder, the object is fetched from the database.
|
||||
// An error is returned if the mutation operation is not UpdateOne, or the database query fails.
|
||||
func (m *OutboundOrderMutation) OldInspectionNo(ctx context.Context) (v string, err error) {
|
||||
if !m.op.Is(OpUpdateOne) {
|
||||
return v, errors.New("OldInspectionNo is only allowed on UpdateOne operations")
|
||||
}
|
||||
if m.id == nil || m.oldValue == nil {
|
||||
return v, errors.New("OldInspectionNo requires an ID field in the mutation")
|
||||
}
|
||||
oldValue, err := m.oldValue(ctx)
|
||||
if err != nil {
|
||||
return v, fmt.Errorf("querying old value for OldInspectionNo: %w", err)
|
||||
}
|
||||
return oldValue.InspectionNo, nil
|
||||
}
|
||||
|
||||
// ClearInspectionNo clears the value of the "inspection_no" field.
|
||||
func (m *OutboundOrderMutation) ClearInspectionNo() {
|
||||
m.inspection_no = nil
|
||||
m.clearedFields[outboundorder.FieldInspectionNo] = struct{}{}
|
||||
}
|
||||
|
||||
// InspectionNoCleared returns if the "inspection_no" field was cleared in this mutation.
|
||||
func (m *OutboundOrderMutation) InspectionNoCleared() bool {
|
||||
_, ok := m.clearedFields[outboundorder.FieldInspectionNo]
|
||||
return ok
|
||||
}
|
||||
|
||||
// ResetInspectionNo resets all changes to the "inspection_no" field.
|
||||
func (m *OutboundOrderMutation) ResetInspectionNo() {
|
||||
m.inspection_no = nil
|
||||
delete(m.clearedFields, outboundorder.FieldInspectionNo)
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (m *OutboundOrderMutation) SetCreatedAt(i int64) {
|
||||
m.created_at = &i
|
||||
@@ -16585,7 +16635,7 @@ func (m *OutboundOrderMutation) Type() string {
|
||||
// order to get all numeric fields that were incremented/decremented, call
|
||||
// AddedFields().
|
||||
func (m *OutboundOrderMutation) Fields() []string {
|
||||
fields := make([]string, 0, 26)
|
||||
fields := make([]string, 0, 27)
|
||||
if m.outbound_no != nil {
|
||||
fields = append(fields, outboundorder.FieldOutboundNo)
|
||||
}
|
||||
@@ -16661,6 +16711,9 @@ func (m *OutboundOrderMutation) Fields() []string {
|
||||
if m.contract_no != nil {
|
||||
fields = append(fields, outboundorder.FieldContractNo)
|
||||
}
|
||||
if m.inspection_no != nil {
|
||||
fields = append(fields, outboundorder.FieldInspectionNo)
|
||||
}
|
||||
if m.created_at != nil {
|
||||
fields = append(fields, outboundorder.FieldCreatedAt)
|
||||
}
|
||||
@@ -16722,6 +16775,8 @@ func (m *OutboundOrderMutation) Field(name string) (ent.Value, bool) {
|
||||
return m.BoxSnList()
|
||||
case outboundorder.FieldContractNo:
|
||||
return m.ContractNo()
|
||||
case outboundorder.FieldInspectionNo:
|
||||
return m.InspectionNo()
|
||||
case outboundorder.FieldCreatedAt:
|
||||
return m.CreatedAt()
|
||||
}
|
||||
@@ -16783,6 +16838,8 @@ func (m *OutboundOrderMutation) OldField(ctx context.Context, name string) (ent.
|
||||
return m.OldBoxSnList(ctx)
|
||||
case outboundorder.FieldContractNo:
|
||||
return m.OldContractNo(ctx)
|
||||
case outboundorder.FieldInspectionNo:
|
||||
return m.OldInspectionNo(ctx)
|
||||
case outboundorder.FieldCreatedAt:
|
||||
return m.OldCreatedAt(ctx)
|
||||
}
|
||||
@@ -16969,6 +17026,13 @@ func (m *OutboundOrderMutation) SetField(name string, value ent.Value) error {
|
||||
}
|
||||
m.SetContractNo(v)
|
||||
return nil
|
||||
case outboundorder.FieldInspectionNo:
|
||||
v, ok := value.(string)
|
||||
if !ok {
|
||||
return fmt.Errorf("unexpected type %T for field %s", value, name)
|
||||
}
|
||||
m.SetInspectionNo(v)
|
||||
return nil
|
||||
case outboundorder.FieldCreatedAt:
|
||||
v, ok := value.(int64)
|
||||
if !ok {
|
||||
@@ -17099,6 +17163,9 @@ func (m *OutboundOrderMutation) ClearedFields() []string {
|
||||
if m.FieldCleared(outboundorder.FieldContractNo) {
|
||||
fields = append(fields, outboundorder.FieldContractNo)
|
||||
}
|
||||
if m.FieldCleared(outboundorder.FieldInspectionNo) {
|
||||
fields = append(fields, outboundorder.FieldInspectionNo)
|
||||
}
|
||||
return fields
|
||||
}
|
||||
|
||||
@@ -17167,6 +17234,9 @@ func (m *OutboundOrderMutation) ClearField(name string) error {
|
||||
case outboundorder.FieldContractNo:
|
||||
m.ClearContractNo()
|
||||
return nil
|
||||
case outboundorder.FieldInspectionNo:
|
||||
m.ClearInspectionNo()
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("unknown OutboundOrder nullable field %s", name)
|
||||
}
|
||||
@@ -17250,6 +17320,9 @@ func (m *OutboundOrderMutation) ResetField(name string) error {
|
||||
case outboundorder.FieldContractNo:
|
||||
m.ResetContractNo()
|
||||
return nil
|
||||
case outboundorder.FieldInspectionNo:
|
||||
m.ResetInspectionNo()
|
||||
return nil
|
||||
case outboundorder.FieldCreatedAt:
|
||||
m.ResetCreatedAt()
|
||||
return nil
|
||||
|
||||
@@ -66,6 +66,8 @@ type OutboundOrder struct {
|
||||
BoxSnList string `json:"boxSnList,omitempty"`
|
||||
// 合同号(装箱选填)
|
||||
ContractNo string `json:"contractNo,omitempty"`
|
||||
// 检测单号(溯源关联检验单据)
|
||||
InspectionNo string `json:"inspectionNo,omitempty"`
|
||||
// 创建时间
|
||||
CreatedAt int64 `json:"createdAt,omitempty"`
|
||||
selectValues sql.SelectValues
|
||||
@@ -80,7 +82,7 @@ func (*OutboundOrder) scanValues(columns []string) ([]any, error) {
|
||||
values[i] = new(sql.NullBool)
|
||||
case outboundorder.FieldID, outboundorder.FieldManageMode, outboundorder.FieldQuantity, outboundorder.FieldCreatedAt:
|
||||
values[i] = new(sql.NullInt64)
|
||||
case outboundorder.FieldOutboundNo, outboundorder.FieldOutboundType, outboundorder.FieldStatus, outboundorder.FieldOutboundCategory, outboundorder.FieldOwnershipType, outboundorder.FieldOwnershipNo, outboundorder.FieldTargetStation, outboundorder.FieldOrderNo, outboundorder.FieldMaterialCode, outboundorder.FieldMaterialName, outboundorder.FieldBatchNo, outboundorder.FieldZoneCode, outboundorder.FieldShelfNo, outboundorder.FieldLayerNo, outboundorder.FieldPositionNo, outboundorder.FieldOperator, outboundorder.FieldReviewer, outboundorder.FieldTargetDock, outboundorder.FieldRemark, outboundorder.FieldBoxNo, outboundorder.FieldBoxSnList, outboundorder.FieldContractNo:
|
||||
case outboundorder.FieldOutboundNo, outboundorder.FieldOutboundType, outboundorder.FieldStatus, outboundorder.FieldOutboundCategory, outboundorder.FieldOwnershipType, outboundorder.FieldOwnershipNo, outboundorder.FieldTargetStation, outboundorder.FieldOrderNo, outboundorder.FieldMaterialCode, outboundorder.FieldMaterialName, outboundorder.FieldBatchNo, outboundorder.FieldZoneCode, outboundorder.FieldShelfNo, outboundorder.FieldLayerNo, outboundorder.FieldPositionNo, outboundorder.FieldOperator, outboundorder.FieldReviewer, outboundorder.FieldTargetDock, outboundorder.FieldRemark, outboundorder.FieldBoxNo, outboundorder.FieldBoxSnList, outboundorder.FieldContractNo, outboundorder.FieldInspectionNo:
|
||||
values[i] = new(sql.NullString)
|
||||
default:
|
||||
values[i] = new(sql.UnknownType)
|
||||
@@ -253,6 +255,12 @@ func (_m *OutboundOrder) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
_m.ContractNo = value.String
|
||||
}
|
||||
case outboundorder.FieldInspectionNo:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field inspection_no", values[i])
|
||||
} else if value.Valid {
|
||||
_m.InspectionNo = value.String
|
||||
}
|
||||
case outboundorder.FieldCreatedAt:
|
||||
if value, ok := values[i].(*sql.NullInt64); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field created_at", values[i])
|
||||
@@ -370,6 +378,9 @@ func (_m *OutboundOrder) String() string {
|
||||
builder.WriteString("contract_no=")
|
||||
builder.WriteString(_m.ContractNo)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("inspection_no=")
|
||||
builder.WriteString(_m.InspectionNo)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("created_at=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.CreatedAt))
|
||||
builder.WriteByte(')')
|
||||
|
||||
@@ -61,6 +61,8 @@ const (
|
||||
FieldBoxSnList = "box_sn_list"
|
||||
// FieldContractNo holds the string denoting the contract_no field in the database.
|
||||
FieldContractNo = "contract_no"
|
||||
// FieldInspectionNo holds the string denoting the inspection_no field in the database.
|
||||
FieldInspectionNo = "inspection_no"
|
||||
// FieldCreatedAt holds the string denoting the created_at field in the database.
|
||||
FieldCreatedAt = "created_at"
|
||||
// Table holds the table name of the outboundorder in the database.
|
||||
@@ -95,6 +97,7 @@ var Columns = []string{
|
||||
FieldBoxNo,
|
||||
FieldBoxSnList,
|
||||
FieldContractNo,
|
||||
FieldInspectionNo,
|
||||
FieldCreatedAt,
|
||||
}
|
||||
|
||||
@@ -256,6 +259,11 @@ func ByContractNo(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldContractNo, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByInspectionNo orders the results by the inspection_no field.
|
||||
func ByInspectionNo(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldInspectionNo, opts...).ToFunc()
|
||||
}
|
||||
|
||||
// ByCreatedAt orders the results by the created_at field.
|
||||
func ByCreatedAt(opts ...sql.OrderTermOption) OrderOption {
|
||||
return sql.OrderByField(FieldCreatedAt, opts...).ToFunc()
|
||||
|
||||
@@ -178,6 +178,11 @@ func ContractNo(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldContractNo, v))
|
||||
}
|
||||
|
||||
// InspectionNo applies equality check predicate on the "inspection_no" field. It's identical to InspectionNoEQ.
|
||||
func InspectionNo(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// CreatedAt applies equality check predicate on the "created_at" field. It's identical to CreatedAtEQ.
|
||||
func CreatedAt(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldCreatedAt, v))
|
||||
@@ -1883,6 +1888,81 @@ func ContractNoContainsFold(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldContainsFold(FieldContractNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoEQ applies the EQ predicate on the "inspection_no" field.
|
||||
func InspectionNoEQ(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoNEQ applies the NEQ predicate on the "inspection_no" field.
|
||||
func InspectionNoNEQ(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNEQ(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoIn applies the In predicate on the "inspection_no" field.
|
||||
func InspectionNoIn(vs ...string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldIn(FieldInspectionNo, vs...))
|
||||
}
|
||||
|
||||
// InspectionNoNotIn applies the NotIn predicate on the "inspection_no" field.
|
||||
func InspectionNoNotIn(vs ...string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNotIn(FieldInspectionNo, vs...))
|
||||
}
|
||||
|
||||
// InspectionNoGT applies the GT predicate on the "inspection_no" field.
|
||||
func InspectionNoGT(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldGT(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoGTE applies the GTE predicate on the "inspection_no" field.
|
||||
func InspectionNoGTE(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldGTE(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoLT applies the LT predicate on the "inspection_no" field.
|
||||
func InspectionNoLT(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldLT(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoLTE applies the LTE predicate on the "inspection_no" field.
|
||||
func InspectionNoLTE(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldLTE(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoContains applies the Contains predicate on the "inspection_no" field.
|
||||
func InspectionNoContains(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldContains(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoHasPrefix applies the HasPrefix predicate on the "inspection_no" field.
|
||||
func InspectionNoHasPrefix(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldHasPrefix(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoHasSuffix applies the HasSuffix predicate on the "inspection_no" field.
|
||||
func InspectionNoHasSuffix(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldHasSuffix(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoIsNil applies the IsNil predicate on the "inspection_no" field.
|
||||
func InspectionNoIsNil() predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldIsNull(FieldInspectionNo))
|
||||
}
|
||||
|
||||
// InspectionNoNotNil applies the NotNil predicate on the "inspection_no" field.
|
||||
func InspectionNoNotNil() predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldNotNull(FieldInspectionNo))
|
||||
}
|
||||
|
||||
// InspectionNoEqualFold applies the EqualFold predicate on the "inspection_no" field.
|
||||
func InspectionNoEqualFold(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEqualFold(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// InspectionNoContainsFold applies the ContainsFold predicate on the "inspection_no" field.
|
||||
func InspectionNoContainsFold(v string) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldContainsFold(FieldInspectionNo, v))
|
||||
}
|
||||
|
||||
// CreatedAtEQ applies the EQ predicate on the "created_at" field.
|
||||
func CreatedAtEQ(v int64) predicate.OutboundOrder {
|
||||
return predicate.OutboundOrder(sql.FieldEQ(FieldCreatedAt, v))
|
||||
|
||||
@@ -355,6 +355,20 @@ func (_c *OutboundOrderCreate) SetNillableContractNo(v *string) *OutboundOrderCr
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetInspectionNo sets the "inspection_no" field.
|
||||
func (_c *OutboundOrderCreate) SetInspectionNo(v string) *OutboundOrderCreate {
|
||||
_c.mutation.SetInspectionNo(v)
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetNillableInspectionNo sets the "inspection_no" field if the given value is not nil.
|
||||
func (_c *OutboundOrderCreate) SetNillableInspectionNo(v *string) *OutboundOrderCreate {
|
||||
if v != nil {
|
||||
_c.SetInspectionNo(*v)
|
||||
}
|
||||
return _c
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_c *OutboundOrderCreate) SetCreatedAt(v int64) *OutboundOrderCreate {
|
||||
_c.mutation.SetCreatedAt(v)
|
||||
@@ -583,6 +597,10 @@ func (_c *OutboundOrderCreate) createSpec() (*OutboundOrder, *sqlgraph.CreateSpe
|
||||
_spec.SetField(outboundorder.FieldContractNo, field.TypeString, value)
|
||||
_node.ContractNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.InspectionNo(); ok {
|
||||
_spec.SetField(outboundorder.FieldInspectionNo, field.TypeString, value)
|
||||
_node.InspectionNo = value
|
||||
}
|
||||
if value, ok := _c.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(outboundorder.FieldCreatedAt, field.TypeInt64, value)
|
||||
_node.CreatedAt = value
|
||||
@@ -1059,6 +1077,24 @@ func (u *OutboundOrderUpsert) ClearContractNo() *OutboundOrderUpsert {
|
||||
return u
|
||||
}
|
||||
|
||||
// SetInspectionNo sets the "inspection_no" field.
|
||||
func (u *OutboundOrderUpsert) SetInspectionNo(v string) *OutboundOrderUpsert {
|
||||
u.Set(outboundorder.FieldInspectionNo, v)
|
||||
return u
|
||||
}
|
||||
|
||||
// UpdateInspectionNo sets the "inspection_no" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsert) UpdateInspectionNo() *OutboundOrderUpsert {
|
||||
u.SetExcluded(outboundorder.FieldInspectionNo)
|
||||
return u
|
||||
}
|
||||
|
||||
// ClearInspectionNo clears the value of the "inspection_no" field.
|
||||
func (u *OutboundOrderUpsert) ClearInspectionNo() *OutboundOrderUpsert {
|
||||
u.SetNull(outboundorder.FieldInspectionNo)
|
||||
return u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *OutboundOrderUpsert) SetCreatedAt(v int64) *OutboundOrderUpsert {
|
||||
u.Set(outboundorder.FieldCreatedAt, v)
|
||||
@@ -1607,6 +1643,27 @@ func (u *OutboundOrderUpsertOne) ClearContractNo() *OutboundOrderUpsertOne {
|
||||
})
|
||||
}
|
||||
|
||||
// SetInspectionNo sets the "inspection_no" field.
|
||||
func (u *OutboundOrderUpsertOne) SetInspectionNo(v string) *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetInspectionNo(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateInspectionNo sets the "inspection_no" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertOne) UpdateInspectionNo() *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateInspectionNo()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearInspectionNo clears the value of the "inspection_no" field.
|
||||
func (u *OutboundOrderUpsertOne) ClearInspectionNo() *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.ClearInspectionNo()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *OutboundOrderUpsertOne) SetCreatedAt(v int64) *OutboundOrderUpsertOne {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
@@ -2322,6 +2379,27 @@ func (u *OutboundOrderUpsertBulk) ClearContractNo() *OutboundOrderUpsertBulk {
|
||||
})
|
||||
}
|
||||
|
||||
// SetInspectionNo sets the "inspection_no" field.
|
||||
func (u *OutboundOrderUpsertBulk) SetInspectionNo(v string) *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.SetInspectionNo(v)
|
||||
})
|
||||
}
|
||||
|
||||
// UpdateInspectionNo sets the "inspection_no" field to the value that was provided on create.
|
||||
func (u *OutboundOrderUpsertBulk) UpdateInspectionNo() *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.UpdateInspectionNo()
|
||||
})
|
||||
}
|
||||
|
||||
// ClearInspectionNo clears the value of the "inspection_no" field.
|
||||
func (u *OutboundOrderUpsertBulk) ClearInspectionNo() *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
s.ClearInspectionNo()
|
||||
})
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (u *OutboundOrderUpsertBulk) SetCreatedAt(v int64) *OutboundOrderUpsertBulk {
|
||||
return u.Update(func(s *OutboundOrderUpsert) {
|
||||
|
||||
@@ -499,6 +499,26 @@ func (_u *OutboundOrderUpdate) ClearContractNo() *OutboundOrderUpdate {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetInspectionNo sets the "inspection_no" field.
|
||||
func (_u *OutboundOrderUpdate) SetInspectionNo(v string) *OutboundOrderUpdate {
|
||||
_u.mutation.SetInspectionNo(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableInspectionNo sets the "inspection_no" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdate) SetNillableInspectionNo(v *string) *OutboundOrderUpdate {
|
||||
if v != nil {
|
||||
_u.SetInspectionNo(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearInspectionNo clears the value of the "inspection_no" field.
|
||||
func (_u *OutboundOrderUpdate) ClearInspectionNo() *OutboundOrderUpdate {
|
||||
_u.mutation.ClearInspectionNo()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_u *OutboundOrderUpdate) SetCreatedAt(v int64) *OutboundOrderUpdate {
|
||||
_u.mutation.ResetCreatedAt()
|
||||
@@ -696,6 +716,12 @@ func (_u *OutboundOrderUpdate) sqlSave(ctx context.Context) (_node int, err erro
|
||||
if _u.mutation.ContractNoCleared() {
|
||||
_spec.ClearField(outboundorder.FieldContractNo, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.InspectionNo(); ok {
|
||||
_spec.SetField(outboundorder.FieldInspectionNo, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.InspectionNoCleared() {
|
||||
_spec.ClearField(outboundorder.FieldInspectionNo, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(outboundorder.FieldCreatedAt, field.TypeInt64, value)
|
||||
}
|
||||
@@ -1194,6 +1220,26 @@ func (_u *OutboundOrderUpdateOne) ClearContractNo() *OutboundOrderUpdateOne {
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetInspectionNo sets the "inspection_no" field.
|
||||
func (_u *OutboundOrderUpdateOne) SetInspectionNo(v string) *OutboundOrderUpdateOne {
|
||||
_u.mutation.SetInspectionNo(v)
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetNillableInspectionNo sets the "inspection_no" field if the given value is not nil.
|
||||
func (_u *OutboundOrderUpdateOne) SetNillableInspectionNo(v *string) *OutboundOrderUpdateOne {
|
||||
if v != nil {
|
||||
_u.SetInspectionNo(*v)
|
||||
}
|
||||
return _u
|
||||
}
|
||||
|
||||
// ClearInspectionNo clears the value of the "inspection_no" field.
|
||||
func (_u *OutboundOrderUpdateOne) ClearInspectionNo() *OutboundOrderUpdateOne {
|
||||
_u.mutation.ClearInspectionNo()
|
||||
return _u
|
||||
}
|
||||
|
||||
// SetCreatedAt sets the "created_at" field.
|
||||
func (_u *OutboundOrderUpdateOne) SetCreatedAt(v int64) *OutboundOrderUpdateOne {
|
||||
_u.mutation.ResetCreatedAt()
|
||||
@@ -1421,6 +1467,12 @@ func (_u *OutboundOrderUpdateOne) sqlSave(ctx context.Context) (_node *OutboundO
|
||||
if _u.mutation.ContractNoCleared() {
|
||||
_spec.ClearField(outboundorder.FieldContractNo, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.InspectionNo(); ok {
|
||||
_spec.SetField(outboundorder.FieldInspectionNo, field.TypeString, value)
|
||||
}
|
||||
if _u.mutation.InspectionNoCleared() {
|
||||
_spec.ClearField(outboundorder.FieldInspectionNo, field.TypeString)
|
||||
}
|
||||
if value, ok := _u.mutation.CreatedAt(); ok {
|
||||
_spec.SetField(outboundorder.FieldCreatedAt, field.TypeInt64, value)
|
||||
}
|
||||
|
||||
@@ -390,7 +390,7 @@ func init() {
|
||||
// outboundorder.DefaultQuantity holds the default value on creation for the quantity field.
|
||||
outboundorder.DefaultQuantity = outboundorderDescQuantity.Default.(int)
|
||||
// outboundorderDescCreatedAt is the schema descriptor for created_at field.
|
||||
outboundorderDescCreatedAt := outboundorderFields[25].Descriptor()
|
||||
outboundorderDescCreatedAt := outboundorderFields[26].Descriptor()
|
||||
// outboundorder.DefaultCreatedAt holds the default value on creation for the created_at field.
|
||||
outboundorder.DefaultCreatedAt = outboundorderDescCreatedAt.Default.(func() int64)
|
||||
permissionFields := schema.Permission{}.Fields()
|
||||
|
||||
Reference in New Issue
Block a user