...
|
...
|
@@ -57,15 +57,14 @@ func (deviceDailyRunningRecord *DeviceDailyRunningRecord) AddDeviceRunningData(d |
|
|
t := data.CollectionTime
|
|
|
deviceDailyRunningRecord.DeviceRunningRecordInfo.AddDeviceRunningData(t, data)
|
|
|
now := time.Now().Unix()
|
|
|
if ok, _ := data.Valid(); !ok {
|
|
|
return false
|
|
|
}
|
|
|
ts := t.Local().Unix()
|
|
|
deviceDailyRunningRecord.UpdatedAt = time.Now()
|
|
|
if ts > (now-DefaultCollectionTimeSpan) && ts < (now+DefaultCollectionTimeSpan) {
|
|
|
deviceDailyRunningRecord.UpdatedAt = t
|
|
|
return true
|
|
|
}
|
|
|
deviceDailyRunningRecord.UpdatedAt = time.Now()
|
|
|
if ok, _ := data.Valid(); !ok {
|
|
|
return false
|
|
|
}
|
|
|
return true
|
|
|
}
|
|
|
|
...
|
...
|
|