From f008bf77342a93c13d1e42399dd175c9c941d3ef Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 03 十一月 2023 21:05:16 +0800
Subject: [PATCH] 工艺参数地址表从文件里获取改成从数据库查询

---
 main.go |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/main.go b/main.go
index b1a14d7..8393009 100644
--- a/main.go
+++ b/main.go
@@ -11,7 +11,6 @@
 	"apsClient/router"
 	"apsClient/serf"
 	"apsClient/service"
-	"apsClient/service/plc_address"
 	"fmt"
 	"log"
 	"net/http"
@@ -29,7 +28,7 @@
 	}
 
 	//鍔犺浇plc鍐欏叆鍦板潃
-	plc_address.LoadAddressFromFile()
+	//plc_address.LoadAddressFromFile()
 
 	// 鍚姩鏁版嵁鍚屾
 	var serfStartChan = make(chan bool)
@@ -43,6 +42,7 @@
 		"task_status_sync",
 		"device",
 		"device_plc",
+		"system_status",
 	}
 
 	agent := serf.InitAgent("apsClient", syncTables, sqlitex.GetDB())
@@ -54,10 +54,11 @@
 		return
 	}
 
-	//浠庢枃浠堕噷璇诲彇褰撳墠鐢熶骇璁惧id
-	conf.Conf.CurrentDeviceID = service.ReadDeviceIDFromFile()
-	if conf.Conf.CurrentDeviceID == "" {
-		conf.Conf.CurrentDeviceID = conf.Conf.System.DeviceId
+	//浠庢枃浠堕噷璇诲彇褰撳墠鐢熶骇璁惧id鑾峰彇璁惧鍒楄〃绗竴涓�
+	err := service.InitCurrentDeviceID()
+	if err != nil {
+		logx.Errorf("InitCurrentDeviceID error: %v, exit", err)
+		return
 	}
 
 	// 鍒ゆ柇褰撳墠闆嗙兢鐘舵��

--
Gitblit v1.8.0