From c9b52c35041b3838e4fef7a2052b7d798ec00883 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 14 六月 2024 10:43:19 +0800
Subject: [PATCH] 操作明细查询支持位置和仓库过滤

---
 controllers/operation.go |    6 ++++++
 docs/swagger.yaml        |   12 +++++++++++-
 request/operation.go     |    5 ++++-
 docs/docs.go             |   13 +++++++++++++
 docs/swagger.json        |   13 +++++++++++++
 5 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/controllers/operation.go b/controllers/operation.go
index a163cc6..8193fa9 100644
--- a/controllers/operation.go
+++ b/controllers/operation.go
@@ -1289,6 +1289,12 @@
 	if params.Condition != "" {
 		db = db.Where("wms_operation.number like ? or wms_operation.source_number like ? or from_location.`name` like ? or to_location.`name` like ? or material.`name` like ? ", "%"+params.Condition+"%", "%"+params.Condition+"%", "%"+params.Condition+"%", "%"+params.Condition+"%", "%"+params.Condition+"%")
 	}
+	if params.WarehouseId != 0 {
+		db = db.Where("warehouse_id = ?", params.WarehouseId)
+	}
+	if params.LocationId != 0 {
+		db = db.Where("location_id = ?", params.LocationId)
+	}
 	var (
 		records = make([]*response.InventoryHistory, 0)
 		total   int64
diff --git a/docs/docs.go b/docs/docs.go
index 44264e2..56ac84f 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -1861,6 +1861,7 @@
                 "parameters": [
                     {
                         "type": "string",
+                        "description": "鍏抽敭瀛楁悳绱�",
                         "name": "keyword",
                         "in": "query"
                     },
@@ -5254,6 +5255,14 @@
                 "condition": {
                     "type": "string"
                 },
+                "keyword": {
+                    "description": "鍏抽敭瀛楁悳绱�",
+                    "type": "string"
+                },
+                "locationId": {
+                    "description": "浣嶇疆ID",
+                    "type": "integer"
+                },
                 "page": {
                     "description": "椤电爜",
                     "type": "integer"
@@ -5261,6 +5270,10 @@
                 "pageSize": {
                     "description": "姣忛〉澶у皬",
                     "type": "integer"
+                },
+                "warehouseId": {
+                    "description": "浠撳簱ID",
+                    "type": "integer"
                 }
             }
         },
diff --git a/docs/swagger.json b/docs/swagger.json
index 1a30d55..78a2dd8 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -1849,6 +1849,7 @@
                 "parameters": [
                     {
                         "type": "string",
+                        "description": "鍏抽敭瀛楁悳绱�",
                         "name": "keyword",
                         "in": "query"
                     },
@@ -5242,6 +5243,14 @@
                 "condition": {
                     "type": "string"
                 },
+                "keyword": {
+                    "description": "鍏抽敭瀛楁悳绱�",
+                    "type": "string"
+                },
+                "locationId": {
+                    "description": "浣嶇疆ID",
+                    "type": "integer"
+                },
                 "page": {
                     "description": "椤电爜",
                     "type": "integer"
@@ -5249,6 +5258,10 @@
                 "pageSize": {
                     "description": "姣忛〉澶у皬",
                     "type": "integer"
+                },
+                "warehouseId": {
+                    "description": "浠撳簱ID",
+                    "type": "integer"
                 }
             }
         },
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index fa5ffbe..206520a 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -1562,11 +1562,20 @@
     properties:
       condition:
         type: string
+      keyword:
+        description: 鍏抽敭瀛楁悳绱�
+        type: string
+      locationId:
+        description: 浣嶇疆ID
+        type: integer
       page:
         description: 椤电爜
         type: integer
       pageSize:
         description: 姣忛〉澶у皬
+        type: integer
+      warehouseId:
+        description: 浠撳簱ID
         type: integer
     type: object
   request.OperationDetails:
@@ -3148,7 +3157,8 @@
   /api-wms/v1/operationType/operationType:
     get:
       parameters:
-      - in: query
+      - description: 鍏抽敭瀛楁悳绱�
+        in: query
         name: keyword
         type: string
       - description: 椤电爜
diff --git a/request/operation.go b/request/operation.go
index 43e2b85..73647ab 100644
--- a/request/operation.go
+++ b/request/operation.go
@@ -102,5 +102,8 @@
 
 type OperationCondition struct {
 	PageInfo
-	Condition string `json:"condition"`
+	Condition   string `json:"condition"`
+	Keyword     string `json:"keyword" form:"keyword"`         //鍏抽敭瀛楁悳绱�
+	WarehouseId int    `json:"warehouseId" form:"warehouseId"` //浠撳簱ID
+	LocationId  int    `json:"locationId" form:"locationId"`   //浣嶇疆ID
 }

--
Gitblit v1.8.0