Parcourir la source

关机无记录数据2

bzd_lkh il y a 1 mois
Parent
commit
59b44cd0a2
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  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)