zhangqian
2024-06-14 c73d79fe050e21bc53b3e94b6ca79fd3761d4d17
操作类型支持仓库id搜索
5个文件已修改
194 ■■■■■ 已修改文件
controllers/operation_type.go 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/docs.go 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.json 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/swagger.yaml 47 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
request/operation_type.go 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
controllers/operation_type.go
@@ -116,7 +116,12 @@
        util.ResponseFormat(c, code.RequestParamError, err.Error())
        return
    }
    list, total, err := models.NewOperationTypeSearch().SetPage(params.Page, params.PageSize).SetKeyword(params.Keyword).SetOrder("id desc").SetPreload(true).Find()
    list, total, err := models.NewOperationTypeSearch().
        SetPage(params.Page, params.PageSize).
        SetKeyword(params.Keyword).
        SetOrder("id desc").
        SetWarehouseId(params.WarehouseId).
        SetPreload(true).Find()
    if err != nil {
        util.ResponseFormat(c, code.RequestError, "查找失败")
        return
docs/docs.go
@@ -1875,6 +1875,12 @@
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "仓库id",
                        "name": "warehouseId",
                        "in": "query"
                    }
                ],
                "responses": {
@@ -3445,6 +3451,18 @@
                "ReservationNever"
            ]
        },
        "gorm.DeletedAt": {
            "type": "object",
            "properties": {
                "time": {
                    "type": "string"
                },
                "valid": {
                    "description": "Valid is true if Time is not NULL",
                    "type": "boolean"
                }
            }
        },
        "inventory_order.WorkerInfo": {
            "type": "object",
            "properties": {
@@ -3473,6 +3491,46 @@
                },
                "id": {
                    "type": "integer"
                }
            }
        },
        "models.Attribute": {
            "type": "object",
            "properties": {
                "createdAt": {
                    "type": "string"
                },
                "dataType": {
                    "description": "值类型(1字符串 2 int 3 下拉框 )",
                    "type": "integer"
                },
                "deletedAt": {
                    "$ref": "#/definitions/gorm.DeletedAt"
                },
                "entityType": {
                    "description": "给谁用的 1 物料(产品)",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "description": "属性名称",
                    "type": "string"
                },
                "selectValues": {
                    "description": "dateType=3时用",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "updatedAt": {
                    "type": "string"
                },
                "value": {
                    "description": "从AttributeValue取到的value",
                    "type": "string"
                }
            }
        },
@@ -3712,6 +3770,13 @@
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Attachment"
                    }
                },
                "attributes": {
                    "description": "动态属性",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Attribute"
                    }
                },
                "autoIncr": {
@@ -4326,6 +4391,9 @@
                "id": {
                    "type": "integer"
                },
                "note": {
                    "type": "string"
                },
                "operationId": {
                    "description": "操作id",
                    "type": "integer"
docs/swagger.json
@@ -1863,6 +1863,12 @@
                        "description": "每页大小",
                        "name": "pageSize",
                        "in": "query"
                    },
                    {
                        "type": "integer",
                        "description": "仓库id",
                        "name": "warehouseId",
                        "in": "query"
                    }
                ],
                "responses": {
@@ -3433,6 +3439,18 @@
                "ReservationNever"
            ]
        },
        "gorm.DeletedAt": {
            "type": "object",
            "properties": {
                "time": {
                    "type": "string"
                },
                "valid": {
                    "description": "Valid is true if Time is not NULL",
                    "type": "boolean"
                }
            }
        },
        "inventory_order.WorkerInfo": {
            "type": "object",
            "properties": {
@@ -3461,6 +3479,46 @@
                },
                "id": {
                    "type": "integer"
                }
            }
        },
        "models.Attribute": {
            "type": "object",
            "properties": {
                "createdAt": {
                    "type": "string"
                },
                "dataType": {
                    "description": "值类型(1字符串 2 int 3 下拉框 )",
                    "type": "integer"
                },
                "deletedAt": {
                    "$ref": "#/definitions/gorm.DeletedAt"
                },
                "entityType": {
                    "description": "给谁用的 1 物料(产品)",
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "name": {
                    "description": "属性名称",
                    "type": "string"
                },
                "selectValues": {
                    "description": "dateType=3时用",
                    "type": "array",
                    "items": {
                        "type": "string"
                    }
                },
                "updatedAt": {
                    "type": "string"
                },
                "value": {
                    "description": "从AttributeValue取到的value",
                    "type": "string"
                }
            }
        },
@@ -3700,6 +3758,13 @@
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Attachment"
                    }
                },
                "attributes": {
                    "description": "动态属性",
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/models.Attribute"
                    }
                },
                "autoIncr": {
@@ -4314,6 +4379,9 @@
                "id": {
                    "type": "integer"
                },
                "note": {
                    "type": "string"
                },
                "operationId": {
                    "description": "操作id",
                    "type": "integer"
docs/swagger.yaml
@@ -311,6 +311,14 @@
    - WhetherTypeAsk
    - WhetherTypeAlways
    - ReservationNever
  gorm.DeletedAt:
    properties:
      time:
        type: string
      valid:
        description: Valid is true if Time is not NULL
        type: boolean
    type: object
  inventory_order.WorkerInfo:
    properties:
      id:
@@ -330,6 +338,34 @@
        $ref: '#/definitions/constvar.FileType'
      id:
        type: integer
    type: object
  models.Attribute:
    properties:
      createdAt:
        type: string
      dataType:
        description: 值类型(1字符串 2 int 3 下拉框 )
        type: integer
      deletedAt:
        $ref: '#/definitions/gorm.DeletedAt'
      entityType:
        description: 给谁用的 1 物料(产品)
        type: integer
      id:
        type: integer
      name:
        description: 属性名称
        type: string
      selectValues:
        description: dateType=3时用
        items:
          type: string
        type: array
      updatedAt:
        type: string
      value:
        description: 从AttributeValue取到的value
        type: string
    type: object
  models.Company:
    properties:
@@ -496,6 +532,11 @@
      attachmentList:
        items:
          $ref: '#/definitions/models.Attachment'
        type: array
      attributes:
        description: 动态属性
        items:
          $ref: '#/definitions/models.Attribute'
        type: array
      autoIncr:
        type: integer
@@ -929,6 +970,8 @@
        type: integer
      id:
        type: integer
      note:
        type: string
      operationId:
        description: 操作id
        type: integer
@@ -3116,6 +3159,10 @@
        in: query
        name: pageSize
        type: integer
      - description: 仓库id
        in: query
        name: warehouseId
        type: integer
      produces:
      - application/json
      responses:
request/operation_type.go
@@ -4,8 +4,8 @@
type GetOperationTypeList struct {
    PageInfo
    Keyword     string `json:"keyword"`
    WarehouseId int    `json:"warehouseId" gorm:"type:int;not null;comment:仓库id"` //仓库id
    Keyword     string `json:"keyword" form:"keyword"`         //关键字搜索
    WarehouseId int    `json:"warehouseId" form:"warehouseId"` //仓库id
}
type AddOperationType struct {