作者 yangfu

fix: 车间产能统计修改 、 温度保留精度

@@ -57,15 +57,14 @@ func (deviceDailyRunningRecord *DeviceDailyRunningRecord) AddDeviceRunningData(d @@ -57,15 +57,14 @@ func (deviceDailyRunningRecord *DeviceDailyRunningRecord) AddDeviceRunningData(d
57 t := data.CollectionTime 57 t := data.CollectionTime
58 deviceDailyRunningRecord.DeviceRunningRecordInfo.AddDeviceRunningData(t, data) 58 deviceDailyRunningRecord.DeviceRunningRecordInfo.AddDeviceRunningData(t, data)
59 now := time.Now().Unix() 59 now := time.Now().Unix()
60 - if ok, _ := data.Valid(); !ok {  
61 - return false  
62 - }  
63 ts := t.Local().Unix() 60 ts := t.Local().Unix()
  61 + deviceDailyRunningRecord.UpdatedAt = time.Now()
64 if ts > (now-DefaultCollectionTimeSpan) && ts < (now+DefaultCollectionTimeSpan) { 62 if ts > (now-DefaultCollectionTimeSpan) && ts < (now+DefaultCollectionTimeSpan) {
65 deviceDailyRunningRecord.UpdatedAt = t 63 deviceDailyRunningRecord.UpdatedAt = t
66 - return true  
67 } 64 }
68 - deviceDailyRunningRecord.UpdatedAt = time.Now() 65 + if ok, _ := data.Valid(); !ok {
  66 + return false
  67 + }
69 return true 68 return true
70 } 69 }
71 70