From 155f70979af20ca520a55b89c6ec8cd46c43f8a5 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 31 七月 2024 15:47:33 +0800 Subject: [PATCH] 产品流水表增加多单位存储 --- controllers/operation.go | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/controllers/operation.go b/controllers/operation.go index 0cb7a5f..ae06b4b 100644 --- a/controllers/operation.go +++ b/controllers/operation.go @@ -41,6 +41,7 @@ // @Tags 鍏ュ簱/鍑哄簱 // @Summary 娣诲姞鍏ュ簱/鍑哄簱 // @Produce application/json +// @Param Authorization header string true "token" // @Param object body request.AddOperation true "鍏ュ簱/鍑哄簱淇℃伅" // @Success 200 {object} util.Response "鎴愬姛" // @Router /api-wms/v1/operation/operation [post] @@ -146,6 +147,7 @@ util.ResponseFormat(c, code.Success, "娣诲姞鎴愬姛") } +// CheckInventoryDealerType 妫�鏌ュ熀纭�绫诲瀷锛岄槻姝㈢被鍨嬩负绌烘坊鍔犲叾瀹冪被鍨� func CheckInventoryDealerType(params *models.Operation) { var dictType constvar.MiniDictType dictName := "鍏朵粬" @@ -331,6 +333,7 @@ // @Tags 鍏ュ簱/鍑哄簱 // @Summary 鍏ュ簱/鍑哄簱鍒楄〃 // @Produce application/json +// @Param Authorization header string true "token" // @Param object body request.OperationList true "鏌ヨ鍙傛暟" // @Success 200 {object} util.ResponseList{data=[]models.Operation} "鎴愬姛" // @Router /api-wms/v1/operation/list [post] @@ -485,6 +488,7 @@ // @Tags 鍏ュ簱/鍑哄簱 // @Summary 鍒犻櫎鍏ュ簱/鍑哄簱淇℃伅 // @Produce application/json +// @Param Authorization header string true "token" // @Param id path int true "id" // @Success 200 {object} util.Response "鎴愬姛" // @Router /api-wms/v1/operation/operation/{id} [delete] @@ -532,9 +536,10 @@ // @Tags 鍏ュ簱/鍑哄簱 // @Summary 鏇存敼璁板綍鐘舵�� // @Produce application/json -// @Param id path int true "id" +// @Param Authorization header string true "token" +// @Param id path int true "id" // @Success 200 {object} util.Response "鎴愬姛" -// @Router /api-wms/v1/operation/finish/{id} [put] +// @Router /api-wms/v1/operation/finish/{id} [put] func (slf OperationController) Finish(c *gin.Context) { id, err := strconv.Atoi(c.Param("id")) if err != nil { @@ -585,25 +590,26 @@ return err } - if operation.BaseOperationType == constvar.BaseOperationTypeIncoming { + if operation.BaseOperationType == constvar.BaseOperationTypeIncoming { // 鍏ュ簱 if err := service.FinishOperationInput(c, tx, operation, listDetails, mapLocAmount); err != nil { return err } } - if operation.BaseOperationType == constvar.BaseOperationTypeOutgoing || operation.BaseOperationType == constvar.BaseOperationTypeDisuse { + if operation.BaseOperationType == constvar.BaseOperationTypeOutgoing || // 鍑哄簱 + operation.BaseOperationType == constvar.BaseOperationTypeDisuse { // 鎶ュ簾 if err := service.FinishOperationOutput(tx, listDetails, mapLocAmount, operation); err != nil { return err } } - if operation.BaseOperationType == constvar.BaseOperationTypeInternal { + if operation.BaseOperationType == constvar.BaseOperationTypeInternal { // 鍐呴儴璋冩嫧 if err := service.FinishOperationInternal(tx, listDetails, operation); err != nil { return err } } - if operation.BaseOperationType == constvar.BaseOperationTypeAdjust { + if operation.BaseOperationType == constvar.BaseOperationTypeAdjust { // 搴撳瓨鐩樼偣 if err := service.FinishOperationAdjust(tx, listDetails, mapLocAmount, operation); err != nil { return err } @@ -626,7 +632,6 @@ go UpdateOutStatus(operation.Source, operation.SourceNumber, 4) } } - util.ResponseFormat(c, code.Success, "鎿嶄綔鎴愬姛") } -- Gitblit v1.8.0