From c73d79fe050e21bc53b3e94b6ca79fd3761d4d17 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 14 六月 2024 10:24:52 +0800
Subject: [PATCH] 操作类型支持仓库id搜索

---
 controllers/operation_type.go |    7 +
 docs/swagger.yaml             |   47 +++++++++++
 request/operation_type.go     |    4 
 docs/docs.go                  |   68 +++++++++++++++++
 docs/swagger.json             |   68 +++++++++++++++++
 5 files changed, 191 insertions(+), 3 deletions(-)

diff --git a/controllers/operation_type.go b/controllers/operation_type.go
index 5faabe7..9b0525e 100644
--- a/controllers/operation_type.go
+++ b/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
diff --git a/docs/docs.go b/docs/docs.go
index 3556fb5..44264e2 100644
--- a/docs/docs.go
+++ b/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": "浠嶢ttributeValue鍙栧埌鐨剉alue",
+                    "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"
diff --git a/docs/swagger.json b/docs/swagger.json
index 3b27c5b..1a30d55 100644
--- a/docs/swagger.json
+++ b/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": "浠嶢ttributeValue鍙栧埌鐨剉alue",
+                    "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"
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index c470564..fa5ffbe 100644
--- a/docs/swagger.yaml
+++ b/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: 浠嶢ttributeValue鍙栧埌鐨剉alue
+        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:
diff --git a/request/operation_type.go b/request/operation_type.go
index be30ae5..bf00dee 100644
--- a/request/operation_type.go
+++ b/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 {

--
Gitblit v1.8.0