From 2b6b5128653ca122c8136e557351ac11246da20a Mon Sep 17 00:00:00 2001
From: jiangshuai <291802688@qq.com>
Date: 星期四, 28 十二月 2023 15:48:18 +0800
Subject: [PATCH] operation 中 location定义的bug

---
 models/operation.go |    2 
 docs/swagger.yaml   |   81 +++++++++++-----
 docs/docs.go        |   99 ++++++++++++-------
 docs/swagger.json   |   97 ++++++++++++-------
 4 files changed, 181 insertions(+), 98 deletions(-)

diff --git a/docs/docs.go b/docs/docs.go
index 9db38a4..3e5d8f7 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -2748,12 +2748,26 @@
             "enum": [
                 "鍘熸潗鏂�",
                 "鍗婃垚鍝�",
-                "鎴愬搧"
+                "鎴愬搧",
+                "杈呮枡",
+                "鑰楁潗",
+                "鍏朵粬",
+                "铏氭嫙浠�"
             ],
+            "x-enum-comments": {
+                "MaterialModeAuxiliary": "杈呮枡",
+                "MaterialModeConsumables": "鑰楁潗",
+                "MaterialModeOther": "鍏朵粬",
+                "MaterialModeVirtual": "铏氭嫙浠�, 涓嶈兘閿�鍞紝涓嶈兘鍑哄叆搴擄紝涓嶈兘閲囪喘"
+            },
             "x-enum-varnames": [
                 "MaterialModeRaw",
                 "MaterialModeSemi",
-                "MaterialModeFinished"
+                "MaterialModeFinished",
+                "MaterialModeAuxiliary",
+                "MaterialModeConsumables",
+                "MaterialModeOther",
+                "MaterialModeVirtual"
             ]
         },
         "constvar.OperationStatus": {
@@ -3352,7 +3366,10 @@
                         "$ref": "#/definitions/models.OperationDetails"
                     }
                 },
-                "fromLocation": {
+                "id": {
+                    "type": "integer"
+                },
+                "location": {
                     "description": "婧愪綅缃�",
                     "allOf": [
                         {
@@ -3360,11 +3377,8 @@
                         }
                     ]
                 },
-                "fromLocationId": {
+                "locationID": {
                     "description": "婧愪綅缃甶d",
-                    "type": "integer"
-                },
-                "id": {
                     "type": "integer"
                 },
                 "logisticCompany": {
@@ -3382,6 +3396,7 @@
                     "type": "string"
                 },
                 "operationDate": {
+                    "description": "FromLocationID    int                      ` + "`" + `json:\"fromLocationId\"   gorm:\"type:int;not null;comment:婧愪綅缃甶d\"` + "`" + `         //婧愪綅缃甶d\nFromLocation      Location                 ` + "`" + `json:\"fromLocation\"     gorm:\"foreignKey:FromLocationID;references:Id\"` + "`" + ` //婧愪綅缃甛nToLocationID      int                      ` + "`" + `json:\"toLocationId\"    gorm:\"type:int;not null;comment:鐩爣浣嶇疆id\"` + "`" + `         //鐩爣浣嶇疆id\nToLocation        Location                 ` + "`" + `json:\"toLocation\"      gorm:\"foreignKey:ToLocationID;references:Id\"` + "`" + `    //鐩爣浣嶇疆",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -3416,18 +3431,6 @@
                         }
                     ]
                 },
-                "toLocation": {
-                    "description": "鐩爣浣嶇疆",
-                    "allOf": [
-                        {
-                            "$ref": "#/definitions/models.Location"
-                        }
-                    ]
-                },
-                "toLocationId": {
-                    "description": "鐩爣浣嶇疆id",
-                    "type": "integer"
-                },
                 "updateTime": {
                     "type": "string"
                 },
@@ -3451,6 +3454,18 @@
                 "createTime": {
                     "type": "string"
                 },
