From 0022d062fc8c72061b4d62dc5e192e75588b6979 Mon Sep 17 00:00:00 2001 From: jiangshuai <291802688@qq.com> Date: 星期三, 22 十一月 2023 15:01:05 +0800 Subject: [PATCH] 出入库导入导出修改代码 --- controllers/operation.go | 6 +- docs/swagger.yaml | 22 +++++++++++ docs/docs.go | 36 +++++++++++++++++- docs/swagger.json | 34 +++++++++++++++++ router/router.go | 2 5 files changed, 94 insertions(+), 6 deletions(-) diff --git a/controllers/operation.go b/controllers/operation.go index dee8bd9..4e5ab53 100644 --- a/controllers/operation.go +++ b/controllers/operation.go @@ -839,7 +839,7 @@ // @Param id path int true "id" // @Success 200 {object} util.Response "鎴愬姛" // @Router /api-wms/v1/operation/outputOperation/{id} [put] -func (slf OperationController) InputSelfmade(c *gin.Context) { +func (slf OperationController) OutputOperation(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { util.ResponseFormat(c, code.RequestParamError, "閿欒鐨刬d鍊�") @@ -881,7 +881,7 @@ } func ExportInputSelfmade(category constvar.FileTemplateCategory, operation *models.Operation) (string, error) { - template, err := models.NewFileTemplateAttachmentSearch().SetCategory(category).First() + template, err := models.NewFileTemplateAttachmentSearch().SetPreload(true).SetCategory(category).First() if err != nil { return "", errors.New("鑾峰彇妯$増璁板綍澶辫触:" + err.Error()) } @@ -960,7 +960,7 @@ } func ExportOutputOperation(category constvar.FileTemplateCategory, operation *models.Operation) (string, error) { - template, err := models.NewFileTemplateAttachmentSearch().SetCategory(category).First() + template, err := models.NewFileTemplateAttachmentSearch().SetPreload(true).SetCategory(category).First() if err != nil { return "", errors.New("鑾峰彇妯$増璁板綍澶辫触:" + err.Error()) } diff --git a/docs/docs.go b/docs/docs.go index fba7780..9da5c1e 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -1249,6 +1249,34 @@ } } }, + "/api-wms/v1/operation/outputOperation/{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/update": { "post": { "produces": [ @@ -3347,6 +3375,9 @@ } ] }, + "createTime": { + "type": "string" + }, "forceRemovalStrategy": { "description": "寮哄埗涓嬫灦绛栫暐", "allOf": [ @@ -3380,6 +3411,9 @@ }, "routeName": { "description": "鍏徃", + "type": "string" + }, + "updateTime": { "type": "string" } } @@ -4652,8 +4686,6 @@ Description: "", InfoInstanceName: "swagger", SwaggerTemplate: docTemplate, - LeftDelim: "{{", - RightDelim: "}}", } func init() { diff --git a/docs/swagger.json b/docs/swagger.json index cfb93c0..c6beb2f 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -1237,6 +1237,34 @@ } } }, + "/api-wms/v1/operation/outputOperation/{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/update": { "post": { "produces": [ @@ -3335,6 +3363,9 @@ } ] }, + "createTime": { + "type": "string" + }, "forceRemovalStrategy": { "description": "寮哄埗涓嬫灦绛栫暐", "allOf": [ @@ -3369,6 +3400,9 @@ "routeName": { "description": "鍏徃", "type": "string" + }, + "updateTime": { + "type": "string" } } }, diff --git a/docs/swagger.yaml b/docs/swagger.yaml index 653c219..3e83835 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -680,6 +680,8 @@ allOf: - $ref: '#/definitions/constvar.CostingMethod' description: 鎴愭湰鏂规硶 + createTime: + type: string forceRemovalStrategy: allOf: - $ref: '#/definitions/constvar.ForceRemovalStrategy' @@ -701,6 +703,8 @@ type: integer routeName: description: 鍏徃 + type: string + updateTime: type: string type: object models.ReorderRule: @@ -2331,6 +2335,24 @@ summary: 鍒犻櫎鍏ュ簱/鍑哄簱淇℃伅 tags: - 鍏ュ簱/鍑哄簱 + /api-wms/v1/operation/outputOperation/{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/update: post: parameters: diff --git a/router/router.go b/router/router.go index bc709d9..a75aba3 100644 --- a/router/router.go +++ b/router/router.go @@ -88,7 +88,7 @@ operationAPI.POST("listTransfer", operationController.ListTransfer) operationAPI.GET("getLogisticCompanyList", operationController.GetLogisticCompanyList) operationAPI.PUT("cancel/:id", operationController.Cancel) - operationAPI.PUT("inputSelfmade/:id", operationController.InputSelfmade) + operationAPI.PUT("outputOperation/:id", operationController.OutputOperation) } -- Gitblit v1.8.0