From b13834f8c0b4a0fe9928cb07a721e6ec7df86ae1 Mon Sep 17 00:00:00 2001
From: jiangshuai <291802688@qq.com>
Date: 星期三, 15 十一月 2023 17:01:51 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/aps/WMS

---
 controllers/product_controller.go |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/controllers/product_controller.go b/controllers/product_controller.go
index 053effc..054b4ca 100644
--- a/controllers/product_controller.go
+++ b/controllers/product_controller.go
@@ -15,7 +15,6 @@
 	"wms/models"
 	"wms/pkg/logx"
 	"wms/request"
-	"wms/utils"
 )
 
 type ProductController struct {
@@ -34,6 +33,10 @@
 		util.ResponseFormat(c, code.RequestParamError, "鍙傛暟瑙f瀽澶辫触锛屾暟鎹被鍨嬮敊璇�")
 		return
 	}
+	if params.ID == "" {
+		util.ResponseFormat(c, code.RequestParamError, "浜у搧缂栫爜涓嶈兘涓虹┖")
+		return
+	}
 	if params.Name == "" {
 		util.ResponseFormat(c, code.RequestParamError, "浜у搧鍚嶇О涓嶈兘涓虹┖")
 		return
@@ -46,7 +49,7 @@
 		util.ResponseFormat(c, code.RequestParamError, "鍗曚綅涓嶈兘涓虹┖")
 		return
 	}
-	params.ID = utils.GetUUID()
+	//params.ID = utils.GetUUID()
 	err := models.NewMaterialSearch().Create(&params)
 	if err != nil {
 		util.ResponseFormat(c, code.RequestParamError, "浜у搧淇℃伅淇濆瓨澶辫触")
@@ -572,7 +575,7 @@
 
 				locAmount, res := models.NewLocationProductAmountSearch().
 					SetProductId(v.ID).
-					SetLocationId(operation.ToLocationID).
+					SetLocationId(operation.FromLocationID).
 					FirstRes()
 				if res.Error != nil {
 					return err
@@ -689,7 +692,7 @@
 	search := models.NewOperationSearch().SetPage(params.Page, params.PageSize).SetPreload(true).SetOrder("created_at desc")
 	search.SetOrm(search.Orm.InnerJoins("inner join wms_operation_details on wms_operation_details.operation_id=wms_operation.id").Where("wms_operation_details.product_id=? and (wms_operation.from_location_id=? or wms_operation.to_location_id=?)", params.ProductId, params.LocationId, params.LocationId))
 
-	list, total, err := search.Find()
+	list, total, err := search.SetBaseOperationType(constvar.BaseOperationTypeAdjust).Find()
 	if err != nil {
 		util.ResponseFormat(c, code.RequestError, "鏌ユ壘澶辫触:"+err.Error())
 		return

--
Gitblit v1.8.0