+                "fromLocation": {
+                    "description": "婧愪綅缃�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/models.Location"
+                        }
+                    ]
+                },
+                "fromLocationId": {
+                    "description": "婧愪綅缃甶d",
+                    "type": "integer"
+                },
                 "id": {
                     "type": "integer"
                 },
@@ -3469,6 +3484,18 @@
                 "productId": {
                     "description": "浜у搧id",
                     "type": "string"
+                },
+                "toLocation": {
+                    "description": "鐩爣浣嶇疆",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/models.Location"
+                        }
+                    ]
+                },
+                "toLocationId": {
+                    "description": "鐩爣浣嶇疆id",
+                    "type": "integer"
                 },
                 "updateTime": {
                     "type": "string"
@@ -3781,11 +3808,11 @@
                         "$ref": "#/definitions/request.OperationDetails"
                     }
                 },
-                "fromLocationId": {
-                    "description": "婧愪綅缃甶d",
+                "id": {
                     "type": "integer"
                 },
-                "id": {
+                "locationId": {
+                    "description": "婧愪綅缃甶d",
                     "type": "integer"
                 },
                 "logisticCompanyId": {
@@ -3800,7 +3827,7 @@
                     "type": "string"
                 },
                 "operationDate": {
-                    "description": "瀹夋帓鏃ユ湡",
+                    "description": "FromLocationId    int                      ` + "`" + `json:\"fromLocationId\"   gorm:\"type:int;not null;comment:婧愪綅缃甶d\"` + "`" + `   //婧愪綅缃甶d\nToLocationId      int                      ` + "`" + `json:\"toLocationId\"    gorm:\"type:int;not null;comment:鐩爣浣嶇疆id\"` + "`" + `   //鐩爣浣嶇疆id",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -3831,10 +3858,6 @@
                             "$ref": "#/definitions/constvar.OperationStatus"
                         }
                     ]
-                },
-                "toLocationId": {
-                    "description": "鐩爣浣嶇疆id",
-                    "type": "integer"
                 },
                 "waybillNumber": {
                     "description": "杩愬崟鍙�",
@@ -4224,9 +4247,17 @@
                     "description": "ProductName string          ` + "`" + `json:\"productName\" gorm:\"type:varchar(255);not null;comment:浜у搧鍚嶇О\"` + "`" + ` //浜у搧鍚嶇О",
                     "type": "number"
                 },
+                "fromLocationId": {
+                    "description": "Unit        string          ` + "`" + `json:\"unit\" gorm:\"type:varchar(31);comment:鍗曚綅\"` + "`" + `                    //鍗曚綅\nProduct models.Material ` + "`" + `json:\"product\" gorm:\"foreignKey:ProductId;references:ID\"` + "`" + `",
+                    "type": "integer"
+                },
                 "productId": {
                     "description": "浜у搧id",
                     "type": "string"
+                },
+                "toLocationId": {
+                    "description": "鐩爣浣嶇疆id",
+                    "type": "integer"
                 }
             }
         },
@@ -4489,11 +4520,11 @@
                         "$ref": "#/definitions/request.OperationDetails"
                     }
                 },
