From 221108b0e0416968ca8417513ebf65c8b5109662 Mon Sep 17 00:00:00 2001
From: lishihai <dslsh@dscom>
Date: 星期三, 26 六月 2024 11:40:47 +0800
Subject: [PATCH] 库存盘点应用按钮记录创建人,创建时间,应用时间、应用人员等信息;根据条形码查询产品详情;新增编辑产品增加条形码字段->添加条形码被使用验证
---
models/location_product_amount.go | 18 ++++++++++++++++--
1 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/models/location_product_amount.go b/models/location_product_amount.go
index 447b469..d4990b1 100644
--- a/models/location_product_amount.go
+++ b/models/location_product_amount.go
@@ -47,10 +47,11 @@
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"`
- DifferenceAmount decimal.Decimal `json:"differenceAmount" gorm:"-"`
+ AdjustAmount decimal.Decimal `json:"adjustAmount" gorm:"column:adjust_amount"` //宸��
+ DifferenceAmount decimal.Decimal `json:"differenceAmount" gorm:"-"` //璁℃暟鏁伴噺
OperationId int `json:"operationId" gorm:"column:operation_id"`
Status constvar.OperationStatus `json:"status" gorm:"status"`
BaseOperationType constvar.BaseOperationType `json:"baseOperationType" gorm:"base_operation_type"`
@@ -253,6 +254,9 @@
db = slf.build()
)
+ if slf.PageNum*slf.PageSize > 0 {
+ db = db.Offset((slf.PageNum - 1) * slf.PageSize).Limit(slf.PageSize)
+ }
if err := db.Find(&records).Error; err != nil {
return records, fmt.Errorf("find records err: %v", err)
}
@@ -311,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