wanjianli
2023-09-18 690dd891f8ee47b6036eb87c239275490ee02b7f
models/operation.go
@@ -4,6 +4,7 @@
   "fmt"
   "gorm.io/gorm"
   "wms/constvar"
   "wms/extend/util"
   "wms/pkg/mysqlx"
)
@@ -11,19 +12,26 @@
   // Operation 操作表
   Operation struct {
      WmsModel
      Id           int    `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
      Number       string `json:"number" gorm:"column:number;type:varchar(255)"` //单号
      SourceNumber string `json:"sourceNumber" gorm:"type:varchar(255)"`         //源单号
      BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:基础作业类型"` //基础作业类型
      OperationTypeId   int                        `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"`       //作业类型id
      Status            int                        `json:"status" gorm:"type:tinyint;not null;comment:状态"`                //状态
      FromLocationId int      `json:"fromLocationId"   gorm:"type:int;not null;comment:源位置id"` //源位置id
      FromLocation   Location `json:"fromLocation"     gorm:"foreignKey:FromLocationId"`       //源位置
      ToLocationId   int      `json:"toLocationId"    gorm:"type:int;not null;comment:目标位置id"` //目标位置id
      ToLocation     Location `json:"toLocation"      gorm:"foreignKey:ToLocationId"`          //目标位置
      Id              int                      `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"`
      Number          string                   `json:"number" gorm:"column:number;type:varchar(255)"`           //单号
      SourceNumber    string                   `json:"sourceNumber" gorm:"type:varchar(255)"`                   //源单号
      OperationTypeId int                      `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"` //作业类型id
      Status          constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:状态"`          //状态
      FromLocationId  int                      `json:"fromLocationId"   gorm:"type:int;not null;comment:源位置id"` //源位置id
      FromLocation    Location                 `json:"fromLocation"     gorm:"foreignKey:FromLocationId"`       //源位置
      ToLocationId    int                      `json:"toLocationId"    gorm:"type:int;not null;comment:目标位置id"` //目标位置id
      ToLocation      Location                 `json:"toLocation"      gorm:"foreignKey:ToLocationId"`          //目标位置
      OperationDate   util.JSONTime            `json:"operationDate" gorm:"comment:安排日期"`
      CarrierID       int                      `json:"carrierID" gorm:"type:int;comment:承运商ID"`
      CarrierName     string                   `json:"carrierName" gorm:"type:varchar(63);comment:承运商名称"`
      Tracking        string                   `json:"tracking" gorm:"type:varchar(127);comment:追踪参考"`
      ContacterID     int                      `json:"contacterID" gorm:"type:int;comment:联系人ID"`
      ContacterName   string                   `json:"contacterName" gorm:"type:varchar(63);comment:联系人姓名"`
      Weight          float64                  `json:"weight" gorm:"type:decimal;comment:重量(kg)"`
      TransferWeight  float64                  `json:"transferWeight" gorm:"type:decimal;comment:物流重量(kg)"`
      CompanyID       int                      `json:"companyID" gorm:"type:int;comment:公司ID"`
      CompanyName     string                   `json:"companyName" gorm:"type:varchar(127);comment:公司名称(kg)"`
      Details         []*OperationDetails      `json:"details"`
   }
   OperationSearch struct {