From 785488877e2583a81e0a08e35330bcd0d8b77702 Mon Sep 17 00:00:00 2001
From: zhangzengfei <zhangzengfei@smartai.com>
Date: 星期四, 17 八月 2023 15:57:34 +0800
Subject: [PATCH] 修复bug

---
 report/send.go |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/report/send.go b/report/send.go
index 35a6311..9068701 100644
--- a/report/send.go
+++ b/report/send.go
@@ -2,7 +2,6 @@
 
 import (
 	"encoding/json"
-	"io/ioutil"
 	"time"
 
 	"kingdee-dbapi/cache"
@@ -182,21 +181,19 @@
 		}
 
 		// 缁檅om娣诲姞缁勪欢
-		for _, bom := range bomList {
-			bom.Component = bomChildMap[bom.FInterID]
+		for idx, bom := range bomList {
+			bomList[idx].Component = bomChildMap[bom.FInterID]
 		}
 
-		// 姣忔鍙� 1000 鏉�
+		// 姣忔鍙� 200 鏉�
 		successCnt := 0
-		for i := 0; i < len(bomList); i += 1000 {
-			end := i + 1000
+		for i := 0; i < len(bomList); i += 200 {
+			end := i + 200
 			if end > len(bomList) {
 				end = len(bomList)
 			}
 
 			b, _ := json.Marshal(bomList[i:end])
-
-			ioutil.WriteFile("bomList.tmp", b, 0644)
 
 			ok := nsqclient.Produce(config.Options.BomTopic, b)
 			if !ok {

--
Gitblit v1.8.0