feat: 大屏多订单改为同屏并列展示,物料申请新增跨工位借料来源并移除工单完成日期

This commit is contained in:
SunYF
2026-11-02 19:17:05 +08:00
parent 0c03d32682
commit fd2f0e2767
77 changed files with 1773 additions and 664 deletions
+2 -1
View File
@@ -606,6 +606,7 @@ var (
{Name: "box_no", Type: field.TypeString, Nullable: true, Comment: "箱号(装箱出库时填写,用于整箱发货追溯)"},
{Name: "box_sn_list", Type: field.TypeString, Nullable: true, Comment: "装箱 SN 清单(JSON 数组字符串)"},
{Name: "contract_no", Type: field.TypeString, Nullable: true, Comment: "合同号(装箱选填)"},
{Name: "borrow_from", Type: field.TypeJSON, Nullable: true, Comment: "跨工位借料来源 stationNo→借用量(call 备料出库专用);空=本工位自取"},
{Name: "inspection_no", Type: field.TypeString, Nullable: true, Comment: "检测单号(溯源关联检验单据)"},
{Name: "product_work_no", Type: field.TypeString, Nullable: true, Comment: "产品工号(随库存带入,出库记录展示/筛选)"},
{Name: "created_at", Type: field.TypeInt64, Comment: "创建时间"},
@@ -640,7 +641,7 @@ var (
{
Name: "outboundorder_inspection_no",
Unique: false,
Columns: []*schema.Column{OutboundOrdersColumns[27]},
Columns: []*schema.Column{OutboundOrdersColumns[28]},
},
},
}
+74 -1
View File
@@ -17584,6 +17584,7 @@ type OutboundOrderMutation struct {
box_no *string
box_sn_list *string
contract_no *string
borrowFrom *map[string]int
inspection_no *string
product_work_no *string
created_at *int64
@@ -18922,6 +18923,55 @@ func (m *OutboundOrderMutation) ResetContractNo() {
delete(m.clearedFields, outboundorder.FieldContractNo)
}
// SetBorrowFrom sets the "borrowFrom" field.
func (m *OutboundOrderMutation) SetBorrowFrom(value map[string]int) {
m.borrowFrom = &value
}
// BorrowFrom returns the value of the "borrowFrom" field in the mutation.
func (m *OutboundOrderMutation) BorrowFrom() (r map[string]int, exists bool) {
v := m.borrowFrom
if v == nil {
return
}
return *v, true
}
// OldBorrowFrom returns the old "borrowFrom" 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) OldBorrowFrom(ctx context.Context) (v map[string]int, err error) {
if !m.op.Is(OpUpdateOne) {
return v, errors.New("OldBorrowFrom is only allowed on UpdateOne operations")
}
if m.id == nil || m.oldValue == nil {
return v, errors.New("OldBorrowFrom requires an ID field in the mutation")
}
oldValue, err := m.oldValue(ctx)
if err != nil {
return v, fmt.Errorf("querying old value for OldBorrowFrom: %w", err)
}
return oldValue.BorrowFrom, nil
}
// ClearBorrowFrom clears the value of the "borrowFrom" field.
func (m *OutboundOrderMutation) ClearBorrowFrom() {
m.borrowFrom = nil
m.clearedFields[outboundorder.FieldBorrowFrom] = struct{}{}
}
// BorrowFromCleared returns if the "borrowFrom" field was cleared in this mutation.
func (m *OutboundOrderMutation) BorrowFromCleared() bool {
_, ok := m.clearedFields[outboundorder.FieldBorrowFrom]
return ok
}
// ResetBorrowFrom resets all changes to the "borrowFrom" field.
func (m *OutboundOrderMutation) ResetBorrowFrom() {
m.borrowFrom = nil
delete(m.clearedFields, outboundorder.FieldBorrowFrom)
}
// SetInspectionNo sets the "inspection_no" field.
func (m *OutboundOrderMutation) SetInspectionNo(s string) {
m.inspection_no = &s
@@ -19110,7 +19160,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, 29)
fields := make([]string, 0, 30)
if m.outbound_no != nil {
fields = append(fields, outboundorder.FieldOutboundNo)
}
@@ -19189,6 +19239,9 @@ func (m *OutboundOrderMutation) Fields() []string {
if m.contract_no != nil {
fields = append(fields, outboundorder.FieldContractNo)
}
if m.borrowFrom != nil {
fields = append(fields, outboundorder.FieldBorrowFrom)
}
if m.inspection_no != nil {
fields = append(fields, outboundorder.FieldInspectionNo)
}
@@ -19258,6 +19311,8 @@ func (m *OutboundOrderMutation) Field(name string) (ent.Value, bool) {
return m.BoxSnList()
case outboundorder.FieldContractNo:
return m.ContractNo()
case outboundorder.FieldBorrowFrom:
return m.BorrowFrom()
case outboundorder.FieldInspectionNo:
return m.InspectionNo()
case outboundorder.FieldProductWorkNo:
@@ -19325,6 +19380,8 @@ func (m *OutboundOrderMutation) OldField(ctx context.Context, name string) (ent.
return m.OldBoxSnList(ctx)
case outboundorder.FieldContractNo:
return m.OldContractNo(ctx)
case outboundorder.FieldBorrowFrom:
return m.OldBorrowFrom(ctx)
case outboundorder.FieldInspectionNo:
return m.OldInspectionNo(ctx)
case outboundorder.FieldProductWorkNo:
@@ -19522,6 +19579,13 @@ func (m *OutboundOrderMutation) SetField(name string, value ent.Value) error {
}
m.SetContractNo(v)
return nil
case outboundorder.FieldBorrowFrom:
v, ok := value.(map[string]int)
if !ok {
return fmt.Errorf("unexpected type %T for field %s", value, name)
}
m.SetBorrowFrom(v)
return nil
case outboundorder.FieldInspectionNo:
v, ok := value.(string)
if !ok {
@@ -19678,6 +19742,9 @@ func (m *OutboundOrderMutation) ClearedFields() []string {
if m.FieldCleared(outboundorder.FieldContractNo) {
fields = append(fields, outboundorder.FieldContractNo)
}
if m.FieldCleared(outboundorder.FieldBorrowFrom) {
fields = append(fields, outboundorder.FieldBorrowFrom)
}
if m.FieldCleared(outboundorder.FieldInspectionNo) {
fields = append(fields, outboundorder.FieldInspectionNo)
}
@@ -19752,6 +19819,9 @@ func (m *OutboundOrderMutation) ClearField(name string) error {
case outboundorder.FieldContractNo:
m.ClearContractNo()
return nil
case outboundorder.FieldBorrowFrom:
m.ClearBorrowFrom()
return nil
case outboundorder.FieldInspectionNo:
m.ClearInspectionNo()
return nil
@@ -19844,6 +19914,9 @@ func (m *OutboundOrderMutation) ResetField(name string) error {
case outboundorder.FieldContractNo:
m.ResetContractNo()
return nil
case outboundorder.FieldBorrowFrom:
m.ResetBorrowFrom()
return nil
case outboundorder.FieldInspectionNo:
m.ResetInspectionNo()
return nil
+16
View File
@@ -4,6 +4,7 @@ package ent
import (
"bj_power_wms/ent/outboundorder"
"encoding/json"
"fmt"
"strings"
@@ -68,6 +69,8 @@ type OutboundOrder struct {
BoxSnList string `json:"boxSnList,omitempty"`
// 合同号(装箱选填)
ContractNo string `json:"contractNo,omitempty"`
// 跨工位借料来源 stationNo→借用量(call 备料出库专用);空=本工位自取
BorrowFrom map[string]int `json:"borrowFrom,omitempty"`
// 检测单号(溯源关联检验单据)
InspectionNo string `json:"inspectionNo,omitempty"`
// 产品工号(随库存带入,出库记录展示/筛选)
@@ -82,6 +85,8 @@ func (*OutboundOrder) scanValues(columns []string) ([]any, error) {
values := make([]any, len(columns))
for i := range columns {
switch columns[i] {
case outboundorder.FieldBorrowFrom:
values[i] = new([]byte)
case outboundorder.FieldNeedAgv:
values[i] = new(sql.NullBool)
case outboundorder.FieldID, outboundorder.FieldManageMode, outboundorder.FieldSnMode, outboundorder.FieldQuantity, outboundorder.FieldCreatedAt:
@@ -265,6 +270,14 @@ func (_m *OutboundOrder) assignValues(columns []string, values []any) error {
} else if value.Valid {
_m.ContractNo = value.String
}
case outboundorder.FieldBorrowFrom:
if value, ok := values[i].(*[]byte); !ok {
return fmt.Errorf("unexpected type %T for field borrowFrom", values[i])
} else if value != nil && len(*value) > 0 {
if err := json.Unmarshal(*value, &_m.BorrowFrom); err != nil {
return fmt.Errorf("unmarshal field borrowFrom: %w", err)
}
}
case outboundorder.FieldInspectionNo:
if value, ok := values[i].(*sql.NullString); !ok {
return fmt.Errorf("unexpected type %T for field inspection_no", values[i])
@@ -397,6 +410,9 @@ func (_m *OutboundOrder) String() string {
builder.WriteString("contract_no=")
builder.WriteString(_m.ContractNo)
builder.WriteString(", ")
builder.WriteString("borrowFrom=")
builder.WriteString(fmt.Sprintf("%v", _m.BorrowFrom))
builder.WriteString(", ")
builder.WriteString("inspection_no=")
builder.WriteString(_m.InspectionNo)
builder.WriteString(", ")
@@ -63,6 +63,8 @@ const (
FieldBoxSnList = "box_sn_list"
// FieldContractNo holds the string denoting the contract_no field in the database.
FieldContractNo = "contract_no"
// FieldBorrowFrom holds the string denoting the borrowfrom field in the database.
FieldBorrowFrom = "borrow_from"
// FieldInspectionNo holds the string denoting the inspection_no field in the database.
FieldInspectionNo = "inspection_no"
// FieldProductWorkNo holds the string denoting the product_work_no field in the database.
@@ -102,6 +104,7 @@ var Columns = []string{
FieldBoxNo,
FieldBoxSnList,
FieldContractNo,
FieldBorrowFrom,
FieldInspectionNo,
FieldProductWorkNo,
FieldCreatedAt,
+10
View File
@@ -1938,6 +1938,16 @@ func ContractNoContainsFold(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldContainsFold(FieldContractNo, v))
}
// BorrowFromIsNil applies the IsNil predicate on the "borrowFrom" field.
func BorrowFromIsNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldIsNull(FieldBorrowFrom))
}
// BorrowFromNotNil applies the NotNil predicate on the "borrowFrom" field.
func BorrowFromNotNil() predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldNotNull(FieldBorrowFrom))
}
// InspectionNoEQ applies the EQ predicate on the "inspection_no" field.
func InspectionNoEQ(v string) predicate.OutboundOrder {
return predicate.OutboundOrder(sql.FieldEQ(FieldInspectionNo, v))
+70
View File
@@ -369,6 +369,12 @@ func (_c *OutboundOrderCreate) SetNillableContractNo(v *string) *OutboundOrderCr
return _c
}
// SetBorrowFrom sets the "borrowFrom" field.
func (_c *OutboundOrderCreate) SetBorrowFrom(v map[string]int) *OutboundOrderCreate {
_c.mutation.SetBorrowFrom(v)
return _c
}
// SetInspectionNo sets the "inspection_no" field.
func (_c *OutboundOrderCreate) SetInspectionNo(v string) *OutboundOrderCreate {
_c.mutation.SetInspectionNo(v)
@@ -636,6 +642,10 @@ func (_c *OutboundOrderCreate) createSpec() (*OutboundOrder, *sqlgraph.CreateSpe
_spec.SetField(outboundorder.FieldContractNo, field.TypeString, value)
_node.ContractNo = value
}
if value, ok := _c.mutation.BorrowFrom(); ok {
_spec.SetField(outboundorder.FieldBorrowFrom, field.TypeJSON, value)
_node.BorrowFrom = value
}
if value, ok := _c.mutation.InspectionNo(); ok {
_spec.SetField(outboundorder.FieldInspectionNo, field.TypeString, value)
_node.InspectionNo = value
@@ -1138,6 +1148,24 @@ func (u *OutboundOrderUpsert) ClearContractNo() *OutboundOrderUpsert {
return u
}
// SetBorrowFrom sets the "borrowFrom" field.
func (u *OutboundOrderUpsert) SetBorrowFrom(v map[string]int) *OutboundOrderUpsert {
u.Set(outboundorder.FieldBorrowFrom, v)
return u
}
// UpdateBorrowFrom sets the "borrowFrom" field to the value that was provided on create.
func (u *OutboundOrderUpsert) UpdateBorrowFrom() *OutboundOrderUpsert {
u.SetExcluded(outboundorder.FieldBorrowFrom)
return u
}
// ClearBorrowFrom clears the value of the "borrowFrom" field.
func (u *OutboundOrderUpsert) ClearBorrowFrom() *OutboundOrderUpsert {
u.SetNull(outboundorder.FieldBorrowFrom)
return u
}
// SetInspectionNo sets the "inspection_no" field.
func (u *OutboundOrderUpsert) SetInspectionNo(v string) *OutboundOrderUpsert {
u.Set(outboundorder.FieldInspectionNo, v)
@@ -1743,6 +1771,27 @@ func (u *OutboundOrderUpsertOne) ClearContractNo() *OutboundOrderUpsertOne {
})
}
// SetBorrowFrom sets the "borrowFrom" field.
func (u *OutboundOrderUpsertOne) SetBorrowFrom(v map[string]int) *OutboundOrderUpsertOne {
return u.Update(func(s *OutboundOrderUpsert) {
s.SetBorrowFrom(v)
})
}
// UpdateBorrowFrom sets the "borrowFrom" field to the value that was provided on create.
func (u *OutboundOrderUpsertOne) UpdateBorrowFrom() *OutboundOrderUpsertOne {
return u.Update(func(s *OutboundOrderUpsert) {
s.UpdateBorrowFrom()
})
}
// ClearBorrowFrom clears the value of the "borrowFrom" field.
func (u *OutboundOrderUpsertOne) ClearBorrowFrom() *OutboundOrderUpsertOne {
return u.Update(func(s *OutboundOrderUpsert) {
s.ClearBorrowFrom()
})
}
// SetInspectionNo sets the "inspection_no" field.
func (u *OutboundOrderUpsertOne) SetInspectionNo(v string) *OutboundOrderUpsertOne {
return u.Update(func(s *OutboundOrderUpsert) {
@@ -2521,6 +2570,27 @@ func (u *OutboundOrderUpsertBulk) ClearContractNo() *OutboundOrderUpsertBulk {
})
}
// SetBorrowFrom sets the "borrowFrom" field.
func (u *OutboundOrderUpsertBulk) SetBorrowFrom(v map[string]int) *OutboundOrderUpsertBulk {
return u.Update(func(s *OutboundOrderUpsert) {
s.SetBorrowFrom(v)
})
}
// UpdateBorrowFrom sets the "borrowFrom" field to the value that was provided on create.
func (u *OutboundOrderUpsertBulk) UpdateBorrowFrom() *OutboundOrderUpsertBulk {
return u.Update(func(s *OutboundOrderUpsert) {
s.UpdateBorrowFrom()
})
}
// ClearBorrowFrom clears the value of the "borrowFrom" field.
func (u *OutboundOrderUpsertBulk) ClearBorrowFrom() *OutboundOrderUpsertBulk {
return u.Update(func(s *OutboundOrderUpsert) {
s.ClearBorrowFrom()
})
}
// SetInspectionNo sets the "inspection_no" field.
func (u *OutboundOrderUpsertBulk) SetInspectionNo(v string) *OutboundOrderUpsertBulk {
return u.Update(func(s *OutboundOrderUpsert) {
+36
View File
@@ -520,6 +520,18 @@ func (_u *OutboundOrderUpdate) ClearContractNo() *OutboundOrderUpdate {
return _u
}
// SetBorrowFrom sets the "borrowFrom" field.
func (_u *OutboundOrderUpdate) SetBorrowFrom(v map[string]int) *OutboundOrderUpdate {
_u.mutation.SetBorrowFrom(v)
return _u
}
// ClearBorrowFrom clears the value of the "borrowFrom" field.
func (_u *OutboundOrderUpdate) ClearBorrowFrom() *OutboundOrderUpdate {
_u.mutation.ClearBorrowFrom()
return _u
}
// SetInspectionNo sets the "inspection_no" field.
func (_u *OutboundOrderUpdate) SetInspectionNo(v string) *OutboundOrderUpdate {
_u.mutation.SetInspectionNo(v)
@@ -763,6 +775,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.BorrowFrom(); ok {
_spec.SetField(outboundorder.FieldBorrowFrom, field.TypeJSON, value)
}
if _u.mutation.BorrowFromCleared() {
_spec.ClearField(outboundorder.FieldBorrowFrom, field.TypeJSON)
}
if value, ok := _u.mutation.InspectionNo(); ok {
_spec.SetField(outboundorder.FieldInspectionNo, field.TypeString, value)
}
@@ -1294,6 +1312,18 @@ func (_u *OutboundOrderUpdateOne) ClearContractNo() *OutboundOrderUpdateOne {
return _u
}
// SetBorrowFrom sets the "borrowFrom" field.
func (_u *OutboundOrderUpdateOne) SetBorrowFrom(v map[string]int) *OutboundOrderUpdateOne {
_u.mutation.SetBorrowFrom(v)
return _u
}
// ClearBorrowFrom clears the value of the "borrowFrom" field.
func (_u *OutboundOrderUpdateOne) ClearBorrowFrom() *OutboundOrderUpdateOne {
_u.mutation.ClearBorrowFrom()
return _u
}
// SetInspectionNo sets the "inspection_no" field.
func (_u *OutboundOrderUpdateOne) SetInspectionNo(v string) *OutboundOrderUpdateOne {
_u.mutation.SetInspectionNo(v)
@@ -1567,6 +1597,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.BorrowFrom(); ok {
_spec.SetField(outboundorder.FieldBorrowFrom, field.TypeJSON, value)
}
if _u.mutation.BorrowFromCleared() {
_spec.ClearField(outboundorder.FieldBorrowFrom, field.TypeJSON)
}
if value, ok := _u.mutation.InspectionNo(); ok {
_spec.SetField(outboundorder.FieldInspectionNo, field.TypeString, value)
}
+1 -1
View File
@@ -437,7 +437,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[28].Descriptor()
outboundorderDescCreatedAt := outboundorderFields[29].Descriptor()
// outboundorder.DefaultCreatedAt holds the default value on creation for the created_at field.
outboundorder.DefaultCreatedAt = outboundorderDescCreatedAt.Default.(func() int64)
permissionFields := schema.Permission{}.Fields()