From 548030097f2b95dff474c397c7393168c73ab8a2 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期三, 20 九月 2023 09:51:04 +0800
Subject: [PATCH] 产品与产品类型功能开发

---
 docs/docs.go |  667 +++++++++++++++++++++++++++++++++++++++++++------------
 1 files changed, 516 insertions(+), 151 deletions(-)

diff --git a/docs/docs.go b/docs/docs.go
index d8f9095..dd6d9d1 100644
--- a/docs/docs.go
+++ b/docs/docs.go
@@ -340,7 +340,7 @@
                         "in": "body",
                         "required": true,
                         "schema": {
-                            "$ref": "#/definitions/models.Product"
+                            "$ref": "#/definitions/models.Material"
                         }
                     }
                 ],
@@ -354,15 +354,141 @@
                 }
             }
         },
-        "/api-wms/v1/product/getProductList": {
+        "/api-wms/v1/product/addProductCategory": {
             "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "浜у搧绫诲瀷"
+                ],
+                "summary": "娣诲姞浜у搧绫诲瀷",
+                "parameters": [
+                    {
+                        "description": "浜у搧绫诲瀷淇℃伅",
+                        "name": "object",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.ProductCategory"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/util.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/api-wms/v1/product/deleteProduct/{id}": {
+            "delete": {
                 "produces": [
                     "application/json"
                 ],
                 "tags": [
                     "浜у搧"
                 ],
-                "summary": "鑾峰彇浜у搧璇︽儏",
+                "summary": "鍒犻櫎浜у搧",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "id",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/util.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/api-wms/v1/product/deleteProductCategory/{id}": {
+            "delete": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "浜у搧绫诲瀷"
+                ],
+                "summary": "鍒犻櫎浜у搧绫诲瀷",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "id",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/util.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/api-wms/v1/product/getProductCategoryDetails/{id}": {
+            "get": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "浜у搧绫诲瀷"
+                ],
+                "summary": "鑾峰彇浜у搧绫诲瀷璇︽儏",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "id",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/util.Response"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "$ref": "#/definitions/models.Material"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
+        "/api-wms/v1/product/getProductCategoryList": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "浜у搧绫诲瀷"
+                ],
+                "summary": "鑾峰彇浜у搧绫诲瀷鍒楄〃",
                 "parameters": [
                     {
                         "description": "鏌ヨ鍙傛暟",
@@ -388,12 +514,157 @@
                                         "data": {
                                             "type": "array",
                                             "items": {
-                                                "$ref": "#/definitions/models.Product"
+                                                "$ref": "#/definitions/models.ProductCategory"
                                             }
                                         }
                                     }
                                 }
                             ]
+                        }
+                    }
+                }
+            }
+        },
+        "/api-wms/v1/product/getProductDetails/{id}": {
+            "get": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "浜у搧"
+                ],
+                "summary": "鑾峰彇浜у搧璇︽儏",
+                "parameters": [
+                    {
+                        "type": "string",
+                        "description": "id",
+                        "name": "id",
+                        "in": "path",
+                        "required": true
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/util.Response"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "$ref": "#/definitions/models.Material"
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
+        "/api-wms/v1/product/getProductList": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "浜у搧"
+                ],
+                "summary": "鑾峰彇浜у搧鍒楄〃",
+                "parameters": [
+                    {
+                        "description": "鏌ヨ鍙傛暟",
+                        "name": "object",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/request.GetProductList"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "allOf": [
+                                {
+                                    "$ref": "#/definitions/util.ResponseList"
+                                },
+                                {
+                                    "type": "object",
+                                    "properties": {
+                                        "data": {
+                                            "type": "array",
+                                            "items": {
+                                                "$ref": "#/definitions/models.Material"
+                                            }
+                                        }
+                                    }
+                                }
+                            ]
+                        }
+                    }
+                }
+            }
+        },
+        "/api-wms/v1/product/updateProduct": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "浜у搧"
+                ],
+                "summary": "淇敼浜у搧",
+                "parameters": [
+                    {
+                        "description": "浜у搧淇℃伅",
+                        "name": "object",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.Material"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/util.Response"
+                        }
+                    }
+                }
+            }
+        },
+        "/api-wms/v1/product/updateProductCategory": {
+            "post": {
+                "produces": [
+                    "application/json"
+                ],
+                "tags": [
+                    "浜у搧绫诲瀷"
+                ],
+                "summary": "淇敼浜у搧绫诲瀷",
+                "parameters": [
+                    {
+                        "description": "浜у搧淇℃伅",
+                        "name": "object",
+                        "in": "body",
+                        "required": true,
+                        "schema": {
+                            "$ref": "#/definitions/models.ProductCategory"
+                        }
+                    }
+                ],
+                "responses": {
+                    "200": {
+                        "description": "鎴愬姛",
+                        "schema": {
+                            "$ref": "#/definitions/util.Response"
                         }
                     }
                 }
@@ -707,6 +978,52 @@
                 "BaseOperationTypeInternal"
             ]
         },