-                "fromLocationId": {
-                    "description": "婧愪綅缃甶d",
+                "id": {
                     "type": "integer"
                 },
-                "id": {
+                "locationId": {
+                    "description": "婧愪綅缃甶d",
                     "type": "integer"
                 },
                 "logisticCompanyId": {
@@ -4508,7 +4539,7 @@
                     "type": "string"
                 },
                 "operationDate": {
-                    "description": "瀹夋帓鏃ユ湡",
+                    "description": "FromLocationId    int                        ` + "`" + `json:\"fromLocationId\"   gorm:\"type:int;not null;comment:婧愪綅缃甶d\"` + "`" + `   //婧愪綅缃甶d\nToLocationId      int                        ` + "`" + `json:\"toLocationId\"    gorm:\"type:int;not null;comment:鐩爣浣嶇疆id\"` + "`" + `   //鐩爣浣嶇疆id",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -4539,10 +4570,6 @@
                             "$ref": "#/definitions/constvar.OperationStatus"
                         }
                     ]
-                },
-                "toLocationId": {
-                    "description": "鐩爣浣嶇疆id",
-                    "type": "integer"
                 },
                 "waybillNumber": {
                     "description": "杩愬崟鍙�",
@@ -4846,8 +4873,6 @@
 	Description:      "",
 	InfoInstanceName: "swagger",
 	SwaggerTemplate:  docTemplate,
-	LeftDelim:        "{{",
-	RightDelim:       "}}",
 }
 
 func init() {
diff --git a/docs/swagger.json b/docs/swagger.json
index c1acd3f..261625a 100644
--- a/docs/swagger.json
+++ b/docs/swagger.json
@@ -2736,12 +2736,26 @@
             "enum": [
                 "鍘熸潗鏂�",
                 "鍗婃垚鍝�",
-                "鎴愬搧"
+                "鎴愬搧",
+                "杈呮枡",
+                "鑰楁潗",
+                "鍏朵粬",
+                "铏氭嫙浠�"
             ],
+            "x-enum-comments": {
+                "MaterialModeAuxiliary": "杈呮枡",
+                "MaterialModeConsumables": "鑰楁潗",
+                "MaterialModeOther": "鍏朵粬",
+                "MaterialModeVirtual": "铏氭嫙浠�, 涓嶈兘閿�鍞紝涓嶈兘鍑哄叆搴擄紝涓嶈兘閲囪喘"
+            },
             "x-enum-varnames": [
                 "MaterialModeRaw",
                 "MaterialModeSemi",
-                "MaterialModeFinished"
+                "MaterialModeFinished",
+                "MaterialModeAuxiliary",
+                "MaterialModeConsumables",
+                "MaterialModeOther",
+                "MaterialModeVirtual"
             ]
         },
         "constvar.OperationStatus": {
@@ -3340,7 +3354,10 @@
                         "$ref": "#/definitions/models.OperationDetails"
                     }
                 },
-                "fromLocation": {
+                "id": {
+                    "type": "integer"
+                },
+                "location": {
                     "description": "婧愪綅缃�",
                     "allOf": [
                         {
@@ -3348,11 +3365,8 @@
                         }
                     ]
                 },
-                "fromLocationId": {
+                "locationID": {
                     "description": "婧愪綅缃甶d",
-                    "type": "integer"
-                },
-                "id": {
                     "type": "integer"
                 },
                 "logisticCompany": {
@@ -3370,6 +3384,7 @@
                     "type": "string"
                 },
                 "operationDate": {
+                    "description": "FromLocationID    int                      `json:\"fromLocationId\"   gorm:\"type:int;not null;comment:婧愪綅缃甶d\"`         //婧愪綅缃甶d\nFromLocation      Location                 `json:\"fromLocation\"     gorm:\"foreignKey:FromLocationID;references:Id\"` //婧愪綅缃甛nToLocationID      int                      `json:\"toLocationId\"    gorm:\"type:int;not null;comment:鐩爣浣嶇疆id\"`         //鐩爣浣嶇疆id\nToLocation        Location                 `json:\"toLocation\"      gorm:\"foreignKey:ToLocationID;references:Id\"`    //鐩爣浣嶇疆",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -3404,18 +3419,6 @@
                         }
                     ]
                 },
-                "toLocation": {
-                    "description": "鐩爣浣嶇疆",
-                    "allOf": [
-                        {
-                            "$ref": "#/definitions/models.Location"
-                        }
-                    ]
-                },
-                "toLocationId": {
-                    "description": "鐩爣浣嶇疆id",
-                    "type": "integer"
-                },
                 "updateTime": {
                     "type": "string"
                 },
@@ -3439,6 +3442,18 @@
                 "createTime": {
                     "type": "string"
                 },
