Commit fa770d13 by 罗志长

fix: 实时状态

parent af5e1a57
package com.makeit.service.platform.elder.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.google.common.collect.Lists;
......@@ -305,8 +306,8 @@ public class PlatElderRealTimeServiceImpl implements PlatElderRealTimeService {
PlatElderCoordinateVO vo = new PlatElderCoordinateVO();
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;
JSONArray tracks = properties.getJSONArray("track");
List<Double> list = tracks == null ? Lists.newArrayList() : tracks.stream().mapToDouble(a -> Double.parseDouble(a.toString())).boxed().collect(Collectors.toList());
vo.setX(CollectionUtils.isNotEmpty(list) ? list.get(1) : null);
vo.setY(CollectionUtils.isNotEmpty(list) ? list.get(2) : null);
int personState = properties.getInteger("personState");
......
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