Commit b3fa5b7b authored by xixinzhao's avatar xixinzhao

稳压泵最近启停时间bug

parent c9dc5b57
......@@ -151,9 +151,10 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
pressurePumpInfo = fireFightingSystemMapper.getPressurePumpInfo(page, bizOrgCode, null);
String prefix = null;
// 获取redis稳压泵缓存数据,默认JSON配置最近4小时
List<IotDataVO> DataList = pressurePumpService.getDataToRedis(PressurePumpRelateEnum.PRESSURE_PUMP.getValue(), pressurePumpStart, null, bizOrgCode);
//List<IotDataVO> DataList = pressurePumpService.getDataToRedis(PressurePumpRelateEnum.PRESSURE_PUMP.getValue(), pressurePumpStart, null, bizOrgCode);
List<IotDataVO> dateList2 = new ArrayList<>();
for (Map<String, Object> item : pressurePumpInfo.getRecords()) {
String suffix = null;
String iotCode = item.get("iot_code").toString();
if (iotCode.length() > 8) {
......@@ -212,9 +213,8 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
item.put("equipment_index_name", "无信号");
item.put("update_time", false);
}
if(CollectionUtils.isEmpty(DataList)){
//从influxdb中获取最近一次启停间隔
List<Map<String, String>> iotDataList = pressurePumpService.getIotTopSingleField(top, prefix, null, null, pressurePumpStart);
List<Map<String, String>> iotDataList = pressurePumpService.getIotTopSingleField(top, prefix, suffix, null, pressurePumpStart);
iotDataList.forEach(e -> {
try {
IotDataVO iotDataVO = (IotDataVO) pressurePumpService.mapToObject(e, IotDataVO.class, pressurePumpStart);
......@@ -223,11 +223,12 @@ public class SupervisionVideoServiceImpl extends ServiceImpl<SupervisionVideoMap
throw new RuntimeException();
}
});
}
//稳压泵当前状态 无告警并且启动时长小于5分钟为正常
// item.put("stateDesc", Integer.parseInt(String.valueOf(item.get("isAlarm"))) == 0 && time ? PressurePumpRelateEnum.PIPE_PRESSURE_NORMAL_STATUS.getValue() : PressurePumpRelateEnum.PIPE_PRESSURE_ABNORMAL_STATUS.getValue());
}
interval =pressurePumpService.getAllPressurePumpStartStopInterval(dateList2, dataListFilterTrue, dataListFilterFalse, nowStrLong);
double finalDiffMinute = (double) interval;
pressurePumpInfo.getRecords().stream(
).map(item -> {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment