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