diff --git a/app/src/androidTest/java/com/mogo/functions/test/AutoPilotBadCaseTest.kt b/app/src/androidTest/java/com/mogo/functions/test/AutoPilotBadCaseTest.kt index a1b7cf49b3..29a8fd3427 100644 --- a/app/src/androidTest/java/com/mogo/functions/test/AutoPilotBadCaseTest.kt +++ b/app/src/androidTest/java/com/mogo/functions/test/AutoPilotBadCaseTest.kt @@ -46,7 +46,7 @@ class AutoPilotBadCaseTest { it.key = "yyy_$index" it.stat = 100 it.type = 1 - it.timestamp = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(Date()) + it.timestamp = SimpleDateFormat("yyyyMMddHHmmss").format(Date()) index++ }) } @@ -77,7 +77,7 @@ class AutoPilotBadCaseTest { it.key = "yyy_$index" it.stat = 100 it.type = 1 - it.timestamp = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(Date()) + it.timestamp = SimpleDateFormat("yyyyMMddHHmmss").format(Date()) index++ }) @@ -108,7 +108,7 @@ class AutoPilotBadCaseTest { it.key = "yyy_$index" it.stat = 100 it.type = 1 - it.timestamp = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(Date()) + it.timestamp = SimpleDateFormat("yyyyMMddHHmmss").format(Date()) index++ }) } diff --git a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt index d236813e85..ca649913ed 100644 --- a/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt +++ b/core/function-impl/mogo-core-function-hmi/src/main/java/com/mogo/eagle/core/function/hmi/ui/MoGoHmiFragment.kt @@ -107,7 +107,7 @@ class MoGoHmiFragment : MvpFragment Log.d("QQQ", "-- step -- 1 --") var oldT = try { old?.timestamp?.takeIf { it.isNotBlank() }?.let { - SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.getDefault()).parse(it)?.time ?: 0L + SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()).parse(it)?.time ?: 0L } ?: 0L } catch (t: Throwable) { t.printStackTrace() @@ -116,7 +116,7 @@ class MoGoHmiFragment : MvpFragment var record: AutoPilotRecordResult? = null var newT = try { it.receive()?.also { record = it }?.timestamp?.takeIf { it.isNotBlank() }?.let { - SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.getDefault()).parse(it)?.time + SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()).parse(it)?.time ?: 0L } ?: 0L } catch (t: Throwable) { @@ -140,7 +140,7 @@ class MoGoHmiFragment : MvpFragment it.receive()?.also { record = it }?.timestamp?.takeIf { it.isNotBlank() }?.let { - SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.getDefault()).parse(it)?.time ?: 0L + SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()).parse(it)?.time ?: 0L } ?: 0L } catch (t: Throwable) { t.printStackTrace() diff --git a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutoPilotRecord.kt b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutoPilotRecord.kt index 6a0dfa92f8..efdb09d327 100644 --- a/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutoPilotRecord.kt +++ b/core/mogo-core-data/src/main/java/com/mogo/eagle/core/data/autopilot/AutoPilotRecord.kt @@ -63,7 +63,7 @@ class AutoPilotRecordResult { * 时间戳,格式:YYYY-MM-DD-hh-mm-ss */ @PrimaryKey - var timestamp: String = SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.getDefault()).format(Date()) + var timestamp: String = SimpleDateFormat("yyyyMMddHHmmss", Locale.getDefault()).format(Date()) /** * 此次采集数据总大小(M)