From 11168aeec504c395f656e22ea7e903582823c5fc Mon Sep 17 00:00:00 2001
From: lishihai <dslsh@dscom>
Date: 星期一, 24 六月 2024 11:01:46 +0800
Subject: [PATCH] /api-wms/v1/product/getProductDetails/{id}->添加动态属性
---
proto/purchase_wms/server.go | 13 +++++++++++--
1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/proto/purchase_wms/server.go b/proto/purchase_wms/server.go
index cbab86d..5d1da59 100644
--- a/proto/purchase_wms/server.go
+++ b/proto/purchase_wms/server.go
@@ -2,6 +2,7 @@
import (
"context"
+ "errors"
"github.com/shopspring/decimal"
"gorm.io/gorm"
"strconv"
@@ -24,8 +25,10 @@
operation.Number = strconv.FormatInt(time.Now().Unix(), 10)
operation.Status = constvar.OperationStatus_Ready
operation.CompanyName = req.SupplierName
- operation.CompanyID = int(req.SupplierId)
+ operation.CompanyID = strconv.FormatInt(req.SupplierId, 10)
operation.Source = req.Source
+ operation.OperationSource = constvar.OperationSource(req.OperationSource)
+ operation.SalesDetailsNumber = req.SalesDetailsNumber
warehouse, err := models.NewWarehouseSearch().SetName(req.WarehouseName).First()
if err != nil {
return nil, err
@@ -90,7 +93,13 @@
}
func (s *Server) SrmGetOperationInfo(c context.Context, req *SrmGetOperationInfoRequest) (*SrmGetOperationInfoResponse, error) {
- operations, err := models.NewOperationSearch().SetSourceNumber(req.Number).SetPreload(true).FindNotTotal()
+ if req.Number == "" && req.SalesDetailsNumber == "" && req.OperationSource == 0 {
+ return nil, errors.New("鍙傛暟缂哄け")
+ }
+ operations, err := models.NewOperationSearch().SetSourceNumber(req.Number).
+ SetOperationSource(constvar.OperationSource(req.OperationSource)).
+ SetSalesDetailsNumber(req.SalesDetailsNumber).
+ SetPreload(true).FindNotTotal()
if err != nil {
return nil, err
}
--
Gitblit v1.8.0