+        "constvar.CostingMethod": {
+            "type": "integer",
+            "enum": [
+                1,
+                2,
+                3
+            ],
+            "x-enum-comments": {
+                "CostingMethodAverageCost": "骞冲潎鎴愭湰",
+                "CostingMethodFIFO": "鍏堣繘鍏堝嚭",
+                "CostingMethodStandardPrice": "鏍囧噯浠锋牸"
+            },
+            "x-enum-varnames": [
+                "CostingMethodStandardPrice",
+                "CostingMethodFIFO",
+                "CostingMethodAverageCost"
+            ]
+        },
+        "constvar.ForceRemovalStrategy": {
+            "type": "integer",
+            "enum": [
+                1,
+                2,
+                3
+            ],
+            "x-enum-varnames": [
+                "ForceRemovalStrategyFIFO",
+                "ForceRemovalStrategyLIFO",
+                "ForceRemovalStrategyClosestLocation"
+            ]
+        },
+        "constvar.InventoryValuation": {
+            "type": "integer",
+            "enum": [
+                1,
+                2
+            ],
+            "x-enum-comments": {
+                "InventoryValuationAuto": "鑷姩",
+                "InventoryValuationManual": "鎵嬪姩"
+            },
+            "x-enum-varnames": [
+                "InventoryValuationManual",
+                "InventoryValuationAuto"
+            ]
+        },
         "constvar.InvoicingStrategy": {
             "type": "integer",
             "enum": [
@@ -761,6 +1078,19 @@
                 "LocationTypeTransit"
             ]
         },
+        "constvar.MaterialMode": {
+            "type": "string",
+            "enum": [
+                "鍘熸潗鏂�",
+                "鍗婃垚鍝�",
+                "鎴愬搧"
+            ],
+            "x-enum-varnames": [
+                "MaterialModeRaw",
+                "MaterialModeSemi",
+                "MaterialModeFinished"
+            ]
+        },
         "constvar.OperationStatus": {
             "type": "integer",
             "enum": [
@@ -801,24 +1131,6 @@
                 "Task",
                 "Object",
                 "TaskAndObject"
-            ]
-        },
-        "constvar.ProductType": {
-            "type": "integer",
-            "enum": [
-                1,
-                2,
-                3
-            ],
-            "x-enum-comments": {
-                "Consumables": "娑堣�楀搧",
-                "Server": "鏈嶅姟",
-                "StoredProduct": "鍙偍瀛樼殑浜у搧"
-            },
-            "x-enum-varnames": [
-                "Consumables",
-                "Server",
-                "StoredProduct"
             ]
         },
         "constvar.ReservationMethod": {
@@ -971,6 +1283,157 @@
                 }
             }
         },
