From 80c8e74c7428329f06d1aa3b70b95b46da732b0a Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 27 六月 2024 20:09:03 +0800 Subject: [PATCH] 保存库存结算时间点重启定时任务 --- models/location_product_amount.go | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/models/location_product_amount.go b/models/location_product_amount.go index efa1205..d4990b1 100644 --- a/models/location_product_amount.go +++ b/models/location_product_amount.go @@ -47,6 +47,7 @@ ProductId string `json:"productId" gorm:"column:product_id"` ProductName string `json:"productName" gorm:"column:product_name"` Amount decimal.Decimal `json:"amount" gorm:"column:amount"` + AmountMoreUnits []UnitItems `json:"amountMoreUnits" gorm:"-"` //鍦ㄥ簱鏁伴噺澶氬崟浣� Unit string `json:"unit" gorm:"column:unit"` CreateDate string `json:"createDate" gorm:"column:create_date"` AdjustAmount decimal.Decimal `json:"adjustAmount" gorm:"column:adjust_amount"` //宸�� @@ -314,3 +315,13 @@ } return result, nil } + +func (slf *LocationProductAmountSearch) Save(record *LocationProductAmount) error { + var db = slf.build() + + if err := db.Omit("CreatedAt").Save(record).Error; err != nil { + return fmt.Errorf("save err: %v, record: %+v", err, record) + } + + return nil +} -- Gitblit v1.8.0