Merge branch 'master' of http://192.168.5.5:10010/r/aps/WMS
| | |
| | | if params.PageInfo.Check() { |
| | | search.SetPage(params.Page, params.PageSize) |
| | | } |
| | | list, total, err := search.SetKeyword(params.KeyWord).SetType(params.Type).SetJointName(params.JointName).SetOrder("created_at desc").Find() |
| | | list, total, err := search.SetKeyword(params.KeyWord).SetType(params.Type).SetJointName(params.JointName). |
| | | SetIsScrapLocation(params.IsScrapLocation).SetOrder("created_at desc").Find() |
| | | if err != nil { |
| | | util.ResponseFormat(c, code.RequestParamError, "查找失败") |
| | | return |
| | |
| | | "request.GetLocationList": { |
| | | "type": "object", |
| | | "properties": { |
| | | "isScrapLocation": { |
| | | "description": "是否报废", |
| | | "type": "boolean" |
| | | }, |
| | | "jointName": { |
| | | "description": "拼接名称", |
| | | "type": "string" |
| | |
| | | "request.GetLocationList": { |
| | | "type": "object", |
| | | "properties": { |
| | | "isScrapLocation": { |
| | | "description": "是否报废", |
| | | "type": "boolean" |
| | | }, |
| | | "jointName": { |
| | | "description": "拼接名称", |
| | | "type": "string" |
| | |
| | | type: object |
| | | request.GetLocationList: |
| | | properties: |
| | | isScrapLocation: |
| | | description: 是否报废 |
| | | type: boolean |
| | | jointName: |
| | | description: 拼接名称 |
| | | type: string |
| | |
| | | return slf |
| | | } |
| | | |
| | | func (slf *LocationSearch) SetIsScrapLocation(isScrapLocation bool) *LocationSearch { |
| | | slf.IsScrapLocation = isScrapLocation |
| | | return slf |
| | | } |
| | | |
| | | func (slf *LocationSearch) build() *gorm.DB { |
| | | var db = slf.Orm.Table(slf.TableName()) |
| | | |
| | |
| | | } |
| | | if len(slf.JointNames) != 0 { |
| | | db = db.Where("joint_name in (?)", slf.JointNames) |
| | | } |
| | | |
| | | if slf.IsScrapLocation { |
| | | db = db.Where("is_scrap_location = ?", slf.IsScrapLocation) |
| | | } |
| | | |
| | | return db |
| | |
| | | locations = append(locations, &Location{Name: "库存损失", Type: 5, JointName: "库存损失"}) |
| | | locations = append(locations, &Location{Name: "生产", Type: 6, JointName: "生产"}) |
| | | locations = append(locations, &Location{Name: "中转位置", Type: 7, JointName: "中转位置"}) |
| | | locations = append(locations, &Location{Name: "报废位置", Type: 8, JointName: "报废位置"}) |
| | | locations = append(locations, &Location{Name: "报废位置", Type: 8, JointName: "报废位置", IsScrapLocation: true}) |
| | | locations = append(locations, &Location{Name: "库存盘点", Type: 9, JointName: "库存盘点"}) |
| | | return slf.CreateBatch(locations) |
| | | } |
| | |
| | | |
| | | type GetLocationList struct { |
| | | PageInfo |
| | | Type int `json:"type"` |
| | | KeyWord string `json:"keyWord"` |
| | | JointName string `json:"jointName"` //拼接名称 |
| | | Type int `json:"type"` |
| | | KeyWord string `json:"keyWord"` |
| | | JointName string `json:"jointName"` //拼接名称 |
| | | IsScrapLocation bool `json:"isScrapLocation"` //是否报废 |
| | | } |