From 2531387e99a35c0717df28da79fcc1f46dbf7a4c Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期三, 26 六月 2024 16:29:47 +0800
Subject: [PATCH] 定时任务时区改local

---
 models/material.go |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/models/material.go b/models/material.go
index fe9e42a..20896fc 100644
--- a/models/material.go
+++ b/models/material.go
@@ -51,7 +51,6 @@
 		CategoryId          int                        `gorm:"type:int(11);comment:浜у搧绫诲埆id" json:"categoryId"`                //浜у搧绫诲埆id
 		CategoryName        string                     `gorm:"type:varchar(255);comment:浜у搧绫诲埆鍚嶇О" json:"categoryName"`         //浜у搧绫诲埆鍚嶇О
 		InternalReference   string                     `gorm:"type:varchar(255);comment:鍐呴儴鍙傝��" json:"internalReference"`      //鍐呴儴鍙傝��
-		Barcode             string                     `gorm:"type:varchar(255);comment:鏉$爜" json:"barcode"`                  //鏉$爜
 		ProductTagId        int                        `gorm:"type:int(11);comment:浜у搧鏍囩id" json:"productTagId"`              //浜у搧鏍囩id
 		ProductTagName      string                     `gorm:"type:varchar(255);comment:浜у搧鏍囩鍚嶇О" json:"productTagName"`       //浜у搧鏍囩鍚嶇О
 		CompanyId           int                        `gorm:"type:int(11);comment:鍏徃id" json:"companyId"`                   //鍏徃id
@@ -86,6 +85,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 +95,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 {
@@ -120,7 +122,7 @@
 	UnitItems struct {
 		Amount   decimal.Decimal `json:"amount"`
 		Unit     string          `json:"unit"`
-		Floating bool            `json:"floating"`
+		Floating bool            `json:"floating"` //鏄惁娴姩鍒╃巼
 	}
 )
 
@@ -199,6 +201,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 +277,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