From 39a8a6ca76c13c4014732441c6c73cc3c2243e19 Mon Sep 17 00:00:00 2001
From: lishihai <dslsh@dscom>
Date: 星期三, 26 六月 2024 11:27:25 +0800
Subject: [PATCH] 库存盘点应用按钮记录创建人,创建时间,应用时间、应用人员等信息;根据条形码查询产品详情;新增编辑产品增加条形码字段

---
 models/material.go |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/models/material.go b/models/material.go
index 5350fc2..648c583 100644
--- a/models/material.go
+++ b/models/material.go
@@ -96,7 +96,8 @@
 		MinInventoryRule decimal.Decimal `json:"minInventoryRule" gorm:"-"` //鏈�灏忓簱瀛�
 		MaxInventoryRule decimal.Decimal `json:"maxInventoryRule" gorm:"-"` //鏈�澶у簱瀛�
 
-		CreateBy string `gorm:"type:varchar(255);comment:瀵煎叆浜恒�佸垱寤轰汉" json:"createBy"` //鍒涘缓浜�
+		CreateBy string `gorm:"type:varchar(255);comment:瀵煎叆浜恒�佸垱寤轰汉" json:"createBy"`       //鍒涘缓浜�
+		BarCode  string `gorm:"type:varchar(255);comment:(鍟嗗搧/浜у搧/鐗╂枡鐨�)鏉″舰鐮�" json:"barCode"` //鍒涘缓浜�
 	}
 
 	MaterialSearch struct {
@@ -201,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
@@ -272,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