From ee20ffe2a2d1494af0a1285440605d67a5846da6 Mon Sep 17 00:00:00 2001
From: jiangshuai <291802688@qq.com>
Date: 星期四, 21 九月 2023 09:34:50 +0800
Subject: [PATCH] 1.出入库一部分代码

---
 controllers/operation.go    |    9 +
 docs/swagger.yaml           |   94 +++++++-----
 request/operation.go        |   25 ++-
 docs/docs.go                |  117 +++++++++-------
 models/operation_details.go |    2 
 docs/swagger.json           |  115 +++++++++-------
 router/router.go            |    2 
 7 files changed, 208 insertions(+), 156 deletions(-)

diff --git a/controllers/operation.go b/controllers/operation.go
index 1c25adc..97ba0fd 100644
--- a/controllers/operation.go
+++ b/controllers/operation.go
@@ -112,7 +112,7 @@
 	//妫�鏌ユ槑缁嗛儴鍒�
 	for _, v := range params.Details {
 		if v.ProductId == "" {
-			return errors.New("productID涓�0")
+			return errors.New("productID涓虹┖")
 		}
 		if v.ProductName == "" {
 			return errors.New("浜у搧鍚嶇О寮傚父")
@@ -172,7 +172,7 @@
 // @Param     object  body request.UpdateOperation true  "鍏ュ簱淇℃伅"
 // @Param     id  path int true  "鍏ュ簱淇℃伅id"
 // @Success   200 {object} util.Response "鎴愬姛"
-// @Router    /api-wms/v1/operation/operation/{id} [put]
+// @Router    /api-wms/v1/operation/operation/{id} [post]
 func (slf OperationController) Update(c *gin.Context) {
 	id := cast.ToUint(c.Param("id"))
 	if id == 0 {
@@ -201,6 +201,11 @@
 		util.ResponseFormat(c, code.RequestParamError, err.Error())
 		return
 	}
+	fmt.Printf("%+v\n", *reqParams.Details[0])
+	fmt.Printf("%+v\n", *reqParams.Details[1])
+	fmt.Println("===============================================")
+	fmt.Printf("%+v\n", *params.Details[0])
+	fmt.Printf("%+v\n", *params.Details[1])
 	if err := models.WithTransaction(func(tx *gorm.DB) error {
 		if err := models.NewOperationDetailsSearch().SetOrm(tx).SetOperationId(params.Id).Delete(); err != nil {
 			return err
diff --git a/docs/docs.go b/docs/docs.go
index e0a89ae..bc7b478 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -467,6 +467,34 @@
                 }
             }
         },
+        "/api-wms/v1/operation/finish/{id}": {
+            "put": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "鍏ュ簱/鍑哄簱"
+                ],
+                "summary": "鏇存敼璁板綍鐘舵��",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "id",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/util.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/api-wms/v1/operation/operation": {
             "get": {
                 "consumes": [
@@ -537,7 +565,7 @@
             }
         },
         "/api-wms/v1/operation/operation/{id}": {
-            "put": {
+            "post": {
                 "produces": [
                     "application/json"
                 ],
@@ -605,7 +633,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "浣滀笟绫诲瀷"
+                    "涓氬姟绫诲瀷"
                 ],
                 "summary": "鏌ヨ浣滀笟绫诲瀷鍒楄〃",
                 "parameters": [
@@ -656,7 +684,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "浣滀笟绫诲瀷"
+                    "涓氬姟绫诲瀷"
                 ],
                 "summary": "娣诲姞浣滀笟绫诲瀷",
                 "parameters": [
@@ -686,7 +714,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "浣滀笟绫诲瀷"
+                    "涓氬姟绫诲瀷"
                 ],
                 "summary": "缂栬緫浣滀笟绫诲瀷",
                 "parameters": [
@@ -721,7 +749,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "浣滀笟绫诲瀷"
+                    "涓氬姟绫诲瀷"
                 ],
                 "summary": "鍒犻櫎浣滀笟绫诲瀷",
                 "parameters": [
@@ -1622,10 +1650,6 @@
         "models.Material": {
             "type": "object",
             "properties": {
-                "HSCode": {
-                    "description": "HS缂栫爜",
-                    "type": "string"
-                },
                 "amount": {
                     "description": "鏁伴噺",
                     "type": "number"
@@ -1679,14 +1703,14 @@
                     "type": "number"
                 },
                 "deliveryAdvanceTime": {
-                    "description": "浜よ揣鎻愬墠鏃堕棿(澶�)",
-                    "type": "integer"
+                    "description": "瀹㈡埛鍓嶇疆鏃堕棿(澶�)",
+                    "type": "number"
                 },
                 "id": {
                     "type": "string"
                 },
                 "inStorageExplain": {
-                    "description": "鍏ュ簱璇存槑",
+                    "description": "HSCode                  string                     ` + "`" + `gorm:\"type:varchar(255);comment:HS缂栫爜\" json:\"HSCode\"` + "`" + `                    //HS缂栫爜\nOriginCountryId         int                        ` + "`" + `gorm:\"type:int(11);comment:鍘熶骇鍦癷d\" json:\"originCountryId\"` + "`" + `               //鍘熶骇鍦癷d\nOriginCountryName       string                     ` + "`" + `gorm:\"type:varchar(255);comment:鍘熶骇鍦板悕绉癨" json:\"originCountryName\"` + "`" + `        //鍘熶骇鍦板悕绉�",
                     "type": "string"
                 },
                 "internalNotes": {
@@ -1713,6 +1737,10 @@
                     "description": "PurchaseType      constvar.PurchaseType ` + "`" + `gorm:\"type:int(11);comment:閲囪喘绫诲瀷\" json:\"purchaseType\"` + "`" + `",
                     "type": "boolean"
                 },
+                "makeAdvanceTime": {
+                    "description": "鍒堕�犲墠缃椂闂�(澶�)",
+                    "type": "number"
+                },
                 "maxInventory": {
                     "description": "鏈�澶у簱瀛�",
                     "type": "number"
@@ -1737,6 +1765,10 @@
                     "description": "鐗╂枡鍚嶇О",
                     "type": "string"
                 },
+                "orderAdvanceTime": {
+                    "description": "璁㈠崟鍑嗗澶╂暟(澶�)",
+                    "type": "number"
+                },
                 "orderCreation": {
                     "description": "璁㈠崟鍒涘缓",
                     "allOf": [
@@ -1744,14 +1776,6 @@
                             "$ref": "#/definitions/constvar.OrderCreation"
                         }
                     ]
-                },
-                "originCountryId": {
-                    "description": "鍘熶骇鍦癷d",
-                    "type": "integer"
-                },
-                "originCountryName": {
-                    "description": "鍘熶骇鍦板悕绉�",
-                    "type": "string"
                 },
                 "outStorageExplain": {
                     "description": "鍑哄簱璇存槑",
@@ -2089,22 +2113,24 @@
         "request.AddOperation": {
             "type": "object",
             "properties": {
-                "carrierID": {
-                    "type": "integer"
-                },
-                "carrierName": {
+                "comment": {
+                    "description": "澶囨敞",
                     "type": "string"
                 },
                 "companyID": {
+                    "description": "鍏徃ID-瀹㈡埛",
                     "type": "integer"
                 },
                 "companyName": {
+                    "description": "鍏徃鍚嶇О-瀹㈡埛鍚嶇О",
                     "type": "string"
                 },
                 "contacterID": {
+                    "description": "鑱旂郴浜篒D-闈炲繀濉�",
                     "type": "integer"
                 },
                 "contacterName": {
+                    "description": "鑱旂郴浜哄鍚�-闈炲繀濉�",
                     "type": "string"
                 },
                 "details": {
@@ -2125,6 +2151,7 @@
                     "type": "string"
                 },
                 "operationDate": {
+                    "description": "瀹夋帓鏃ユ湡",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -2146,15 +2173,6 @@
                 "toLocationId": {
                     "description": "鐩爣浣嶇疆id",
                     "type": "integer"
-                },
-                "tracking": {
-                    "type": "string"
-                },
-                "transferWeight": {
-                    "type": "number"
-                },
-                "weight": {
-                    "type": "number"
                 }
             }
         },
@@ -2302,13 +2320,13 @@
         "request.OperationDetails": {
             "type": "object",
             "properties": {
-                "finishQuantity": {
-                    "description": "瀹屾垚鏁伴噺",
-                    "type": "number"
+                "OperationId": {
+                    "description": "鎿嶄綔id",
+                    "type": "integer"
                 },
                 "productId": {
                     "description": "浜у搧id",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "productName": {
                     "description": "浜у搧鍚嶇О",
@@ -2317,6 +2335,9 @@
                 "quantity": {
                     "description": "鏁伴噺",
                     "type": "number"
+                },
+                "unit": {
+                    "type": "string"
                 }
             }
         },
@@ -2359,22 +2380,24 @@
         "request.UpdateOperation": {
             "type": "object",
             "properties": {
-                "carrierID": {
-                    "type": "integer"
-                },
-                "carrierName": {
+                "comment": {
+                    "description": "澶囨敞",
                     "type": "string"
                 },
                 "companyID": {
+                    "description": "鍏徃ID-瀹㈡埛",
                     "type": "integer"
                 },
                 "companyName": {
+                    "description": "鍏徃鍚嶇О-瀹㈡埛鍚嶇О",
                     "type": "string"
                 },
                 "contacterID": {
+                    "description": "鑱旂郴浜篒D-闈炲繀濉�",
                     "type": "integer"
                 },
                 "contacterName": {
+                    "description": "鑱旂郴浜哄鍚�-闈炲繀濉�",
                     "type": "string"
                 },
                 "details": {
@@ -2395,6 +2418,7 @@
                     "type": "string"
                 },
                 "operationDate": {
+                    "description": "瀹夋帓鏃ユ湡",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -2416,15 +2440,6 @@
                 "toLocationId": {
                     "description": "鐩爣浣嶇疆id",
                     "type": "integer"
-                },
-                "tracking": {
-                    "type": "string"
-                },
-                "transferWeight": {
-                    "type": "number"
-                },
-                "weight": {
-                    "type": "number"
                 }
             }
         },
@@ -2546,8 +2561,6 @@
 	Description:      "",
 	InfoInstanceName: "swagger",
 	SwaggerTemplate:  docTemplate,
-	LeftDelim:        "{{",
-	RightDelim:       "}}",
 }
 
 func init() {
diff --git a/docs/swagger.json b/docs/swagger.json
index 03e6f9a..281bd04 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -455,6 +455,34 @@
                 }
             }
         },
+        "/api-wms/v1/operation/finish/{id}": {
+            "put": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "鍏ュ簱/鍑哄簱"
+                ],
+                "summary": "鏇存敼璁板綍鐘舵��",
+                "parameters": [
+                    {
+                        "type": "integer",
+                        "description": "id",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/util.Response"
+                        }
+                    }
+                }
+            }
+        },
         "/api-wms/v1/operation/operation": {
             "get": {
                 "consumes": [
@@ -525,7 +553,7 @@
             }
         },
         "/api-wms/v1/operation/operation/{id}": {
-            "put": {
+            "post": {
                 "produces": [
                     "application/json"
                 ],
@@ -593,7 +621,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "浣滀笟绫诲瀷"
+                    "涓氬姟绫诲瀷"
                 ],
                 "summary": "鏌ヨ浣滀笟绫诲瀷鍒楄〃",
                 "parameters": [
@@ -644,7 +672,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "浣滀笟绫诲瀷"
+                    "涓氬姟绫诲瀷"
                 ],
                 "summary": "娣诲姞浣滀笟绫诲瀷",
                 "parameters": [
@@ -674,7 +702,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "浣滀笟绫诲瀷"
+                    "涓氬姟绫诲瀷"
                 ],
                 "summary": "缂栬緫浣滀笟绫诲瀷",
                 "parameters": [
@@ -709,7 +737,7 @@
                     "application/json"
                 ],
                 "tags": [
-                    "浣滀笟绫诲瀷"
+                    "涓氬姟绫诲瀷"
                 ],
                 "summary": "鍒犻櫎浣滀笟绫诲瀷",
                 "parameters": [
@@ -1610,10 +1638,6 @@
         "models.Material": {
             "type": "object",
             "properties": {
-                "HSCode": {
-                    "description": "HS缂栫爜",
-                    "type": "string"
-                },
                 "amount": {
                     "description": "鏁伴噺",
                     "type": "number"
@@ -1667,14 +1691,14 @@
                     "type": "number"
                 },
                 "deliveryAdvanceTime": {
-                    "description": "浜よ揣鎻愬墠鏃堕棿(澶�)",
-                    "type": "integer"
+                    "description": "瀹㈡埛鍓嶇疆鏃堕棿(澶�)",
+                    "type": "number"
                 },
                 "id": {
                     "type": "string"
                 },
                 "inStorageExplain": {
-                    "description": "鍏ュ簱璇存槑",
+                    "description": "HSCode                  string                     `gorm:\"type:varchar(255);comment:HS缂栫爜\" json:\"HSCode\"`                    //HS缂栫爜\nOriginCountryId         int                        `gorm:\"type:int(11);comment:鍘熶骇鍦癷d\" json:\"originCountryId\"`               //鍘熶骇鍦癷d\nOriginCountryName       string                     `gorm:\"type:varchar(255);comment:鍘熶骇鍦板悕绉癨" json:\"originCountryName\"`        //鍘熶骇鍦板悕绉�",
                     "type": "string"
                 },
                 "internalNotes": {
@@ -1701,6 +1725,10 @@
                     "description": "PurchaseType      constvar.PurchaseType `gorm:\"type:int(11);comment:閲囪喘绫诲瀷\" json:\"purchaseType\"`",
                     "type": "boolean"
                 },
+                "makeAdvanceTime": {
+                    "description": "鍒堕�犲墠缃椂闂�(澶�)",
+                    "type": "number"
+                },
                 "maxInventory": {
                     "description": "鏈�澶у簱瀛�",
                     "type": "number"
@@ -1725,6 +1753,10 @@
                     "description": "鐗╂枡鍚嶇О",
                     "type": "string"
                 },
+                "orderAdvanceTime": {
+                    "description": "璁㈠崟鍑嗗澶╂暟(澶�)",
+                    "type": "number"
+                },
                 "orderCreation": {
                     "description": "璁㈠崟鍒涘缓",
                     "allOf": [
@@ -1732,14 +1764,6 @@
                             "$ref": "#/definitions/constvar.OrderCreation"
                         }
                     ]
-                },
-                "originCountryId": {
-                    "description": "鍘熶骇鍦癷d",
-                    "type": "integer"
-                },
-                "originCountryName": {
-                    "description": "鍘熶骇鍦板悕绉�",
-                    "type": "string"
                 },
                 "outStorageExplain": {
                     "description": "鍑哄簱璇存槑",
@@ -2077,22 +2101,24 @@
         "request.AddOperation": {
             "type": "object",
             "properties": {
-                "carrierID": {
-                    "type": "integer"
-                },
-                "carrierName": {
+                "comment": {
+                    "description": "澶囨敞",
                     "type": "string"
                 },
                 "companyID": {
+                    "description": "鍏徃ID-瀹㈡埛",
                     "type": "integer"
                 },
                 "companyName": {
+                    "description": "鍏徃鍚嶇О-瀹㈡埛鍚嶇О",
                     "type": "string"
                 },
                 "contacterID": {
+                    "description": "鑱旂郴浜篒D-闈炲繀濉�",
                     "type": "integer"
                 },
                 "contacterName": {
+                    "description": "鑱旂郴浜哄鍚�-闈炲繀濉�",
                     "type": "string"
                 },
                 "details": {
@@ -2113,6 +2139,7 @@
                     "type": "string"
                 },
                 "operationDate": {
+                    "description": "瀹夋帓鏃ユ湡",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -2134,15 +2161,6 @@
                 "toLocationId": {
                     "description": "鐩爣浣嶇疆id",
                     "type": "integer"
-                },
-                "tracking": {
-                    "type": "string"
-                },
-                "transferWeight": {
-                    "type": "number"
-                },
-                "weight": {
-                    "type": "number"
                 }
             }
         },
@@ -2290,13 +2308,13 @@
         "request.OperationDetails": {
             "type": "object",
             "properties": {
-                "finishQuantity": {
-                    "description": "瀹屾垚鏁伴噺",
-                    "type": "number"
+                "OperationId": {
+                    "description": "鎿嶄綔id",
+                    "type": "integer"
                 },
                 "productId": {
                     "description": "浜у搧id",
-                    "type": "integer"
+                    "type": "string"
                 },
                 "productName": {
                     "description": "浜у搧鍚嶇О",
@@ -2305,6 +2323,9 @@
                 "quantity": {
                     "description": "鏁伴噺",
                     "type": "number"
+                },
+                "unit": {
+                    "type": "string"
                 }
             }
         },
@@ -2347,22 +2368,24 @@
         "request.UpdateOperation": {
             "type": "object",
             "properties": {
-                "carrierID": {
-                    "type": "integer"
-                },
-                "carrierName": {
+                "comment": {
+                    "description": "澶囨敞",
                     "type": "string"
                 },
                 "companyID": {
+                    "description": "鍏徃ID-瀹㈡埛",
                     "type": "integer"
                 },
                 "companyName": {
+                    "description": "鍏徃鍚嶇О-瀹㈡埛鍚嶇О",
                     "type": "string"
                 },
                 "contacterID": {
+                    "description": "鑱旂郴浜篒D-闈炲繀濉�",
                     "type": "integer"
                 },
                 "contacterName": {
+                    "description": "鑱旂郴浜哄鍚�-闈炲繀濉�",
                     "type": "string"
                 },
                 "details": {
@@ -2383,6 +2406,7 @@
                     "type": "string"
                 },
                 "operationDate": {
+                    "description": "瀹夋帓鏃ユ湡",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -2404,15 +2428,6 @@
                 "toLocationId": {
                     "description": "鐩爣浣嶇疆id",
                     "type": "integer"
-                },
-                "tracking": {
-                    "type": "string"
-                },
-                "transferWeight": {
-                    "type": "number"
-                },
-                "weight": {
-                    "type": "number"
                 }
             }
         },
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index 0294966..024ec46 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -263,9 +263,6 @@
     type: object
   models.Material:
     properties:
-      HSCode:
-        description: HS缂栫爜
-        type: string
       amount:
         description: 鏁伴噺
         type: number
@@ -304,12 +301,15 @@
         description: 瀹㈡埛绋庣櫨鍒嗘瘮
         type: number
       deliveryAdvanceTime:
-        description: 浜よ揣鎻愬墠鏃堕棿(澶�)
-        type: integer
+        description: 瀹㈡埛鍓嶇疆鏃堕棿(澶�)
+        type: number
       id:
         type: string
       inStorageExplain:
-        description: 鍏ュ簱璇存槑
+        description: |-
+          HSCode                  string                     `gorm:"type:varchar(255);comment:HS缂栫爜" json:"HSCode"`                    //HS缂栫爜
+          OriginCountryId         int                        `gorm:"type:int(11);comment:鍘熶骇鍦癷d" json:"originCountryId"`               //鍘熶骇鍦癷d
+          OriginCountryName       string                     `gorm:"type:varchar(255);comment:鍘熶骇鍦板悕绉�" json:"originCountryName"`        //鍘熶骇鍦板悕绉�
         type: string
       internalNotes:
         description: 鍐呴儴璇存槑
@@ -328,6 +328,9 @@
         description: PurchaseType      constvar.PurchaseType `gorm:"type:int(11);comment:閲囪喘绫诲瀷"
           json:"purchaseType"`
         type: boolean
+      makeAdvanceTime:
+        description: 鍒堕�犲墠缃椂闂�(澶�)
+        type: number
       maxInventory:
         description: 鏈�澶у簱瀛�
         type: number
@@ -351,16 +354,13 @@
       name:
         description: 鐗╂枡鍚嶇О
         type: string
+      orderAdvanceTime:
+        description: 璁㈠崟鍑嗗澶╂暟(澶�)
+        type: number
       orderCreation:
         allOf:
         - $ref: '#/definitions/constvar.OrderCreation'
         description: 璁㈠崟鍒涘缓
-      originCountryId:
-        description: 鍘熶骇鍦癷d
-        type: integer
-      originCountryName:
-        description: 鍘熶骇鍦板悕绉�
-        type: string
       outStorageExplain:
         description: 鍑哄簱璇存槑
         type: string
@@ -588,17 +588,20 @@
     type: object
   request.AddOperation:
     properties:
-      carrierID:
-        type: integer
-      carrierName:
+      comment:
+        description: 澶囨敞
         type: string
       companyID:
+        description: 鍏徃ID-瀹㈡埛
         type: integer
       companyName:
+        description: 鍏徃鍚嶇О-瀹㈡埛鍚嶇О
         type: string
       contacterID:
+        description: 鑱旂郴浜篒D-闈炲繀濉�
         type: integer
       contacterName:
+        description: 鑱旂郴浜哄鍚�-闈炲繀濉�
         type: string
       details:
         items:
@@ -613,6 +616,7 @@
         description: 鍗曞彿
         type: string
       operationDate:
+        description: 瀹夋帓鏃ユ湡
         type: string
       operationTypeId:
         description: 浣滀笟绫诲瀷id
@@ -627,12 +631,6 @@
       toLocationId:
         description: 鐩爣浣嶇疆id
         type: integer
-      tracking:
-        type: string
-      transferWeight:
-        type: number
-      weight:
-        type: number
     type: object
   request.AddOperationType:
     properties:
@@ -733,18 +731,20 @@
     type: object
   request.OperationDetails:
     properties:
-      finishQuantity:
-        description: 瀹屾垚鏁伴噺
-        type: number
+      OperationId:
+        description: 鎿嶄綔id
+        type: integer
       productId:
         description: 浜у搧id
-        type: integer
+        type: string
       productName:
         description: 浜у搧鍚嶇О
         type: string
       quantity:
         description: 鏁伴噺
         type: number
+      unit:
+        type: string
     type: object
   request.UpdateCompany:
     properties:
@@ -773,17 +773,20 @@
     type: object
   request.UpdateOperation:
     properties:
-      carrierID:
-        type: integer
-      carrierName:
+      comment:
+        description: 澶囨敞
         type: string
       companyID:
+        description: 鍏徃ID-瀹㈡埛
         type: integer
       companyName:
+        description: 鍏徃鍚嶇О-瀹㈡埛鍚嶇О
         type: string
       contacterID:
+        description: 鑱旂郴浜篒D-闈炲繀濉�
         type: integer
       contacterName:
+        description: 鑱旂郴浜哄鍚�-闈炲繀濉�
         type: string
       details:
         items:
@@ -798,6 +801,7 @@
         description: 鍗曞彿
         type: string
       operationDate:
+        description: 瀹夋帓鏃ユ湡
         type: string
       operationTypeId:
         description: 浣滀笟绫诲瀷id
@@ -812,12 +816,6 @@
       toLocationId:
         description: 鐩爣浣嶇疆id
         type: integer
-      tracking:
-        type: string
-      transferWeight:
-        type: number
-      weight:
-        type: number
     type: object
   request.UpdateOperationType:
     properties:
@@ -1169,6 +1167,24 @@
       summary: 淇敼浣嶇疆
       tags:
       - 浣嶇疆
+  /api-wms/v1/operation/finish/{id}:
+    put:
+      parameters:
+      - description: id
+        in: path
+        name: id
+        required: true
+        type: integer
+      produces:
+      - application/json
+      responses:
+        "200":
+          description: 鎴愬姛
+          schema:
+            $ref: '#/definitions/util.Response'
+      summary: 鏇存敼璁板綍鐘舵��
+      tags:
+      - 鍏ュ簱/鍑哄簱
   /api-wms/v1/operation/operation:
     get:
       consumes:
@@ -1231,7 +1247,7 @@
       summary: 鍒犻櫎鍏ュ簱/鍑哄簱淇℃伅
       tags:
       - 鍏ュ簱/鍑哄簱
-    put:
+    post:
       parameters:
       - description: 鍏ュ簱淇℃伅
         in: body
@@ -1284,7 +1300,7 @@
               type: object
       summary: 鏌ヨ浣滀笟绫诲瀷鍒楄〃
       tags:
-      - 浣滀笟绫诲瀷
+      - 涓氬姟绫诲瀷
     post:
       parameters:
       - description: 浣滀笟绫诲瀷淇℃伅
@@ -1302,7 +1318,7 @@
             $ref: '#/definitions/util.Response'
       summary: 娣诲姞浣滀笟绫诲瀷
       tags:
-      - 浣滀笟绫诲瀷
+      - 涓氬姟绫诲瀷
   /api-wms/v1/operationType/operationType/{id}:
     delete:
       parameters:
@@ -1320,7 +1336,7 @@
             $ref: '#/definitions/util.Response'
       summary: 鍒犻櫎浣滀笟绫诲瀷
       tags:
-      - 浣滀笟绫诲瀷
+      - 涓氬姟绫诲瀷
     put:
       parameters:
       - description: 浣滀笟绫诲瀷淇℃伅
@@ -1343,7 +1359,7 @@
             $ref: '#/definitions/util.Response'
       summary: 缂栬緫浣滀笟绫诲瀷
       tags:
-      - 浣滀笟绫诲瀷
+      - 涓氬姟绫诲瀷
   /api-wms/v1/product/addProduct:
     post:
       parameters:
diff --git a/models/operation_details.go b/models/operation_details.go
index 73d359e..270e34d 100644
--- a/models/operation_details.go
+++ b/models/operation_details.go
@@ -154,7 +154,7 @@
 
 func (slf *OperationDetailsSearch) Delete() error {
 	var db = slf.build()
-	return db.Delete(&OperationDetails{}).Error
+	return db.Unscoped().Delete(&OperationDetails{}).Error
 }
 
 func (slf *OperationDetailsSearch) First() (*OperationDetails, error) {
diff --git a/request/operation.go b/request/operation.go
index 44d5402..a87eeb0 100644
--- a/request/operation.go
+++ b/request/operation.go
@@ -19,7 +19,7 @@
 	ContacterName   string                   `json:"contacterName" gorm:"type:varchar(63);comment:鑱旂郴浜哄鍚�"` //鑱旂郴浜哄鍚�-闈炲繀濉�
 	CompanyID       int                      `json:"companyID" gorm:"type:int;comment:鍏徃ID"`              //鍏徃ID-瀹㈡埛
 	CompanyName     string                   `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О"`   //鍏徃鍚嶇О-瀹㈡埛鍚嶇О
-	Comment         string                   `json:"comment" gorm:"type:text;comment:澶囨敞"`
+	Comment         string                   `json:"comment" gorm:"type:text;comment:澶囨敞"`                 //澶囨敞
 
 	//Weight          decimal.Decimal          `json:"weight" gorm:"type:decimal(20,2);comment:閲嶉噺(kg)"`           //閲嶉噺(kg)-闈炲繀濉�
 	//TransferWeight  decimal.Decimal          `json:"transferWeight" gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺(kg)"` //鐗╂祦閲嶉噺(kg)-闈炲繀濉�
@@ -29,7 +29,8 @@
 }
 
 type OperationDetails struct {
-	ProductId   int             `json:"productId" gorm:"type:int;not null;comment:浜у搧id"`            //浜у搧id
+	OperationId int             `json:"OperationId" gorm:"type:int;not null;comment:鎿嶄綔璁板綍id"`        //鎿嶄綔id
+	ProductId   string          `json:"productId" gorm:"type:varchar(191);not null;comment:浜у搧id"`   //浜у搧id
 	ProductName string          `json:"productName" gorm:"type:varchar(255);not null;comment:浜у搧鍚嶇О"` //浜у搧鍚嶇О
 	Quantity    decimal.Decimal `json:"quantity" gorm:"type:decimal(20,2);not null;comment:鏁伴噺"`     //鏁伴噺
 	Unit        string          `json:"unit" gorm:"type:varchar(31);comment:鍗曚綅"`
@@ -50,13 +51,15 @@
 	ToLocationId    int                      `json:"toLocationId"    gorm:"type:int;not null;comment:鐩爣浣嶇疆id"` //鐩爣浣嶇疆id
 	OperationDate   string                   `json:"operationDate" gorm:"type:varchar(31);comment:瀹夋帓鏃ユ湡"`      //瀹夋帓鏃ユ湡
 	Details         []*OperationDetails      `json:"details"`
-	CarrierID       int                      `json:"carrierID" gorm:"type:int;comment:鎵胯繍鍟咺D"`                   //鎵胯繍鍟咺D-闈炲繀濉�
-	CarrierName     string                   `json:"carrierName" gorm:"type:varchar(63);comment:鎵胯繍鍟嗗悕绉�"`         //鎵胯繍鍟嗗悕绉�-闈炲繀濉�
-	Tracking        string                   `json:"tracking" gorm:"type:varchar(127);comment:杩借釜鍙傝��"`            //杩借釜鍙傝��-闈炲繀濉�
-	ContacterID     int                      `json:"contacterID" gorm:"type:int;comment:鑱旂郴浜篒D"`                 //鑱旂郴浜篒D-闈炲繀濉�
-	ContacterName   string                   `json:"contacterName" gorm:"type:varchar(63);comment:鑱旂郴浜哄鍚�"`       //鑱旂郴浜哄鍚�-闈炲繀濉�
-	Weight          decimal.Decimal          `json:"weight" gorm:"type:decimal(20,2);comment:閲嶉噺(kg)"`           //閲嶉噺(kg)-闈炲繀濉�
-	TransferWeight  decimal.Decimal          `json:"transferWeight" gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺(kg)"` //鐗╂祦閲嶉噺(kg)-闈炲繀濉�
-	CompanyID       int                      `json:"companyID" gorm:"type:int;comment:鍏徃ID"`                    //鍏徃ID-瀹㈡埛
-	CompanyName     string                   `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О"`         //鍏徃鍚嶇О-瀹㈡埛鍚嶇О
+	ContacterID     int                      `json:"contacterID" gorm:"type:int;comment:鑱旂郴浜篒D"`           //鑱旂郴浜篒D-闈炲繀濉�
+	ContacterName   string                   `json:"contacterName" gorm:"type:varchar(63);comment:鑱旂郴浜哄鍚�"` //鑱旂郴浜哄鍚�-闈炲繀濉�
+	CompanyID       int                      `json:"companyID" gorm:"type:int;comment:鍏徃ID"`              //鍏徃ID-瀹㈡埛
+	CompanyName     string                   `json:"companyName" gorm:"type:varchar(127);comment:鍏徃鍚嶇О"`   //鍏徃鍚嶇О-瀹㈡埛鍚嶇О
+	Comment         string                   `json:"comment" gorm:"type:text;comment:澶囨敞"`                 //澶囨敞
+
+	//CarrierID      int             `json:"carrierID" gorm:"type:int;comment:鎵胯繍鍟咺D"`                   //鎵胯繍鍟咺D-闈炲繀濉�
+	//CarrierName    string          `json:"carrierName" gorm:"type:varchar(63);comment:鎵胯繍鍟嗗悕绉�"`         //鎵胯繍鍟嗗悕绉�-闈炲繀濉�
+	//Tracking       string          `json:"tracking" gorm:"type:varchar(127);comment:杩借釜鍙傝��"`            //杩借釜鍙傝��-闈炲繀濉�
+	//Weight         decimal.Decimal `json:"weight" gorm:"type:decimal(20,2);comment:閲嶉噺(kg)"`           //閲嶉噺(kg)-闈炲繀濉�
+	//TransferWeight decimal.Decimal `json:"transferWeight" gorm:"type:decimal(20,2);comment:鐗╂祦閲嶉噺(kg)"` //鐗╂祦閲嶉噺(kg)-闈炲繀濉�
 }
diff --git a/router/router.go b/router/router.go
index 084dc11..623eab5 100644
--- a/router/router.go
+++ b/router/router.go
@@ -79,7 +79,7 @@
 	{
 		operationAPI.GET("operation", operationController.List)
 		operationAPI.POST("operation", operationController.Add)
-		operationAPI.PUT("operation/:id", operationController.Update)
+		operationAPI.POST("operation/:id", operationController.Update)
 		operationAPI.DELETE("operation/:id", operationController.Delete)
 		operationAPI.PUT("Finish/:id", operationController.Finish)
 	}

--
Gitblit v1.8.0