From 28addaa46cb97c20ad37e13eb10535de7b75e71c Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 29 十一月 2023 19:29:43 +0800 Subject: [PATCH] 首次报工开始时间为工序开始时间 --- main.go | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 3bc397c..39420ab 100644 --- a/main.go +++ b/main.go @@ -11,10 +11,10 @@ "apsClient/router" "apsClient/serf" "apsClient/service" - "apsClient/service/plc_address" "fmt" "log" "net/http" + _ "net/http/pprof" "time" ) @@ -29,7 +29,7 @@ } //鍔犺浇plc鍐欏叆鍦板潃 - plc_address.LoadAddressFromFile() + //plc_address.LoadAddressFromFile() // 鍚姩鏁版嵁鍚屾 var serfStartChan = make(chan bool) @@ -43,6 +43,10 @@ "task_status_sync", "device", "device_plc", + "system_status", + "process_model_plc_address", + "reports_to_cloud", + "report_work", } agent := serf.InitAgent("apsClient", syncTables, sqlitex.GetDB()) @@ -55,12 +59,16 @@ } //浠庢枃浠堕噷璇诲彇褰撳墠鐢熶骇璁惧id鑾峰彇璁惧鍒楄〃绗竴涓� - err := service.InitCurrentDeviceID() + err := service.InitCurrentDeviceID(serf.Vasystem.ServerID) if err != nil { logx.Errorf("InitCurrentDeviceID error: %v, exit", err) return } + go func() { + service.ReportsSystemDeviceToCloud(serf.Vasystem.ServerID) + }() + // 鍒ゆ柇褰撳墠闆嗙兢鐘舵�� logx.Infof("current agent.ClusterStatus:%v", agent.ClusterStatus) log.Println("current agent.ClusterStatus:", agent.ClusterStatus) -- Gitblit v1.8.0