| | |
| | | WmsModel |
| | | Id int `json:"id" gorm:"column:id;primary_key;AUTO_INCREMENT"` |
| | | Number string `json:"number" gorm:"type:varchar(255)"` //单号 |
| | | SourceNumber string `json:"sourceNumber" gorm:"type:varchar(255)"` //源单号 |
| | | SourceNumber string `json:"sourceNumber" gorm:"index;type:varchar(255)"` //源单号 |
| | | OperationTypeId int `json:"operationTypeId" gorm:"type:int;not null;comment:作业类型id"` //作业类型id |
| | | OperationTypeName string `json:"operationTypeName" gorm:"type:varchar(127);comment:作业类型名称"` //作业类型名称 |
| | | Status constvar.OperationStatus `json:"status" gorm:"type:int(11);not null;comment:状态"` //状态 |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationSearch) SetOperationSource(operationSource constvar.OperationSource) *OperationSearch { |
| | | slf.OperationSource = operationSource |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Model(&Operation{}) |
| | | |
| | |
| | | db = db.Where("sales_details_number = ?", slf.SalesDetailsNumber) |
| | | } |
| | | |
| | | if slf.OperationSource != 0 { |
| | | db = db.Where("operation_source = ?", slf.OperationSource) |
| | | } |
| | | |
| | | return db |
| | | } |
| | | |