From eff5bd84bc43bec2fec99d829b6f3216dee509f0 Mon Sep 17 00:00:00 2001 From: dsmzx <dsmzx@123.com> Date: 星期五, 14 六月 2024 17:52:37 +0800 Subject: [PATCH] 出入库调拨产品明细增加备注字段(同步产品的备注字段)添加字段 --- controllers/operation.go | 17 ----------------- request/operation.go | 1 + models/operation_details.go | 2 +- 3 files changed, 2 insertions(+), 18 deletions(-) diff --git a/controllers/operation.go b/controllers/operation.go index d59b86b..0d409a3 100644 --- a/controllers/operation.go +++ b/controllers/operation.go @@ -91,23 +91,6 @@ return } - var productIds []string - for _, v := range params.Details { - productIds = append(productIds, v.ProductId) - } - products, err := models.NewMaterialSearch().SetIDs(productIds).FindNotTotal() - if err != nil { - logx.Errorf("MonthStats get products err:%v", err) - return - } - productMap := models.MaterialMap(products) - for i, v := range params.Details { - material := productMap[v.ProductId] - if material != nil { - params.Details[i].Note = material.Note - } - } - if err := models.NewOperationSearch().Create(¶ms); err != nil { logx.Errorf("Operation create err: %v", err) util.ResponseFormat(c, code.SaveFail, "娣诲姞澶辫触锛�"+err.Error()) diff --git a/models/operation_details.go b/models/operation_details.go index ea37b72..278a259 100644 --- a/models/operation_details.go +++ b/models/operation_details.go @@ -27,7 +27,7 @@ TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:鎬诲噣閲�"` AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:杈呭姪鏁伴噺"` AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:杈呭姪鍗曚綅"` - Note string `gorm:"type:varchar(1024);comment:澶囨敞" json:"note"` + Remark string `gorm:"type:varchar(1024);comment:澶囨敞" json:"remark"` } OperationDetailsSearch struct { diff --git a/request/operation.go b/request/operation.go index 73647ab..73d6421 100644 --- a/request/operation.go +++ b/request/operation.go @@ -51,6 +51,7 @@ TotalNetWeight decimal.Decimal `json:"totalNetWeight" gorm:"type:decimal(20,3);comment:鎬诲噣閲�"` //鎬诲噣閲� AuxiliaryAmount decimal.Decimal `json:"auxiliaryAmount" gorm:"type:decimal(20,3);comment:杈呭姪鏁伴噺"` //杈呭姪鏁伴噺 AuxiliaryUnit string `json:"auxiliaryUnit" gorm:"type:varchar(191);comment:杈呭姪鍗曚綅"` //杈呭姪鍗曚綅 + Remark string `gorm:"type:varchar(1024);comment:澶囨敞" json:"remark"` } type OperationList struct { -- Gitblit v1.8.0