Browse Source

#增加Json转换

zhongwei
yang_shj 10 months ago
parent
commit
0152c5791c
  1. 2
      hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java
  2. 8
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

2
hzims-service/hzims-scheduled/src/main/java/com/hnac/hzims/scheduled/service/operation/monitor/impl/MonitorServiceImpl.java

@ -344,7 +344,7 @@ public class MonitorServiceImpl implements MonitorService {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
} }
pool.shutdown(); pool.shutdown();
redisTemplate.opsForValue().set(moniter_station_cache_final, JSONObject.toJSONString(stationList)); redisTemplate.opsForValue().set(moniter_station_cache_final, stationList);
} }
/** /**

8
hzims-service/operational/src/main/java/com/hnac/hzims/operational/station/service/impl/RealMonitorServiceImpl.java

@ -467,7 +467,7 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
} }
pool.shutdown(); pool.shutdown();
log.info(thread.getName() + "步骤12所有线程完成 耗时 : {}",System.currentTimeMillis() - beginTime); log.info(thread.getName() + "步骤12所有线程完成 耗时 : {}",System.currentTimeMillis() - beginTime);
redisTemplate.opsForValue().set(moniter_station_key, stationList); redisTemplate.opsForValue().set(moniter_station_key, JSONObject.toJSONString(stationList));
} }
/** /**
@ -851,12 +851,10 @@ public class RealMonitorServiceImpl implements IRealMonitorService {
if(ObjectUtil.isEmpty(message) || CollectionUtil.isEmpty(message.getDeptIds())){ if(ObjectUtil.isEmpty(message) || CollectionUtil.isEmpty(message.getDeptIds())){
return null; return null;
} }
Object json = redisTemplate.opsForValue().get(moniter_station_key); List<RealStationVo> realStationVoList = (List<RealStationVo>) redisTemplate.opsForValue().get(moniter_station_key);
if(ObjectUtil.isEmpty(json)){ if(ObjectUtil.isEmpty(realStationVoList)){
return null; return null;
} }
// 获取所有监控缓存数据
List<RealStationVo> realStationVoList = JSONObject.parseObject(json.toString(),new TypeReference<List<RealStationVo>>() {});
if(CollectionUtil.isEmpty(realStationVoList)){ if(CollectionUtil.isEmpty(realStationVoList)){
return null; return null;
} }

Loading…
Cancel
Save