亳州位置汇聚首页统计修改
parent
638c54684f
commit
3c85d5950d
|
|
@ -52,6 +52,7 @@
|
|||
select indexcode deviceCode,'5' deviceType, longitude lng, latitude lat,to_timestamp(updatatime, 'YYYY-MM-DD HH24:MI:SS') gpsTime from public.mobileposition_view
|
||||
<where>
|
||||
<if test="gpsTime != null "> and to_timestamp(updatatime, 'YYYY-MM-DD HH24:MI:SS') > #{gpsTime} </if>
|
||||
and to_timestamp(updatatime, 'YYYY-MM-DD HH24:MI:SS') <= now()
|
||||
</where>
|
||||
order by updatatime desc
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ package org.dromara.system.controller.system;
|
|||
import cn.hutool.core.date.DateUtil;
|
||||
import jdk.dynalink.linker.LinkerServices;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.redis.utils.RedisUtils;
|
||||
|
|
@ -24,6 +25,7 @@ import java.util.*;
|
|||
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@Slf4j
|
||||
public class IndexStaticsController extends BaseController {
|
||||
|
||||
private final ISysDeptService deptService;
|
||||
|
|
@ -90,7 +92,7 @@ public class IndexStaticsController extends BaseController {
|
|||
/*
|
||||
* 通过ES来监听各类设备定位是否正常
|
||||
* */
|
||||
@Scheduled(cron = "0 */30 * * * ?")
|
||||
// @Scheduled(cron = "0 */30 * * * ?")
|
||||
public void listen(){
|
||||
List<String> strs = elasticSearchService.linstenDataStatus();
|
||||
if (strs.size() >0){
|
||||
|
|
@ -105,8 +107,9 @@ public class IndexStaticsController extends BaseController {
|
|||
noticeService.insertNotice(noticeBo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* 各地市总数和在线数
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class DeviceRedisSchedule {
|
|||
/*
|
||||
* 把Redis中 online_user数据存入t_device_redis表中
|
||||
* */
|
||||
@Scheduled(cron = "0/30 * * * * ?")
|
||||
// @Scheduled(cron = "0/30 * * * * ?")
|
||||
public void handleDeviceRedis(){
|
||||
List<JSONObject> jlist = RedisUtils.searchAndGetKeysValues("online_users:*");
|
||||
redisService.insertBatch(BeanUtil.copyToList(jlist, DeviceRedis.class));
|
||||
|
|
@ -81,7 +81,7 @@ public class DeviceRedisSchedule {
|
|||
/*
|
||||
* 定时删除设备状态为删除的定位信息和在线表
|
||||
* */
|
||||
// @Scheduled(cron = "0 0 0/1 * * ?")
|
||||
@Scheduled(cron = "0 0 0/1 * * ?")
|
||||
public void removeRedis(){
|
||||
deviceService.deleteRedis();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue