From 137441e2396cf231f9d41e5c399038dbfe01433f Mon Sep 17 00:00:00 2001
From: yinbentan <yinbentan@live.com>
Date: 星期二, 16 七月 2024 20:24:55 +0800
Subject: [PATCH] 添加字段,库存报表统计返回结果添加productType(产品类别)、productSpecs(产品规格),产品类别由原来的productType改为productCategory
---
models/material.go | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/models/material.go b/models/material.go
index 648c583..e410f35 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
@@ -97,7 +96,7 @@
MaxInventoryRule decimal.Decimal `json:"maxInventoryRule" gorm:"-"` //鏈�澶у簱瀛�
CreateBy string `gorm:"type:varchar(255);comment:瀵煎叆浜恒�佸垱寤轰汉" json:"createBy"` //鍒涘缓浜�
- BarCode string `gorm:"type:varchar(255);comment:(鍟嗗搧/浜у搧/鐗╂枡鐨�)鏉″舰鐮�" json:"barCode"` //鍒涘缓浜�
+ BarCode string `gorm:"type:varchar(255);comment:(鍟嗗搧/浜у搧/鐗╂枡鐨�)鏉″舰鐮�" json:"barCode"` //鏉$爜
}
MaterialSearch struct {
@@ -165,7 +164,14 @@
}
}
if len(slf.MoreUnitList) != 0 {
- str, err := json.Marshal(slf.MoreUnitList)
+ items := make([]UnitItems, 0)
+ for k, item := range slf.MoreUnitList {
+ if item.Unit != "" && !item.Amount.IsZero() {
+ items = append(items, slf.MoreUnitList[k])
+ }
+ }
+
+ str, err := json.Marshal(items)
if err != nil {
return err
}
--
Gitblit v1.8.0