+        "models.Material": {
+            "type": "object",
+            "properties": {
+                "HSCode": {
+                    "type": "string"
+                },
+                "amount": {
+                    "type": "number"
+                },
+                "barcode": {
+                    "description": "鏉$爜",
+                    "type": "string"
+                },
+                "buyExplain": {
+                    "type": "string"
+                },
+                "canBePurchased": {
+                    "description": "鏄惁鍙噰璐�",
+                    "type": "boolean"
+                },
+                "categoryId": {
+                    "description": "浜у搧绫诲埆id",
+                    "type": "integer"
+                },
+                "companyId": {
+                    "type": "integer"
+                },
+                "companyName": {
+                    "type": "string"
+                },
+                "controlStrategy": {
+                    "$ref": "#/definitions/constvar.InvoicingStrategy"
+                },
+                "cost": {
+                    "description": "鎴愭湰",
+                    "type": "number"
+                },
+                "currencyName": {
+                    "type": "string"
+                },
+                "customerTaxes": {
+                    "description": "瀹㈡埛绋庣櫨鍒嗘瘮",
+                    "type": "number"
+                },
+                "deliveryAdvanceTime": {
+                    "type": "integer"
+                },
+                "id": {
+                    "type": "string"
+                },
+                "inStorageExplain": {
+                    "type": "string"
+                },
+                "internalNotes": {
+                    "description": "鍐呴儴璇存槑",
+                    "type": "string"
+                },
+                "internalReference": {
+                    "description": "鍐呴儴鍙傝��",
+                    "type": "string"
+                },
+                "internalTransferExplain": {
+                    "type": "string"
+                },
+                "invoicingStrategy": {
+                    "description": "wms娣诲姞瀛楁",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.InvoicingStrategy"
+                        }
+                    ]
+                },
+                "isSale": {
+                    "description": "PurchaseType      constvar.PurchaseType ` + "`" + `gorm:\"type:int(11);comment:閲囪喘绫诲瀷\" json:\"purchaseType\"` + "`" + `",
+                    "type": "boolean"
+                },
+                "maxInventory": {
+                    "type": "number"
+                },
+                "minInventory": {
+                    "description": "Explain           string                  ` + "`" + `gorm:\"type:varchar(512);comment:缂栧彿璇存槑\" json:\"explain\"` + "`" + `\nCodeStandardID    string                  ` + "`" + `gorm:\"type:varchar(191);comment:缂栫爜瑙勮寖ID\" json:\"codeStandardID\"` + "`" + `\nSpecs             string                  ` + "`" + `gorm:\"type:varchar(191);comment:鐗╂枡瑙勬牸\" json:\"specs\"` + "`" + `\nType              string                  ` + "`" + `gorm:\"type:varchar(191);comment:鐗╂枡鍨嬪彿\" json:\"type\"` + "`" + `",
+                    "type": "number"
+                },
+                "minPurchaseAmount": {
+                    "description": "PurchaseAheadDay  int                     ` + "`" + `gorm:\"type:int(11);comment:閲囪喘鎻愬墠鏈�(澶�)\" json:\"purchaseAheadDay\"` + "`" + `\nProduceAheadDay   int                     ` + "`" + `gorm:\"type:int(11);comment:鍒堕�犳彁鍓嶆湡(澶�)\" json:\"produceAheadDay\"` + "`" + `",
+                    "type": "number"
+                },
+                "model": {
+                    "description": "MaterialType constvar.ProductType  ` + "`" + `gorm:\"index;type:int(11);comment:鐗╂枡绫诲瀷(鏁板瓧)\" json:\"materialType\"` + "`" + `",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.MaterialMode"
+                        }
+                    ]
+                },
+                "name": {
+                    "type": "string"
+                },
+                "orderCreation": {
+                    "$ref": "#/definitions/constvar.OrderCreation"
+                },
+                "originCountryId": {
+                    "type": "integer"
+                },
+                "originCountryName": {
+                    "type": "string"
+                },
+                "outStorageExplain": {
+                    "type": "string"
+                },
+                "principal": {
+                    "description": "璐熻矗浜�",
+                    "type": "string"
+                },
+                "productTagId": {
+                    "description": "浜у搧鏍囩",
+                    "type": "integer"
+                },
+                "productTagName": {
+                    "type": "string"
+                },
+                "purchasePrice": {
+                    "type": "number"
+                },
+                "salePrice": {
+                    "type": "number"
+                },
+                "selectProduct": {
+                    "type": "integer"
+                },
+                "sellExplain": {
+                    "type": "string"
+                },
+                "supplier": {
+                    "description": "FSource           string                  ` + "`" + `gorm:\"type:varchar(191);comment:鐢熶骇杞﹂棿\" json:\"-\"` + "`" + `\nStatus            constvar.MaterialStatus ` + "`" + `gorm:\"type:int(11);comment:鐘舵�乗" json:\"status\"` + "`" + `",
+                    "type": "string"
+                },
+                "unit": {
+                    "description": "LockAmount        decimal.Decimal         ` + "`" + `gorm:\"type:decimal(35,18);default:0;comment:閿佸畾鏁伴噺\" json:\"lockAmount\"` + "`" + `",
+                    "type": "string"
+                },
+                "volume": {
+                    "description": "浣撶Н",
+                    "type": "number"
+                },
+                "weight": {
+                    "description": "閲嶉噺",
+                    "type": "number"
+                }
+            }
+        },
         "models.OperationType": {
             "type": "object",
             "properties": {
@@ -1085,150 +1548,50 @@
                 }
             }
         },
