Explorar o código

灭火逻辑修改

xuxiaofei %!s(int64=3) %!d(string=hai) anos
pai
achega
e63454749b

+ 4 - 2
zd-modules/zd-algorithm/src/main/java/com/zd/alg/fire/controller/FireDeviceController.java

@@ -165,8 +165,10 @@ public class FireDeviceController extends BaseController {
             //手动灭火和当前时差
             Long outfireTime = redisService.getCacheObject(ARTIFICIAL_OUT_FILE+list.get(0).getDeviceCode());
             if(StringUtils.isNotNull(outfireTime)){
+                Long fireTimeVal=fireTime;
+                fireTimeVal = fireTimeVal+list.get(0).getDeviceCountDown();
                 timeDifference =    System.currentTimeMillis()-outfireTime;
-                timeDifference = timeDifference/1000;
+                timeDifference = fireTimeVal - (timeDifference/1000);
             }
             //查询该实验室是否存在火焰摄像头报警
             JSONObject fireJson = redisService.getCacheObject(CacheDevice.FIRE_CAMERA_KEY.getRedisKey()+subjectId);
@@ -177,7 +179,7 @@ public class FireDeviceController extends BaseController {
         map.put("smoke", smoke);
         map.put("temperature", temperature);
         map.put("fire", fire);
-        map.put("online", online);
+        map.put("online", true);
         map.put("isexist", isexist);
         map.put("outfireing", outfireing);
         map.put("fireDevice", list.get(0));