From 57b3b0851b2144073522a43640c2acc9452e1719 Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期三, 30 十月 2019 14:52:34 +0800
Subject: [PATCH] 新增接口: 1. 获取车辆轨迹

---
 src/main/kotlin/com/flightfeather/obd/repository/impl/DataStreamDaoImpl.kt |   29 ++---------------------------
 1 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/src/main/kotlin/com/flightfeather/obd/repository/impl/DataStreamDaoImpl.kt b/src/main/kotlin/com/flightfeather/obd/repository/impl/DataStreamDaoImpl.kt
index 9fcd476..dfe8583 100644
--- a/src/main/kotlin/com/flightfeather/obd/repository/impl/DataStreamDaoImpl.kt
+++ b/src/main/kotlin/com/flightfeather/obd/repository/impl/DataStreamDaoImpl.kt
@@ -16,6 +16,7 @@
 import org.springframework.stereotype.Repository
 import tk.mybatis.mapper.entity.Example
 import java.text.SimpleDateFormat
+import java.util.*
 
 /**
  * @author riku
@@ -120,7 +121,7 @@
     }
 
     override fun getDataStreamCount(deviceCode: String, startTime: String?, endTime: String?): Int {
-        val sf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
+        val sf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.CHINA)
         val example = Example(DataStream::class.java).apply {
             createCriteria().andEqualTo("obdDeviceCode", deviceCode).run {
                 startTime?.let {
@@ -144,32 +145,6 @@
         }
 
         return dataStreamMapper.selectCountByExample(example)
-    }
-
-    override fun getCoordinate(deviceCode: String): LatLngVo {
-        val example = Example(DataStream::class.java).apply {
-            createCriteria().andEqualTo("obdDeviceCode", deviceCode).run {
-                orderBy("obdDataTime").desc()
-            }
-        }
-
-        //鑾峰彇鏈�鏂扮殑涓�涓�
-        PageHelper.offsetPage<DataStream>(0, 1)
-        val result = dataStreamMapper.selectByExample(example)
-
-        val latLngVo = LatLngVo()
-        if (result.isNotEmpty()) {
-            result[0].let {
-                latLngVo.apply {
-                    this.deviceCode = it.obdDeviceCode
-                    obdDataTime = it.obdDataTime
-                    lat = it.obdLat
-                    lng = it.obdLong
-                }
-            }
-        }
-
-        return latLngVo
     }
 
     override fun getLatestDataStream(deviceCode: String): DataStream? {

--
Gitblit v1.9.3