Commit d3adc875 by 龚榕城

强转修改

parent 101f8a18
package com.makeit.service.platform.elder.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
......@@ -306,7 +307,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
JSONObject result = JSON.parseObject(entity);
JSONObject properties = (JSONObject)result.get("properties");
Object track = properties.get("track");
List<Double> list = track == null ? Lists.newArrayList() : (List<Double>) track;
List<Double> list = track == null ? Lists.newArrayList() : JSONUtil.toList(JSONUtil.parseArray(track),Double.class);
vo.setX(CollectionUtils.isNotEmpty(list) ? list.get(1) : null);
vo.setY(CollectionUtils.isNotEmpty(list) ? list.get(2) : null);
int personState = properties.getInteger("personState");
......@@ -508,7 +509,7 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
vo.setDeviceId(platDevice.getId());
vo.setOriDeviceId(platDevice.getOriDeviceId());
Object track = jsonObject.get("track");
vo.setTrack((track == null ? Lists.newArrayList() : (List<Double>) track));
vo.setTrack((track == null ? Lists.newArrayList() : JSONUtil.toList(JSONUtil.parseArray(track),Double.class)));
vo.setPersonState(Integer.valueOf(jsonObject.getString("personState")));
vo.setMount(Integer.valueOf(jsonObject.getString("mount")));
vo.setType(2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment