From e042d530a290bb0e45e59fe5c06d813618d0e546 Mon Sep 17 00:00:00 2001
From: yinbentan <yinbentan@live.com>
Date: 星期四, 11 七月 2024 11:56:53 +0800
Subject: [PATCH] 仓库位置查询从仓库缩写变更为仓库ID查询

---
 service/inventory_report_forms.go |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/service/inventory_report_forms.go b/service/inventory_report_forms.go
index 4409d83..45d3795 100644
--- a/service/inventory_report_forms.go
+++ b/service/inventory_report_forms.go
@@ -130,8 +130,11 @@
 	err error) {
 	productAmounts = make([]*models.LocationProductAmount, 0)
 	locationSearch := models.NewLocationSearch()
-	if params.WarehouseCode != "" {
-		locationSearch.SetJointName(params.WarehouseCode)
+	//if params.WarehouseCode != "" {
+	//	locationSearch.SetJointName(params.WarehouseCode)
+	//}
+	if params.WarehouseId > 0 {
+		locationSearch.SetWarehouseId(params.WarehouseId)
 	}
 
 	locations, err := locationSearch.FindNotTotal()
@@ -154,9 +157,9 @@
 
 	//鏌ヨ浜у搧
 	search = models.NewMaterialSearch()
-	search.Orm = search.Orm.Model(&models.Material{}).
-		Select(`material.id, material.name, material.cost, material.amount, material.unit, material.more_unit, material.more_unit_value, wms_product_category.name as category_name `).
-		Joins("left join wms_product_category on material.category_id = wms_product_category.id")
+	search.Orm = search.Orm.Model(&models.Material{}). // material
+								Select(`material.id, material.name, material.cost, material.amount, material.unit, material.more_unit, material.more_unit_value, wms_product_category.name as category_name `).
+								Joins("left join wms_product_category on material.category_id = wms_product_category.id")
 	if len(params.CategoryIds) > 0 {
 		search.Orm.Where("material.category_id in (?)", params.CategoryIds)
 	}

--
Gitblit v1.8.0