From c965651da313fa6b41d0f07d7910824c57582cae Mon Sep 17 00:00:00 2001 From: lishihai <dslsh@dscom> Date: 星期三, 26 六月 2024 11:55:18 +0800 Subject: [PATCH] 库存盘点应用按钮记录创建人,创建时间,应用时间、应用人员等信息;根据条形码查询产品详情;新增编辑产品增加条形码字段->添加条形码被使用验证 --- models/material.go | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/models/material.go b/models/material.go index 4c6eaa2..648c583 100644 --- a/models/material.go +++ b/models/material.go @@ -86,6 +86,7 @@ NetWeight decimal.Decimal `json:"netWeight" gorm:"type:decimal(20,3);comment:鍑�閲�"` GrossUnit string `json:"grossUnit" gorm:"type:varchar(255);comment:姣涢噸鍗曚綅"` NetUnit string `json:"netUnit" gorm:"type:varchar(255);comment:鍑�閲嶅崟浣�"` + Attributes []Attribute `json:"attributes" gorm:"-"` //鍔ㄦ�佸睘鎬� //浠ヤ笅涓轰笉瀛樺簱鐨勫瓧娈� AttachmentIDs []uint `json:"attachmentIDs" gorm:"-"` @@ -95,6 +96,8 @@ MinInventoryRule decimal.Decimal `json:"minInventoryRule" gorm:"-"` //鏈�灏忓簱瀛� MaxInventoryRule decimal.Decimal `json:"maxInventoryRule" gorm:"-"` //鏈�澶у簱瀛� + CreateBy string `gorm:"type:varchar(255);comment:瀵煎叆浜恒�佸垱寤轰汉" json:"createBy"` //鍒涘缓浜� + BarCode string `gorm:"type:varchar(255);comment:(鍟嗗搧/浜у搧/鐗╂枡鐨�)鏉″舰鐮�" json:"barCode"` //鍒涘缓浜� } MaterialSearch struct { @@ -199,6 +202,11 @@ return slf } +func (slf *MaterialSearch) SetBarCode(barCode string) *MaterialSearch { + slf.BarCode = barCode + return slf +} + func (slf *MaterialSearch) SetIsSale(isSale bool) *MaterialSearch { slf.IsSale = isSale return slf @@ -270,6 +278,9 @@ if slf.ID != "" { db = db.Where("id = ?", slf.ID) } + if slf.BarCode != "" { + db = db.Where("bar_code = ?", slf.BarCode) + } if slf.Name != "" { db = db.Where("name = ?", slf.Name) -- Gitblit v1.8.0