cloudroam
2025-03-03 4cb9946eff3626389ae93feef4250dd3d45fb694
app/src/main/java/com/example/firstapp/receiver/SmsReceiver.kt
@@ -82,10 +82,10 @@
                            val date = Date.from(currentTime.atZone(ZoneId.systemDefault()).toInstant())
                            // 如果需要格式化显示
                            val sdf = SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.getDefault())
                            val overtime = sdf.format(date)
                            val existingCode = Core.code.queryByTypeAndCodeAndDate(rule.content, code, overtime)
                            val createtime = sdf.format(date)
                            val existingCode = Core.code.queryByTypeAndCodeAndDate(rule.content, code, createtime)
                            if (existingCode == null) {
                                val code = Code(0, rule.type, 1, rule.content, 1, 1, msgId, code, overtime, "中通")
                                val code = Code(0, rule.type, 1, rule.content, 1, 1, msgId, code, createtime, "中通",0)
                                Core.code.insert(code)
                                Log.d("SMS_DEBUG", "新短信已保存到数据库")