+                "fromLocation": {
+                    "description": "婧愪綅缃�",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/models.Location"
+                        }
+                    ]
+                },
+                "fromLocationId": {
+                    "description": "婧愪綅缃甶d",
+                    "type": "integer"
+                },
                 "id": {
                     "type": "integer"
                 },
@@ -3457,6 +3472,18 @@
                 "productId": {
                     "description": "浜у搧id",
                     "type": "string"
+                },
+                "toLocation": {
+                    "description": "鐩爣浣嶇疆",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/models.Location"
+                        }
+                    ]
+                },
+                "toLocationId": {
+                    "description": "鐩爣浣嶇疆id",
+                    "type": "integer"
                 },
                 "updateTime": {
                     "type": "string"
@@ -3769,11 +3796,11 @@
                         "$ref": "#/definitions/request.OperationDetails"
                     }
                 },
-                "fromLocationId": {
-                    "description": "婧愪綅缃甶d",
+                "id": {
                     "type": "integer"
                 },
-                "id": {
+                "locationId": {
+                    "description": "婧愪綅缃甶d",
                     "type": "integer"
                 },
                 "logisticCompanyId": {
@@ -3788,7 +3815,7 @@
                     "type": "string"
                 },
                 "operationDate": {
-                    "description": "瀹夋帓鏃ユ湡",
+                    "description": "FromLocationId    int                      `json:\"fromLocationId\"   gorm:\"type:int;not null;comment:婧愪綅缃甶d\"`   //婧愪綅缃甶d\nToLocationId      int                      `json:\"toLocationId\"    gorm:\"type:int;not null;comment:鐩爣浣嶇疆id\"`   //鐩爣浣嶇疆id",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -3819,10 +3846,6 @@
                             "$ref": "#/definitions/constvar.OperationStatus"
                         }
                     ]
-                },
-                "toLocationId": {
-                    "description": "鐩爣浣嶇疆id",
-                    "type": "integer"
                 },
                 "waybillNumber": {
                     "description": "杩愬崟鍙�",
@@ -4212,9 +4235,17 @@
                     "description": "ProductName string          `json:\"productName\" gorm:\"type:varchar(255);not null;comment:浜у搧鍚嶇О\"` //浜у搧鍚嶇О",
                     "type": "number"
                 },
+                "fromLocationId": {
+                    "description": "Unit        string          `json:\"unit\" gorm:\"type:varchar(31);comment:鍗曚綅\"`                    //鍗曚綅\nProduct models.Material `json:\"product\" gorm:\"foreignKey:ProductId;references:ID\"`",
+                    "type": "integer"
+                },
                 "productId": {
                     "description": "浜у搧id",
                     "type": "string"
+                },
+                "toLocationId": {
+                    "description": "鐩爣浣嶇疆id",
+                    "type": "integer"
                 }
             }
         },
@@ -4477,11 +4508,11 @@
                         "$ref": "#/definitions/request.OperationDetails"
                     }
                 },
