| | |
| | | ReturnOperationType string `json:"returnOperationType" gorm:"-"` //退货类型名称 |
| | | ReadyCount int `json:"readyCount" gorm:"-"` //就绪数量 |
| | | FinishCount int `json:"finishCount" gorm:"-"` //完成数量 |
| | | CancelCount int `json:"cancelCount" gorm:"-"` //取消1数量 |
| | | } |
| | | |
| | | OperationTypeSearch struct { |
| | | OperationType |
| | | Order string |
| | | PageNum int |
| | | PageSize int |
| | | Keyword string |
| | | Orm *gorm.DB |
| | | Preload bool |
| | | Order string |
| | | PageNum int |
| | | PageSize int |
| | | Keyword string |
| | | Orm *gorm.DB |
| | | Preload bool |
| | | WarehouseIds []int |
| | | } |
| | | |
| | | OperationTypeByStatus struct { |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationTypeSearch) SetWarehouseIds(warehouseIds []int) *OperationTypeSearch { |
| | | slf.WarehouseIds = warehouseIds |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationTypeSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Model(&OperationType{}) |
| | | |
| | |
| | | db = db.Where("warehouse_id = ?", slf.WarehouseId) |
| | | } |
| | | |
| | | if len(slf.WarehouseIds) > 0 { |
| | | db = db.Where("warehouse_id in ?", slf.WarehouseIds) |
| | | } |
| | | |
| | | if int(slf.BaseOperationType) != 0 { |
| | | db = db.Where("base_operation_type = ?", slf.BaseOperationType) |
| | | } |