Procházet zdrojové kódy

关机无记录数据2

bzd_lkh před 1 měsícem
rodič
revize
59b44cd0a2
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  1. 2 1
      MqttServer/MqttClients.go

+ 2 - 1
MqttServer/MqttClients.go

@@ -8,6 +8,7 @@ import (
 	"Cold_mqtt/models/Device"
 	"Cold_mqtt/models/Warning"
 	"encoding/json"
+	"strconv"
 	"strings"
 	"time"
 )
@@ -190,7 +191,7 @@ func MessageDisconnected(topicName string, message []byte) {
 			DeviceSensorList := Device.Read_DeviceSensor_ByTsn(r_Device.T_sn)
 			logs.Println("DeviceSensorList:", DeviceSensorList)
 			for _, v := range DeviceSensorList {
-				DeviceData_t, is := Device.RedisDeviceData_Get(r_Device.T_sn+"_Redis", v.T_id)
+				DeviceData_t, is := Device.RedisDeviceData_Get(r_Device.T_sn+"_Redis|"+strconv.Itoa(v.T_id), v.T_id)
 				logs.Println("DeviceData_t is:", is)
 				if is {
 					Device.Add_DeviceData(r_Device.T_sn, v.T_id, DeviceData_t, true)