-                "fromLocationId": {
-                    "description": "婧愪綅缃甶d",
+                "id": {
                     "type": "integer"
                 },
-                "id": {
+                "locationId": {
+                    "description": "婧愪綅缃甶d",
                     "type": "integer"
                 },
                 "logisticCompanyId": {
@@ -4496,7 +4527,7 @@
                     "type": "string"
                 },
                 "operationDate": {
-                    "description": "瀹夋帓鏃ユ湡",
+                    "description": "FromLocationId    int                        `json:\"fromLocationId\"   gorm:\"type:int;not null;comment:婧愪綅缃甶d\"`   //婧愪綅缃甶d\nToLocationId      int                        `json:\"toLocationId\"    gorm:\"type:int;not null;comment:鐩爣浣嶇疆id\"`   //鐩爣浣嶇疆id",
                     "type": "string"
                 },
                 "operationTypeId": {
@@ -4527,10 +4558,6 @@
                             "$ref": "#/definitions/constvar.OperationStatus"
                         }
                     ]
-                },
-                "toLocationId": {
-                    "description": "鐩爣浣嶇疆id",
-                    "type": "integer"
                 },
                 "waybillNumber": {
                     "description": "杩愬崟鍙�",
diff --git a/docs/swagger.yaml b/docs/swagger.yaml
index a4cbae1..515cef4 100644
--- a/docs/swagger.yaml
+++ b/docs/swagger.yaml
@@ -166,11 +166,24 @@
     - 鍘熸潗鏂�
     - 鍗婃垚鍝�
     - 鎴愬搧
+    - 杈呮枡
+    - 鑰楁潗
+    - 鍏朵粬
+    - 铏氭嫙浠�
     type: string
+    x-enum-comments:
+      MaterialModeAuxiliary: 杈呮枡
+      MaterialModeConsumables: 鑰楁潗
+      MaterialModeOther: 鍏朵粬
+      MaterialModeVirtual: 铏氭嫙浠�, 涓嶈兘閿�鍞紝涓嶈兘鍑哄叆搴擄紝涓嶈兘閲囪喘
     x-enum-varnames:
     - MaterialModeRaw
     - MaterialModeSemi
     - MaterialModeFinished
+    - MaterialModeAuxiliary
+    - MaterialModeConsumables
+    - MaterialModeOther
+    - MaterialModeVirtual
   constvar.OperationStatus:
     enum:
     - 1
@@ -603,14 +616,14 @@
         items:
           $ref: '#/definitions/models.OperationDetails'
         type: array
-      fromLocation:
+      id:
+        type: integer
+      location:
         allOf:
         - $ref: '#/definitions/models.Location'
         description: 婧愪綅缃�
-      fromLocationId:
+      locationID:
         description: 婧愪綅缃甶d
-        type: integer
-      id:
         type: integer
       logisticCompany:
         $ref: '#/definitions/models.LogisticCompany'
@@ -623,6 +636,11 @@
         description: 鍗曞彿
         type: string
       operationDate:
+        description: |-
+          FromLocationID    int                      `json:"fromLocationId"   gorm:"type:int;not null;comment:婧愪綅缃甶d"`         //婧愪綅缃甶d
+          FromLocation      Location                 `json:"fromLocation"     gorm:"foreignKey:FromLocationID;references:Id"` //婧愪綅缃�
+          ToLocationID      int                      `json:"toLocationId"    gorm:"type:int;not null;comment:鐩爣浣嶇疆id"`         //鐩爣浣嶇疆id
+          ToLocation        Location                 `json:"toLocation"      gorm:"foreignKey:ToLocationID;references:Id"`    //鐩爣浣嶇疆
         type: string
       operationTypeId:
         description: 浣滀笟绫诲瀷id
@@ -645,13 +663,6 @@
         allOf:
         - $ref: '#/definitions/constvar.OperationStatus'
         description: 鐘舵��
-      toLocation:
-        allOf:
-        - $ref: '#/definitions/models.Location'
-        description: 鐩爣浣嶇疆
-      toLocationId:
-        description: 鐩爣浣嶇疆id
-        type: integer
       updateTime:
         type: string
       waybillNumber:
@@ -669,6 +680,13 @@
         type: number
       createTime:
         type: string
+      fromLocation:
+        allOf:
+        - $ref: '#/definitions/models.Location'
+        description: 婧愪綅缃�
+      fromLocationId:
+        description: 婧愪綅缃甶d
+        type: integer
       id:
         type: integer
       operationId:
@@ -681,6 +699,13 @@
       productId:
         description: 浜у搧id
         type: string
+      toLocation:
+        allOf:
+        - $ref: '#/definitions/models.Location'
+        description: 鐩爣浣嶇疆
+      toLocationId:
+        description: 鐩爣浣嶇疆id
+        type: integer
       updateTime:
         type: string
     type: object
@@ -895,10 +920,10 @@
         items:
           $ref: '#/definitions/request.OperationDetails'
         type: array
-      fromLocationId:
-        description: 婧愪綅缃甶d
-        type: integer
       id:
+        type: integer
+      locationId:
+        description: 婧愪綅缃甶d
         type: integer
       logisticCompanyId:
         type: string
@@ -909,7 +934,9 @@
         description: 鍗曞彿
         type: string
       operationDate:
-        description: 瀹夋帓鏃ユ湡
+        description: |-
+          FromLocationId    int                      `json:"fromLocationId"   gorm:"type:int;not null;comment:婧愪綅缃甶d"`   //婧愪綅缃甶d
+          ToLocationId      int                      `json:"toLocationId"    gorm:"type:int;not null;comment:鐩爣浣嶇疆id"`   //鐩爣浣嶇疆id
         type: string
       operationTypeId:
         description: 浣滀笟绫诲瀷id
@@ -930,9 +957,6 @@
         allOf:
         - $ref: '#/definitions/constvar.OperationStatus'
         description: 鐘舵��
-      toLocationId:
-        description: 鐩爣浣嶇疆id
-        type: integer
       waybillNumber:
         description: 杩愬崟鍙�
         type: string
@@ -1202,9 +1226,17 @@
         description: ProductName string          `json:"productName" gorm:"type:varchar(255);not
           null;comment:浜у搧鍚嶇О"` //浜у搧鍚嶇О
         type: number
+      fromLocationId:
+        description: |-
+          Unit        string          `json:"unit" gorm:"type:varchar(31);comment:鍗曚綅"`                    //鍗曚綅
+          Product models.Material `json:"product" gorm:"foreignKey:ProductId;references:ID"`
+        type: integer
       productId:
         description: 浜у搧id
         type: string
+      toLocationId:
+        description: 鐩爣浣嶇疆id
+        type: integer
     type: object
   request.OperationList:
     properties:
@@ -1384,10 +1416,10 @@
         items:
           $ref: '#/definitions/request.OperationDetails'
         type: array
-      fromLocationId:
-        description: 婧愪綅缃甶d
-        type: integer
       id:
+        type: integer
+      locationId:
+        description: 婧愪綅缃甶d
         type: integer
       logisticCompanyId:
         type: string
@@ -1398,7 +1430,9 @@
         description: 鍗曞彿
         type: string
       operationDate:
-        description: 瀹夋帓鏃ユ湡
+        description: |-
+          FromLocationId    int                        `json:"fromLocationId"   gorm:"type:int;not null;comment:婧愪綅缃甶d"`   //婧愪綅缃甶d
+          ToLocationId      int                        `json:"toLocationId"    gorm:"type:int;not null;comment:鐩爣浣嶇疆id"`   //鐩爣浣嶇疆id
         type: string
       operationTypeId:
         description: 浣滀笟绫诲瀷id
@@ -1419,9 +1453,6 @@
         allOf:
         - $ref: '#/definitions/constvar.OperationStatus'
         description: 鐘舵��
-      toLocationId:
-        description: 鐩爣浣嶇疆id
-        type: integer
       waybillNumber:
         description: 杩愬崟鍙�
         type: string
diff --git a/models/operation.go b/models/operation.go
index 3353da2..ea8191b 100644
--- a/models/operation.go
+++ b/models/operation.go
@@ -44,7 +44,7 @@
 		ReceiverAddr  string `json:"receiverAddr" gorm:"type:varchar(255);comment:鏀惰揣鍦板潃"`
 
 		LocationID int      `json:"locationID"   gorm:"type:int;not null;comment:婧愪綅缃甶d"` //婧愪綅缃甶d
-		Location   Location `json:"location" gorm:"foreignkey:locationID;references:Id"` //婧愪綅缃�
+		Location   Location `json:"location" gorm:"foreignkey:LocationID;references:Id"` //婧愪綅缃�
 	}
 
 	OperationSearch struct {

--
Gitblit v1.8.0