Commit 06c8b915 by 毛树良

<fix>:设备数据缓存逻辑优化

1 parent 51ac3ca7
...@@ -34,7 +34,18 @@ public class DataCacheScheduled implements CommandLineRunner { ...@@ -34,7 +34,18 @@ public class DataCacheScheduled implements CommandLineRunner {
private void updateDeviceTollgateCache() { private void updateDeviceTollgateCache() {
log.info("开始更新设备与卡口关系缓存数据"); log.info("开始更新设备与卡口关系缓存数据");
//查询 //查询
int offset = 0; LaneModel laneQry = new LaneModel();
List<LaneModel> laneModels = trafficEventService.selectLaneDatas(laneQry);
if (!CollectionUtils.isEmpty(laneModels)) {
for (LaneModel laneModel : laneModels) {
try {
deviceTollgateMap.put(laneModel.getApeID(), laneModel.getTollgateID());
} catch (Exception e) {
log.error("deviceTollgateMap.put Exception", e);
}
}
}
/*int offset = 0;
int limit = 50; int limit = 50;
int selectSize = 0; int selectSize = 0;
int num = 0; int num = 0;
...@@ -55,7 +66,7 @@ public class DataCacheScheduled implements CommandLineRunner { ...@@ -55,7 +66,7 @@ public class DataCacheScheduled implements CommandLineRunner {
} }
} }
} }
} while (selectSize >= limit); } while (selectSize >= limit);*/
log.info("结束更新设备与卡口关系缓存,共更新{}条", deviceTollgateMap.size()); log.info("结束更新设备与卡口关系缓存,共更新{}条", deviceTollgateMap.size());
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!