| | |
| | | ToLocationID int `json:"toLocationId" gorm:"type:int;not null;comment:仓库位置id"` //目标位置id |
| | | ToLocation Location `json:"toLocation" gorm:"foreignKey:ToLocationID;references:Id"` //目标位置 |
| | | SalesDetailsNumber string `gorm:"type:varchar(191);comment:销售明细编码" json:"salesDetailsNumber"` |
| | | |
| | | ManagerId string `json:"managerId" gorm:"type:varchar(255);comment:主管id"` |
| | | Manager string `json:"manager" gorm:"type:varchar(255);comment:主管名称"` |
| | | AccountantId string `json:"accountantId" gorm:"type:varchar(255);comment:会计id"` |
| | | Accountant string `json:"accountant" gorm:"type:varchar(255);comment:会计名称"` |
| | | CustodianId string `json:"custodianId" gorm:"type:varchar(255);comment:保管员id"` |
| | | Custodian string `json:"custodian" gorm:"type:varchar(255);comment:保管员名称"` |
| | | } |
| | | |
| | | OperationSearch struct { |
| | | Operation |
| | | Order string |
| | | PageNum int |
| | | PageSize int |
| | | Keyword string |
| | | Orm *gorm.DB |
| | | Preload bool |
| | | Disuse bool |
| | | Ids []int |
| | | Numbers []string |
| | | Order string |
| | | PageNum int |
| | | PageSize int |
| | | Keyword string |
| | | Orm *gorm.DB |
| | | Preload bool |
| | | Disuse bool |
| | | Ids []int |
| | | SourceNumbers []string |
| | | SalesDetailsNumbers []string |
| | | } |
| | | ) |
| | | |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationSearch) SetSourceNumbers(numbers []string) *OperationSearch { |
| | | slf.SourceNumbers = numbers |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationSearch) SetDisuse(disuse bool) *OperationSearch { |
| | | slf.Disuse = disuse |
| | | return slf |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationSearch) SetSalesDetailsNumbers(salesDetailsNumbers []string) *OperationSearch { |
| | | slf.SalesDetailsNumbers = salesDetailsNumbers |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationSearch) SetOperationSource(operationSource constvar.OperationSource) *OperationSearch { |
| | | slf.OperationSource = operationSource |
| | | return slf |
| | |
| | | |
| | | if slf.SourceNumber != "" { |
| | | db = db.Where("source_number = ?", slf.SourceNumber) |
| | | } |
| | | |
| | | if len(slf.SourceNumbers) > 0 { |
| | | db = db.Where("source_number in (?)", slf.SourceNumbers) |
| | | } |
| | | |
| | | if slf.Number != "" { |
| | |
| | | db = db.Where("sales_details_number = ?", slf.SalesDetailsNumber) |
| | | } |
| | | |
| | | if len(slf.SalesDetailsNumbers) > 0 { |
| | | db = db.Where("sales_details_number in (?)", slf.SalesDetailsNumbers) |
| | | } |
| | | |
| | | if slf.OperationSource != 0 { |
| | | db = db.Where("operation_source = ?", slf.OperationSource) |
| | | } |