Commit 0966861c authored by 高建强's avatar 高建强

item:修改启停间隔,redis数据失效统计bug

parent e996f7ee
...@@ -547,7 +547,7 @@ public class EmergencyServiceImpl implements IEmergencyService { ...@@ -547,7 +547,7 @@ public class EmergencyServiceImpl implements IEmergencyService {
} }
} }
} catch (Exception e) { } catch (Exception e) {
log.error("getPressurePumpStatusChart-->获取稳压泵启停状态图失败:{}", e.getMessage()); log.error("getPressurePumpStatusDetailChart-->获取稳压泵启停状态图失败:{}", e.getMessage());
} }
return map; return map;
} }
......
...@@ -60,25 +60,25 @@ public class PressurePumpServiceImpl implements IPressurePumpService { ...@@ -60,25 +60,25 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
// 获取公司顶级bizOrgCode // 获取公司顶级bizOrgCode
bizOrgCode = getCompanyBizOrgCode(bizOrgCode); bizOrgCode = getCompanyBizOrgCode(bizOrgCode);
if (StringUtils.isNotBlank(bizOrgCode)) { if (StringUtils.isNotBlank(bizOrgCode)) {
String pressurePumpValue = PressurePumpRelateEnum.PRESSURE_PUMP.getValue(); String pressurePumpValue = PressurePumpRelateEnum.PRESSURE_PUMP.getValue();
// 获取配置JSON信息集合 // 获取配置JSON信息集合
List<Map> list = getNameKeyInfoList(pressurePumpValue); List<Map> list = getNameKeyInfoList(pressurePumpValue);
if (CollectionUtils.isNotEmpty(list) && StringUtils.isNotBlank(iotCode) && StringUtils.isNotBlank(bizOrgCode)) { if (CollectionUtils.isNotEmpty(list) && StringUtils.isNotBlank(iotCode) && StringUtils.isNotBlank(bizOrgCode)) {
Map map = list.get(0); Map map = list.get(0);
String nameKey = map.get("nameKey").toString(); String nameKey = map.get("nameKey").toString();
int expire = Integer.parseInt(map.get("expire").toString()); int expire = Integer.parseInt(map.get("expire").toString());
String nowString = DateUtils.getDateNowString(); String nowString = DateUtils.getDateNowString();
long timeMillis = System.currentTimeMillis(); long timeMillis = System.currentTimeMillis();
for (IotDataVO vo : iotDatalist) { for (IotDataVO vo : iotDatalist) {
String key = vo.getKey(); String key = vo.getKey();
if (nameKey.contains(vo.getKey())) { if (nameKey.contains(vo.getKey())) {
vo.setCreatedTime(nowString); vo.setCreatedTime(nowString);
redisUtils.set(String.join(":", pressurePumpValue, bizOrgCode, key, iotCode, String.valueOf(timeMillis)), JSON.toJSONString(vo), expire); redisUtils.set(String.join(":", pressurePumpValue, bizOrgCode, key, iotCode, String.valueOf(timeMillis)), JSON.toJSONString(vo), expire);
}
} }
} }
} }
} }
}
@Override @Override
public String getCompanyBizOrgCode(String bizOrgCode) { public String getCompanyBizOrgCode(String bizOrgCode) {
...@@ -198,7 +198,7 @@ public class PressurePumpServiceImpl implements IPressurePumpService { ...@@ -198,7 +198,7 @@ public class PressurePumpServiceImpl implements IPressurePumpService {
dataList = getIotData(pumpInfoList, top, nameKey); dataList = getIotData(pumpInfoList, top, nameKey);
} }
} else { } else {
if (ObjectUtils.isEmpty(dataList) || ObjectUtils.isEmpty(dataListFilterTrue) || ObjectUtils.isEmpty(dataListFilterFalse)) { if (ObjectUtils.isEmpty(dataList) || ObjectUtils.isEmpty(dataListFilterTrue) || ObjectUtils.isEmpty(dataListFilterFalse) || dataListFilterTrue.size() < 2) {
dataList = getIotData(pumpInfoList, top, nameKey); dataList = getIotData(pumpInfoList, top, nameKey);
dataListFilterTrue = getDataListFilter(dataList, PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue()); dataListFilterTrue = getDataListFilter(dataList, PressurePumpRelateEnum.IOT_INDEX_VALUE_TRUE.getValue());
dataListFilterFalse = getDataListFilter(dataList, PressurePumpRelateEnum.IOT_INDEX_VALUE_FALSE.getValue()); dataListFilterFalse = getDataListFilter(dataList, PressurePumpRelateEnum.IOT_INDEX_VALUE_FALSE.getValue());
......
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