From 16fd3076723f820aa079ff2863f7ab054ab4d0a1 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期二, 19 三月 2024 12:01:44 +0800
Subject: [PATCH] fix空指针
---
service/operation.go | 3 +++
proto/product_inventory/server.go | 3 +++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/proto/product_inventory/server.go b/proto/product_inventory/server.go
index 274d478..70fdaa1 100644
--- a/proto/product_inventory/server.go
+++ b/proto/product_inventory/server.go
@@ -435,6 +435,9 @@
} else {
locationSendAmount = productAmount
}
+ if locationSendAmount.LessThanOrEqual(decimal.Zero) {
+ continue
+ }
productInfoList = append(productInfoList, &service.ProductInfo{
ProductID: productNumber,
Amount: locationSendAmount,
diff --git a/service/operation.go b/service/operation.go
index 03ac1e6..e0456d4 100644
--- a/service/operation.go
+++ b/service/operation.go
@@ -45,6 +45,9 @@
FromLocationID: output.LocationID,
})
}
+ if opTypeMap[output.WarehouseID] == nil {
+ continue
+ }
operation := &models.Operation{
Id: 0,
Number: "",
--
Gitblit v1.8.0