| | |
| | | |
| | | import ( |
| | | "fmt" |
| | | "github.com/shopspring/decimal" |
| | | "gorm.io/gorm" |
| | | "wms/constvar" |
| | | "wms/pkg/mysqlx" |
| | |
| | | CompanyID int `json:"companyID" gorm:"type:int;comment:公司ID-客户"` |
| | | CompanyName string `json:"companyName" gorm:"type:varchar(127);comment:公司名称-客户"` |
| | | Comment string `json:"comment" gorm:"type:text;comment:备注"` |
| | | LogisticCompanyId string `json:"logisticCompanyId" gorm:"type:varchar(191);comment:物流公司id"` |
| | | LogisticCompany LogisticCompany `json:"logisticCompany" gorm:"foreignKey:LogisticCompanyId"` |
| | | WaybillNumber string `json:"waybillNumber" gorm:"type:varchar(255);comment:运单号"` //运单号 |
| | | Weight decimal.Decimal `gorm:"type:decimal(20,2);comment:重量" json:"weight"` //重量 |
| | | LogisticWeight decimal.Decimal `gorm:"type:decimal(20,2);comment:物流重量" json:"logisticWeight"` //物流重量 |
| | | |
| | | Details []*OperationDetails `json:"details" gorm:"foreignKey:OperationID;references:Id"` |
| | | BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"type:tinyint;not null;comment:基础作业类型"` //基础作业类型 |
| | |
| | | } |
| | | |
| | | if slf.Preload { |
| | | db = db.Model(&Operation{}).Preload("Details").Preload("Details.Product").Preload("FromLocation").Preload("ToLocation") |
| | | db = db.Model(&Operation{}).Preload("Details").Preload("Details.Product").Preload("FromLocation"). |
| | | Preload("ToLocation").Preload("LogisticCompany") |
| | | } |
| | | |
| | | if slf.Disuse { |