From 548030097f2b95dff474c397c7393168c73ab8a2 Mon Sep 17 00:00:00 2001 From: liujiandao <274878379@qq.com> Date: 星期三, 20 九月 2023 09:51:04 +0800 Subject: [PATCH] 产品与产品类型功能开发 --- docs/swagger.yaml | 461 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 349 insertions(+), 112 deletions(-) diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 76b7b0e..2d89dc0 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -13,6 +13,41 @@ - BaseOperationTypeIncoming - BaseOperationTypeOutgoing - BaseOperationTypeInternal + constvar.CostingMethod: + enum: + - 1 + - 2 + - 3 + type: integer + x-enum-comments: + CostingMethodAverageCost: 骞冲潎鎴愭湰 + CostingMethodFIFO: 鍏堣繘鍏堝嚭 + CostingMethodStandardPrice: 鏍囧噯浠锋牸 + x-enum-varnames: + - CostingMethodStandardPrice + - CostingMethodFIFO + - CostingMethodAverageCost + constvar.ForceRemovalStrategy: + enum: + - 1 + - 2 + - 3 + type: integer + x-enum-varnames: + - ForceRemovalStrategyFIFO + - ForceRemovalStrategyLIFO + - ForceRemovalStrategyClosestLocation + constvar.InventoryValuation: + enum: + - 1 + - 2 + type: integer + x-enum-comments: + InventoryValuationAuto: 鑷姩 + InventoryValuationManual: 鎵嬪姩 + x-enum-varnames: + - InventoryValuationManual + - InventoryValuationAuto constvar.InvoicingStrategy: enum: - 1 @@ -59,6 +94,16 @@ - LocationTypeInventoryLoss - LocationTypeProduction - LocationTypeTransit + constvar.MaterialMode: + enum: + - 鍘熸潗鏂� + - 鍗婃垚鍝� + - 鎴愬搧 + type: string + x-enum-varnames: + - MaterialModeRaw + - MaterialModeSemi + - MaterialModeFinished constvar.OperationStatus: enum: - 1 @@ -93,20 +138,6 @@ - Task - Object - TaskAndObject - constvar.ProductType: - enum: - - 1 - - 2 - - 3 - type: integer - x-enum-comments: - Consumables: 娑堣�楀搧 - Server: 鏈嶅姟 - StoredProduct: 鍙偍瀛樼殑浜у搧 - x-enum-varnames: - - Consumables - - Server - - StoredProduct constvar.ReservationMethod: enum: - 1 @@ -212,6 +243,120 @@ updateTime: type: string type: object + models.Material: + 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: + allOf: + - $ref: '#/definitions/constvar.InvoicingStrategy' + description: wms娣诲姞瀛楁 + 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"` + CodeStandardID string `gorm:"type:varchar(191);comment:缂栫爜瑙勮寖ID" json:"codeStandardID"` + Specs string `gorm:"type:varchar(191);comment:鐗╂枡瑙勬牸" json:"specs"` + Type string `gorm:"type:varchar(191);comment:鐗╂枡鍨嬪彿" json:"type"` + type: number + minPurchaseAmount: + description: |- + PurchaseAheadDay int `gorm:"type:int(11);comment:閲囪喘鎻愬墠鏈�(澶�)" json:"purchaseAheadDay"` + ProduceAheadDay int `gorm:"type:int(11);comment:鍒堕�犳彁鍓嶆湡(澶�)" json:"produceAheadDay"` + type: number + model: + allOf: + - $ref: '#/definitions/constvar.MaterialMode' + description: MaterialType constvar.ProductType `gorm:"index;type:int(11);comment:鐗╂枡绫诲瀷(鏁板瓧)" + json:"materialType"` + 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:"-"` + Status 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 + type: object models.OperationType: properties: ReservationDaysBeforePriority: @@ -282,106 +427,33 @@ description: 浠撳簱id type: integer type: object - models.Product: + models.ProductCategory: properties: - HSCode: - type: string - 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 + costingMethod: + allOf: + - $ref: '#/definitions/constvar.CostingMethod' + description: 鎴愭湰鏂规硶 + forceRemovalStrategy: + allOf: + - $ref: '#/definitions/constvar.ForceRemovalStrategy' + description: 寮哄埗涓嬫灦绛栫暐 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: + inventoryValuation: allOf: - - $ref: '#/definitions/constvar.ProductType' - description: 浜у搧绫诲瀷 - updateTime: + - $ref: '#/definitions/constvar.InventoryValuation' + description: 搴撳瓨璁′环 + name: + description: 浣嶇疆鍚嶇О type: string - volume: - description: 浣撶Н - type: number - weight: - description: 閲嶉噺 - type: number + parentId: + description: 涓婄骇id + type: integer + routeId: + type: integer + routeName: + description: 鍏徃 + type: string type: object models.Warehouse: properties: @@ -902,7 +974,7 @@ name: object required: true schema: - $ref: '#/definitions/models.Product' + $ref: '#/definitions/models.Material' produces: - application/json responses: @@ -911,6 +983,133 @@ schema: $ref: '#/definitions/util.Response' summary: 娣诲姞浜у搧 + tags: + - 浜у搧 + /api-wms/v1/product/addProductCategory: + post: + parameters: + - description: 浜у搧绫诲瀷淇℃伅 + in: body + name: object + required: true + schema: + $ref: '#/definitions/models.ProductCategory' + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/util.Response' + summary: 娣诲姞浜у搧绫诲瀷 + tags: + - 浜у搧绫诲瀷 + /api-wms/v1/product/deleteProduct/{id}: + delete: + parameters: + - description: id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/util.Response' + summary: 鍒犻櫎浜у搧 + tags: + - 浜у搧 + /api-wms/v1/product/deleteProductCategory/{id}: + delete: + parameters: + - description: id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/util.Response' + summary: 鍒犻櫎浜у搧绫诲瀷 + tags: + - 浜у搧绫诲瀷 + /api-wms/v1/product/getProductCategoryDetails/{id}: + get: + parameters: + - description: id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + allOf: + - $ref: '#/definitions/util.Response' + - properties: + data: + $ref: '#/definitions/models.Material' + type: object + summary: 鑾峰彇浜у搧绫诲瀷璇︽儏 + tags: + - 浜у搧绫诲瀷 + /api-wms/v1/product/getProductCategoryList: + post: + parameters: + - description: 鏌ヨ鍙傛暟 + in: body + name: object + required: true + schema: + $ref: '#/definitions/request.GetProductList' + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + allOf: + - $ref: '#/definitions/util.ResponseList' + - properties: + data: + items: + $ref: '#/definitions/models.ProductCategory' + type: array + type: object + summary: 鑾峰彇浜у搧绫诲瀷鍒楄〃 + tags: + - 浜у搧绫诲瀷 + /api-wms/v1/product/getProductDetails/{id}: + get: + parameters: + - description: id + in: path + name: id + required: true + type: string + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + allOf: + - $ref: '#/definitions/util.Response' + - properties: + data: + $ref: '#/definitions/models.Material' + type: object + summary: 鑾峰彇浜у搧璇︽儏 tags: - 浜у搧 /api-wms/v1/product/getProductList: @@ -933,12 +1132,50 @@ - properties: data: items: - $ref: '#/definitions/models.Product' + $ref: '#/definitions/models.Material' type: array type: object - summary: 鑾峰彇浜у搧璇︽儏 + summary: 鑾峰彇浜у搧鍒楄〃 tags: - 浜у搧 + /api-wms/v1/product/updateProduct: + post: + parameters: + - description: 浜у搧淇℃伅 + in: body + name: object + required: true + schema: + $ref: '#/definitions/models.Material' + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/util.Response' + summary: 淇敼浜у搧 + tags: + - 浜у搧 + /api-wms/v1/product/updateProductCategory: + post: + parameters: + - description: 浜у搧淇℃伅 + in: body + name: object + required: true + schema: + $ref: '#/definitions/models.ProductCategory' + produces: + - application/json + responses: + "200": + description: 鎴愬姛 + schema: + $ref: '#/definitions/util.Response' + summary: 淇敼浜у搧绫诲瀷 + tags: + - 浜у搧绫诲瀷 /api-wms/v1/warehouse/operationType: get: parameters: -- Gitblit v1.8.0