From fe675a31074e9ff012d29387336dc35de3ba46f2 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期二, 06 二月 2024 17:24:50 +0800
Subject: [PATCH] 销售明细不推送wms

---
 api/v1/salesDetails.go |   62 +++++++++++++++---------------
 1 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/api/v1/salesDetails.go b/api/v1/salesDetails.go
index bae4856..874d2c4 100644
--- a/api/v1/salesDetails.go
+++ b/api/v1/salesDetails.go
@@ -310,15 +310,15 @@
 	if !ok {
 		return
 	}
-	clientName := ""
-	if params.ClientId > 0 {
-		first, err := model.NewClientSearch(nil).SetId(params.ClientId).First()
-		if err != nil {
-			ctx.FailWithMsg(ecode.UnknownErr, "瀹㈡埛淇℃伅鏌ヨ澶辫触")
-			return
-		}
-		clientName = first.Name
-	}
+	//clientName := ""
+	//if params.ClientId > 0 {
+	//	first, err := model.NewClientSearch(nil).SetId(params.ClientId).First()
+	//	if err != nil {
+	//		ctx.FailWithMsg(ecode.UnknownErr, "瀹㈡埛淇℃伅鏌ヨ澶辫触")
+	//		return
+	//	}
+	//	clientName = first.Name
+	//}
 	m := make(map[string]interface{})
 	m["status"] = params.Status
 	m["project_id"] = params.ProjectId
@@ -329,28 +329,28 @@
 	}
 
 	//鎺ㄩ�佸埌wms
-	wmsProducts := make([]*product_inventory.InventoryProduct, 0)
-	for _, product := range params.Products {
-		var p product_inventory.InventoryProduct
-		p.Id = product.Number
-		p.Amount = product.Amount.String()
-		wmsProducts = append(wmsProducts, &p)
-	}
-	clientWms := product_inventory.NewProductInventoryServiceClient(grpc_init.ProductInventoryServiceConn)
-	_, err = clientWms.CreateOperation(ctx.GetCtx(), &product_inventory.CreateOperationRequest{
-		Number:      params.Number,
-		Addressee:   params.Addressee,
-		Address:     params.Address,
-		Phone:       params.Phone,
-		DeliverType: int32(params.DeliverType),
-		Source:      "CRM",
-		ClientId:    int64(params.ClientId),
-		ClientName:  clientName,
-		ProductList: wmsProducts,
-	})
-	if err != nil {
-		logx.Errorf("grpc CreateOperation err: %v", err.Error())
-	}
+	//wmsProducts := make([]*product_inventory.InventoryProduct, 0)
+	//for _, product := range params.Products {
+	//	var p product_inventory.InventoryProduct
+	//	p.Id = product.Number
+	//	p.Amount = product.Amount.String()
+	//	wmsProducts = append(wmsProducts, &p)
+	//}
+	//clientWms := product_inventory.NewProductInventoryServiceClient(grpc_init.ProductInventoryServiceConn)
+	//_, err = clientWms.CreateOperation(ctx.GetCtx(), &product_inventory.CreateOperationRequest{
+	//	Number:      params.Number,
+	//	Addressee:   params.Addressee,
+	//	Address:     params.Address,
+	//	Phone:       params.Phone,
+	//	DeliverType: int32(params.DeliverType),
+	//	Source:      "CRM",
+	//	ClientId:    int64(params.ClientId),
+	//	ClientName:  clientName,
+	//	ProductList: wmsProducts,
+	//})
+	//if err != nil {
+	//	logx.Errorf("grpc CreateOperation err: %v", err.Error())
+	//}
 
 	//鎺ㄩ�佸埌aps
 	ApsProducts := make([]*crm_aps.SalesDetailsProduct, 0)

--
Gitblit v1.8.0