-        "models.Product": {
+        "models.ProductCategory": {
             "type": "object",
             "properties": {
-                "HSCode": {
-                    "type": "string"
+                "costingMethod": {
+                    "description": "鎴愭湰鏂规硶",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.CostingMethod"
+                        }
+                    ]
                 },
-                "barcode": {
-                    "description": "鏉$爜",
-                    "type": "string"
-                },
-                "buyExplain": {
-                    "type": "string"
-                },
-                "canBePurchased": {
-                    "description": "鏄惁鍙噰璐�",
-                    "type": "boolean"
-                },
-                "canBeSell": {
-                    "description": "鏄惁閿�鍞�",
-                    "type": "boolean"
-                },
-                "categoryId": {
-                    "description": "浜у搧鍒嗙被id",
-                    "type": "integer"
-                },
-                "companyId": {
-                    "type": "integer"
-                },
-                "companyName": {
-                    "type": "string"
-                },
-                "controlStrategy": {
-                    "$ref": "#/definitions/constvar.InvoicingStrategy"
-                },
-                "cost": {
-                    "description": "鎴愭湰",
-                    "type": "number"
-                },
-                "createTime": {
-                    "type": "string"
-                },
-                "currencyId": {
-                    "type": "integer"
-                },
-                "currencyName": {
-                    "type": "string"
-                },
-                "customerAdvanceTime": {
-                    "type": "number"
-                },
-                "customerTaxes": {
-                    "description": "瀹㈡埛绋庣櫨鍒嗘瘮",
-                    "type": "number"
-                },
-                "deliveryAdvanceTime": {
-                    "type": "number"
+                "forceRemovalStrategy": {
+                    "description": "寮哄埗涓嬫灦绛栫暐",
+                    "allOf": [
+                        {
+                            "$ref": "#/definitions/constvar.ForceRemovalStrategy"
+                        }
+                    ]
                 },
                 "id": {
                     "type": "integer"
                 },
-                "inStorageExplain": {
-                    "type": "string"
-                },
-                "internalNotes": {
-                    "description": "鍐呴儴璇存槑",
-                    "type": "string"
-                },
-                "internalReference": {
-                    "description": "鍐呴儴鍙傝��",
-                    "type": "string"
-                },
-                "internalTransferExplain": {
-                    "type": "string"
-                },
-                "invoicingStrategy": {
-                    "$ref": "#/definitions/constvar.InvoicingStrategy"
-                },
-                "name": {
-                    "description": "浜у搧鍚嶇О",
-                    "type": "string"
-                },
-                "objectTemplateId": {
-                    "type": "string"
-                },
-                "orderCreation": {
-                    "$ref": "#/definitions/constvar.OrderCreation"
-                },
-                "originCountryId": {
-                    "type": "integer"
-                },
-                "originCountryName": {
-                    "type": "string"
-                },
-                "outStorageExplain": {
-                    "type": "string"
-                },
-                "price": {
-                    "type": "number"
-                },
-                "principal": {
-                    "description": "璐熻矗浜�",
-                    "type": "string"
-                },
-                "productTagId": {
-                    "description": "浜у搧鏍囩",
-                    "type": "integer"
-                },
-                "productTagName": {
-                    "type": "string"
-                },
-                "salePrice": {
-                    "description": "閿�鍞环鏍�",
-                    "type": "number"
-                },
-                "selectProduct": {
-                    "type": "integer"
-                },
-                "sellExplain": {
-                    "type": "string"
-                },
-                "supplierId": {
-                    "type": "integer"
-                },
-                "supplierName": {
-                    "type": "string"
-                },
-                "type": {
-                    "description": "浜у搧绫诲瀷",
+                "inventoryValuation": {
+                    "description": "搴撳瓨璁′环",
                     "allOf": [
                         {
-                            "$ref": "#/definitions/constvar.ProductType"
+                            "$ref": "#/definitions/constvar.InventoryValuation"
                         }
                     ]
                 },
-                "updateTime": {
+                "name": {
+                    "description": "浣嶇疆鍚嶇О",
                     "type": "string"
                 },
-                "volume": {
-                    "description": "浣撶Н",
-                    "type": "number"
+                "parentId": {
+                    "description": "涓婄骇id",
+                    "type": "integer"
                 },
-                "weight": {
-                    "description": "閲嶉噺",
-                    "type": "number"
+                "routeId": {
+                    "type": "integer"
+                },
+                "routeName": {
+                    "description": "鍏徃",
+                    "type": "string"
                 }
             }
         },
@@ -1706,6 +2069,8 @@
 	Description:      "",
 	InfoInstanceName: "swagger",
 	SwaggerTemplate:  docTemplate,
+	LeftDelim:        "{{",
+	RightDelim:       "}}",
 }
 
 func init() {

--
Gitblit v1.8.0