jiangshuai
2023-11-15 b13834f8c0b4a0fe9928cb07a721e6ec7df86ae1
Merge branch 'master' of http://192.168.5.5:10010/r/aps/WMS
6个文件已修改
32 ■■■■ 已修改文件
controllers/location.go 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
models/location.go 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
request/location.go 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/location.go
@@ -68,7 +68,8 @@
    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
docs/docs.go
@@ -3938,6 +3938,10 @@
        "request.GetLocationList": {
            "type": "object",
            "properties": {
                "isScrapLocation": {
                    "description": "是否报废",
                    "type": "boolean"
                },
                "jointName": {
                    "description": "拼接名称",
                    "type": "string"
docs/swagger.json
@@ -3926,6 +3926,10 @@
        "request.GetLocationList": {
            "type": "object",
            "properties": {
                "isScrapLocation": {
                    "description": "是否报废",
                    "type": "boolean"
                },
                "jointName": {
                    "description": "拼接名称",
                    "type": "string"
docs/swagger.yaml
@@ -1089,6 +1089,9 @@
    type: object
  request.GetLocationList:
    properties:
      isScrapLocation:
        description: 是否报废
        type: boolean
      jointName:
        description: 拼接名称
        type: string
models/location.go
@@ -115,6 +115,11 @@
    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())
@@ -153,6 +158,10 @@
    }
    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
@@ -348,7 +357,7 @@
    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)
}
request/location.go
@@ -9,7 +9,8 @@
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"` //是否报废
}