|
@ -127,13 +127,13 @@ func toEsRaw(deviceData *models.DeviceData) *models.EsRaw { |
|
|
if deviceData == nil { |
|
|
if deviceData == nil { |
|
|
return nil |
|
|
return nil |
|
|
} |
|
|
} |
|
|
|
|
|
var cstZone = time.FixedZone("CST", 8*3600) // 东八区 用以解决
|
|
|
dataOutMeta := deviceData.DeviceInfo.DeviceMeta.GetOutputProps() |
|
|
dataOutMeta := deviceData.DeviceInfo.DeviceMeta.GetOutputProps() |
|
|
createNativeRaw := models.EsRaw{ |
|
|
createNativeRaw := models.EsRaw{ |
|
|
StructId: deviceData.StructId, |
|
|
StructId: deviceData.StructId, |
|
|
IotaDeviceName: deviceData.Name, |
|
|
IotaDeviceName: deviceData.Name, |
|
|
Data: deviceData.Raw, |
|
|
Data: deviceData.Raw, |
|
|
CollectTime: deviceData.AcqTime.Format("2006-01-02T15:04:05.000+0800"), |
|
|
CollectTime: deviceData.AcqTime.In(cstZone).Format("2006-01-02T15:04:05.000+0800"), |
|
|
Meta: dataOutMeta, |
|
|
Meta: dataOutMeta, |
|
|
IotaDevice: deviceData.DeviceId, |
|
|
IotaDevice: deviceData.DeviceId, |
|
|
CreateTime: time.Now(), |
|
|
CreateTime: time.Now(), |
|
|