| | |
| | | if params.PageInfo.Check() { |
| | | search.SetPage(params.Page, params.PageSize) |
| | | } |
| | | list, total, err := search.SetKeyword(params.KeyWord).SetOrder("created_at desc").Find() |
| | | list, total, err := search.SetKeyword(params.KeyWord).SetJointName(params.JointName).SetOrder("created_at desc").Find() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查找失败") |
| | | return |
| | |
| | | operationIds = append(operationIds, detail.OperationID) |
| | | } |
| | | //获取已完成的操作记录 |
| | | operations, total, err := models.NewOperationSearch().SetIds(operationIds).SetStatus(constvar.OperationStatus_Finish).Find() |
| | | operations, total, err := models.NewOperationSearch().SetIds(operationIds).SetBaseOperationType(params.BaseOperationType). |
| | | SetStatus(constvar.OperationStatus_Finish).Find() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查询操作记录失败") |
| | | return |
| | |
| | | slf.Ids = ids |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationSearch) SetStatus(status constvar.OperationStatus) *OperationSearch { |
| | | slf.Status = status |
| | | return slf |
| | | } |
| | | |
| | | func (slf *OperationSearch) SetBaseOperationType(baseOperationType constvar.BaseOperationType) *OperationSearch { |
| | | slf.BaseOperationType = baseOperationType |
| | | return slf |
| | | } |
| | | |
| | |
| | | db = db.Where("status = ?", slf.Status) |
| | | } |
| | | |
| | | if slf.BaseOperationType != 0 { |
| | | db = db.Where("base_operation_type = ?", slf.BaseOperationType) |
| | | } |
| | | |
| | | return db |
| | | } |
| | | |
| | |
| | | type GetLocationList struct { |
| | | PageInfo |
| | | KeyWord string `json:"keyWord"` |
| | | JointName string `json:"jointName"` //拼接名称 |
| | | } |
| | |
| | | package request |
| | | |
| | | import "wms/constvar" |
| | | |
| | | type GetInventoryForms struct { |
| | | PageInfo |
| | | CategoryIds []int `json:"categoryIds"` //产品类型id |
| | |
| | | ProductName string `json:"productName"` //产品名称 |
| | | Unit string `json:"unit"` //单位 |
| | | KeyWord string `json:"keyWord"` //搜索条件 |
| | | BaseOperationType constvar.BaseOperationType `json:"baseOperationType"` //基础作业类型 |
| | | } |
| | | |
| | | type GetLocationForms struct { |