feat: 大屏多订单改为同屏并列展示,物料申请新增跨工位借料来源并移除工单完成日期
This commit is contained in:
@@ -4,6 +4,7 @@ package ent
|
||||
|
||||
import (
|
||||
"bj_power_mes/ent/materialrequest"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -53,6 +54,8 @@ type MaterialRequest struct {
|
||||
OutboundNo string `json:"outboundNo,omitempty"`
|
||||
// 驳回理由(仓库拒发时必填)
|
||||
RejectReason string `json:"rejectReason,omitempty"`
|
||||
// 跨工位借料来源 stationNo→借用量;空=本工位自取
|
||||
BorrowFrom map[string]int `json:"borrowFrom,omitempty"`
|
||||
// Operator holds the value of the "operator" field.
|
||||
Operator string `json:"operator,omitempty"`
|
||||
// CreatedAt holds the value of the "createdAt" field.
|
||||
@@ -67,6 +70,8 @@ func (*MaterialRequest) scanValues(columns []string) ([]any, error) {
|
||||
values := make([]any, len(columns))
|
||||
for i := range columns {
|
||||
switch columns[i] {
|
||||
case materialrequest.FieldBorrowFrom:
|
||||
values[i] = new([]byte)
|
||||
case materialrequest.FieldNeedAgv, materialrequest.FieldCrossDay:
|
||||
values[i] = new(sql.NullBool)
|
||||
case materialrequest.FieldReqQty, materialrequest.FieldSentQty, materialrequest.FieldReturnedQty:
|
||||
@@ -206,6 +211,14 @@ func (_m *MaterialRequest) assignValues(columns []string, values []any) error {
|
||||
} else if value.Valid {
|
||||
_m.RejectReason = value.String
|
||||
}
|
||||
case materialrequest.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 materialrequest.FieldOperator:
|
||||
if value, ok := values[i].(*sql.NullString); !ok {
|
||||
return fmt.Errorf("unexpected type %T for field operator", values[i])
|
||||
@@ -315,6 +328,9 @@ func (_m *MaterialRequest) String() string {
|
||||
builder.WriteString("rejectReason=")
|
||||
builder.WriteString(_m.RejectReason)
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("borrowFrom=")
|
||||
builder.WriteString(fmt.Sprintf("%v", _m.BorrowFrom))
|
||||
builder.WriteString(", ")
|
||||
builder.WriteString("operator=")
|
||||
builder.WriteString(_m.Operator)
|
||||
builder.WriteString(", ")
|
||||
|
||||
Reference in New Issue
Block a user