Commit 384f36ff by 杨林龙

1.7.0 开发区域查车ICE调用接口-- 过滤定位查询经纬度为0 的定位

1 parent 7285d6af
......@@ -82,8 +82,9 @@ public class HdaoGpsComponent {
// 1:ok for part, the succesful part of device info is followed...
// -1:failed, the followed gpsDevInfo is meaningless...
log.info("getDevicesGpsInfoBatch invoker ice getDevicesGpsInfo result:" + res.value.batchResult + " reqSn:" + Arrays.toString(snArray));
log.info("res.value.gpsDevInfos===" + JSONUtil.toJsonStr(res.value.gpsDevInfos));
List<GpsDevInfo> trackModels = Arrays.asList(res.value.gpsDevInfos);
log.info("trackModels===" + JSONUtil.toJsonStr(trackModels));
dataGpsLocationList = DataLocationConvert.convertIceListToGpsLocation(trackModels);
}
} catch (Exception e) {
......
......@@ -65,6 +65,9 @@ public class DataLocationConvert {
if (gpsDevInfo.record == null) {
continue;
}
if (gpsDevInfo.record.lng == 0 && gpsDevInfo.record.lat == 0) {
continue;
}
DataGpsLocation dataGpsLocation = new DataGpsLocation();
dataGpsLocation.setSn(String.valueOf(gpsDevInfo.userID));
......
......@@ -12,6 +12,7 @@ import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.util.CollectionUtils;
import java.util.List;
......@@ -43,8 +44,11 @@ class HdaoGpsComponentTest {
@Test
public void testGetDevicesGpsInfoBatch() {
List<DataGpsLocation> devicesGpsInfoBatch = hdaoGpsComponent.getDevicesGpsInfoBatch(Lists.newArrayList("1591127955"));
List<DataGpsLocation> devicesGpsInfoBatch = hdaoGpsComponent.getDevicesGpsInfoBatch(Lists.newArrayList("1611088776"));
System.out.println("devicesGpsInfoBatch = " + JSONUtil.toJsonStr(devicesGpsInfoBatch));
if (CollectionUtils.isEmpty(devicesGpsInfoBatch)) {
System.out.println("true");
}
}
}
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!