From 4738292c4762419696bee8962db7b7b7a0057c57 Mon Sep 17 00:00:00 2001 From: jiangshuai <291802688@qq.com> Date: 星期二, 26 九月 2023 19:30:12 +0800 Subject: [PATCH] 1.二期一部分代码 --- controllers/operation.go | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/controllers/operation.go b/controllers/operation.go index 872fb4c..9a87ab0 100644 --- a/controllers/operation.go +++ b/controllers/operation.go @@ -46,9 +46,15 @@ util.ResponseFormat(c, code.RequestParamError, err.Error()) return } + operationType, err := models.NewOperationTypeSearch().SetID(uint(params.OperationTypeId)).First() + if err != nil { + util.ResponseFormat(c, code.RequestParamError, err.Error()) + return + } params.Status = constvar.OperationStatus_Ready params.Number = strconv.FormatInt(time.Now().Unix(), 10) + params.BaseOperationType = operationType.BaseOperationType if err := models.NewOperationSearch().Create(¶ms); err != nil { logx.Errorf("Operation create err: %v", err) util.ResponseFormat(c, code.SaveFail, "娣诲姞澶辫触锛�"+err.Error()) @@ -323,8 +329,14 @@ if err := tx.Save(listProdt[k]).Error; err != nil { return err } + //TODO:鍑哄叆搴撶殑finish鍜屾姤搴熺殑finish閮借澧炲姞瀵筶ocation_product_amount琛ㄦ暟閲忕殑鏇存柊,鍥犱负姝よ〃鏈塒roductCategory瀛楁锛屾墍浠peration_details琛ㄤ腑瑕佸鍔燩roductCategoryId瀛楁 + //var locAmount models.LocationProductAmount + //if err := models.NewLocationProductAmountSearch().Orm.Table("wms_location_produt_amount").Joins("inner join wms_location_product on wms_location_produt.id=wms_location_produt_amount.location_product_id").Where("wms_location_produt.product_id=? and wms_location_produt.location_id=?",operation.ToLocationID,v.ID).First(&locAmount).Error;err!=nil { + // return err + //} } } + } if operationType.BaseOperationType == constvar.BaseOperationTypeOutgoing { for k, v := range listProdt { -- Gitblit v1.8.0