|
|
|
@ -80,23 +80,23 @@ public class CronTab {
|
|
|
|
lightTimeMap.put(streetId,System.currentTimeMillis());
|
|
|
|
lightTimeMap.put(streetId,System.currentTimeMillis());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Scheduled(cron = "0 0/1 * * * ?")
|
|
|
|
// @Scheduled(cron = "0 0/1 * * * ?")
|
|
|
|
public void lightStatus() {
|
|
|
|
// public void lightStatus() {
|
|
|
|
log.debug(" lightStatus");
|
|
|
|
// log.debug(" lightStatus");
|
|
|
|
long timeStamp = System.currentTimeMillis();
|
|
|
|
// long timeStamp = System.currentTimeMillis();
|
|
|
|
|
|
|
|
//
|
|
|
|
Iterator<Map.Entry<Integer, Long>> it = lightTimeMap.entrySet().iterator();
|
|
|
|
// Iterator<Map.Entry<Integer, Long>> it = lightTimeMap.entrySet().iterator();
|
|
|
|
while (it.hasNext()){
|
|
|
|
// while (it.hasNext()){
|
|
|
|
Map.Entry<Integer, Long> entry = it.next();
|
|
|
|
// Map.Entry<Integer, Long> entry = it.next();
|
|
|
|
if((BigInteger.valueOf(timeStamp).subtract(BigInteger.valueOf(entry.getValue()))).compareTo(timeDIff) > 0){
|
|
|
|
// if((BigInteger.valueOf(timeStamp).subtract(BigInteger.valueOf(entry.getValue()))).compareTo(timeDIff) > 0){
|
|
|
|
List<LightSource> lightSources = lightSourceMapper.selectList(new QueryWrapper<LightSource>().eq("street_id",entry.getKey()));
|
|
|
|
// List<LightSource> lightSources = lightSourceMapper.selectList(new QueryWrapper<LightSource>().eq("street_id",entry.getKey()));
|
|
|
|
lightSources.forEach(lightSource -> {
|
|
|
|
// lightSources.forEach(lightSource -> {
|
|
|
|
lightSourceService.controllerLightSource(lightSource,0);
|
|
|
|
// lightSourceService.controllerLightSource(lightSource,0);
|
|
|
|
});
|
|
|
|
// });
|
|
|
|
it.remove();
|
|
|
|
// it.remove();
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void checkFileTime(File dir,int days) {
|
|
|
|
public static void checkFileTime(File dir,int days) {
|
|
|
|
|