|
@@ -184,9 +184,9 @@ public class MqttMsgService {
|
|
|
//计算当前和最近之间时间,若超过1秒,删除之前的存储的,重新计数存储当前的
|
|
|
String lastContent = (String)redisUtil.hget(RedisKeyConstant.PEOPLEEVENT_ACTIVE_INFO,lastIndex + "@" + careDevice.getDevCode() + "_" + tid );
|
|
|
long duration = (date.getTime() - Long.parseLong(lastContent.split("_")[0]));
|
|
|
- logger.debug("lastIndex:{},duration:{}",lastIndex,duration);
|
|
|
+ logger.warn("lastIndex:{},duration:{}",lastIndex,duration);
|
|
|
if (duration > 3000) { //超过1秒,删除之前的存储的,从头开始
|
|
|
- logger.debug("超过3000,lastIndex:{},duration:{}",lastIndex,duration);
|
|
|
+ logger.warn("超过3000,lastIndex:{},duration:{}",lastIndex,duration);
|
|
|
delBeforeContent(lastIndex,careDevice.getDevCode(),tid);
|
|
|
redisUtil.hset(RedisKeyConstant.PEOPLEEVENT_ACTIVE_INFO, 1 + "@" + careDevice.getDevCode() + "_" + tid , System.currentTimeMillis() + "_" + x + "_" + y, RedisKeyConstant.PEOPLEEVENT_ACTIVE_INFO_TIME);
|
|
|
redisUtil.hset(RedisKeyConstant.PEOPLEEVENT_ACTIVE_INFO_LAST_INDEX, careDevice.getDevCode() + "_" + tid , 1 , RedisKeyConstant.PEOPLEEVENT_ACTIVE_INFO_ACTIVE_LAST_INDEX_TIME);
|
|
@@ -198,7 +198,7 @@ public class MqttMsgService {
|
|
|
int currIndex = lastIndex + 1;//当前是第10个或以上 开始计算
|
|
|
//求前5个点平均坐标和后5个点的平均坐标,二者之间的距离即结果
|
|
|
double distance = getDistance(currIndex,careDevice.getDevCode(),tid);
|
|
|
- logger.debug("计算结果:lastIndex:{},duration:{},distance{}",lastIndex,duration,distance);
|
|
|
+ logger.warn("计算结果:lastIndex:{},duration:{},distance{}",lastIndex,duration,distance);
|
|
|
if(distance > 0.3){
|
|
|
moveState = DeviceMoveStateEnum.MOVE.getValue();
|
|
|
//存储行走距离明细表
|