From c7e82fd1d76b9fb25497d5aba4372bbfe13a8468 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期四, 28 三月 2024 20:00:21 +0800 Subject: [PATCH] 采购入库增加来源 --- api/v1/purchase/purchase.go | 38 ++++++++++++++++++++------------------ 1 files changed, 20 insertions(+), 18 deletions(-) diff --git a/api/v1/purchase/purchase.go b/api/v1/purchase/purchase.go index aec7d9e..753d8dc 100644 --- a/api/v1/purchase/purchase.go +++ b/api/v1/purchase/purchase.go @@ -260,10 +260,11 @@ } client := purchase_wms.NewPurchaseServiceClient(purchase_wms.PurchaseConn) resp, err := client.PurchaseToWms(context.Background(), &purchase_wms.PurchaseToWmsRequest{ - Number: data.Number, - SupplierName: data.Supplier.Name, - Product: product, - Source: "SRM_PURCHASE", + Number: data.Number, + SupplierName: data.Supplier.Name, + Product: product, + Source: "SRM_PURCHASE", + OperationSource: purchase_wms.OperationSource_OperationSourcePurchase, }) if err != nil { global.GVA_LOG.Error("grpc璋冪敤澶辫触!", zap.Error(err)) @@ -396,11 +397,10 @@ oi.Status = operation.Status oi.Principal = data.Principal oi.WarehouseName = data.Warehouse + oi.SendAmount = operation.Amount if operation.OverTime != "" { oi.OverTime = operation.OverTime oi.OverAmount = operation.Amount - } else { - oi.SendAmount = operation.Amount } for _, products := range productList { if products.Product.Number == operation.ProductId { @@ -647,12 +647,13 @@ } client := purchase_wms.NewPurchaseServiceClient(purchase_wms.PurchaseConn) _, err = client.PurchaseToWms(context.Background(), &purchase_wms.PurchaseToWmsRequest{ - Number: purchaseData.Number, - SupplierName: purchaseData.Supplier.Name, - SupplierId: int64(purchaseData.SupplierId), - Product: product, - Source: "SRM_PURCHASE", - WarehouseName: purchaseData.Warehouse, + Number: purchaseData.Number, + SupplierName: purchaseData.Supplier.Name, + SupplierId: int64(purchaseData.SupplierId), + Product: product, + Source: "SRM_PURCHASE", + WarehouseName: purchaseData.Warehouse, + OperationSource: purchase_wms.OperationSource_OperationSourcePurchase, }) if err != nil { global.GVA_LOG.Error("grpc璋冪敤澶辫触!", zap.Error(err)) @@ -729,12 +730,13 @@ } client := purchase_wms.NewPurchaseServiceClient(purchase_wms.PurchaseConn) _, err = client.PurchaseToWms(context.Background(), &purchase_wms.PurchaseToWmsRequest{ - Number: purchaseData.Number, - SupplierName: purchaseData.Supplier.Name, - SupplierId: int64(purchaseData.SupplierId), - Product: product, - Source: "SRM_PURCHASE", - WarehouseName: purchaseData.Warehouse, + Number: purchaseData.Number, + SupplierName: purchaseData.Supplier.Name, + SupplierId: int64(purchaseData.SupplierId), + Product: product, + Source: "SRM_PURCHASE", + WarehouseName: purchaseData.Warehouse, + OperationSource: purchase_wms.OperationSource_OperationSourcePurchase, }) if err != nil { global.GVA_LOG.Error("grpc璋冪敤澶辫触!", zap.Error(err)) -- Gitblit v1.8.0