From f67cf3b81a00f732ca743431258ae6b78f5f40ab Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期四, 17 四月 2025 15:05:28 +0800
Subject: [PATCH] 11、我的 切换头像 点击切换头像没有显示允许存储权限的窗口,华为的手机目前有 49、首页 实时刷新 点击全部取件或其他分类后,回到上一层,内容没有刷新(5个分类) 52、数据统计 数据统计 1.周月年的柱状图统计逻辑需要修改为只统计快递类的数据 2.按年的图形统计,右下方加上图示说明 53、首页 首页登录 点击用户协议、隐私政策无反应
---
app/src/main/java/com/example/firstapp/database/repository/CodeRepository.kt | 35 ++++++++++++++++++++++++++++++++++-
1 files changed, 34 insertions(+), 1 deletions(-)
diff --git a/app/src/main/java/com/example/firstapp/database/repository/CodeRepository.kt b/app/src/main/java/com/example/firstapp/database/repository/CodeRepository.kt
index 915c13d..19b6579 100644
--- a/app/src/main/java/com/example/firstapp/database/repository/CodeRepository.kt
+++ b/app/src/main/java/com/example/firstapp/database/repository/CodeRepository.kt
@@ -3,6 +3,8 @@
import androidx.annotation.WorkerThread
import com.example.firstapp.database.dao.CodeDao
import com.example.firstapp.database.entity.Code
+import com.example.firstapp.model.DailyStat
+import com.example.firstapp.model.StationGroup
import kotlinx.coroutines.flow.Flow
@@ -14,6 +16,9 @@
@WorkerThread
fun delete(id: Long) = codeDao.delete(id)
+ @WorkerThread
+ fun deleteAll() = codeDao.deleteAll()
+
fun getAll() = codeDao.getAllCodes()
fun getAllDesc() = codeDao.getAllCodesDesc()
@@ -23,7 +28,8 @@
return codeDao.getByKeyword(keyword)
}
- fun queryByTypeAndCodeAndDate(content: String, code: String, dateString: String): Code {
+ @WorkerThread
+ fun queryByTypeAndCodeAndDate(content: String, code: String, dateString: String): Code? {
return codeDao.queryByTypeAndCodeAndDate(content, code, dateString)
}
@@ -34,6 +40,14 @@
fun getPackages(date: Long, dateType: String): Flow<List<Code>> {
return when (dateType) {
"DAY" -> codeDao.getPackagesByDay(date)
+ "WEEK" -> codeDao.getPackagesByWeek(date)
+ else -> codeDao.getPackagesByDay(date)
+ }
+ }
+
+ fun getPackagesReaded(date: Long, dateType: String): Flow<List<Code>> {
+ return when (dateType) {
+ "DAY" -> codeDao.getPackagesByDayReaded(date)
"WEEK" -> codeDao.getPackagesByWeek(date)
else -> codeDao.getPackagesByDay(date)
}
@@ -70,4 +84,23 @@
fun getYearMonthlyStats(date: Long) = codeDao.getYearMonthlyStats(date)
+
+ fun getCurrentWeekStats(date: Long) = codeDao.getCurrentWeekStats(date)
+
+ fun getCurrentYearStats(date: Long) = codeDao.getCurrentYearStats(date)
+
+ @WorkerThread
+ fun getStationsByType(type: String): List<StationGroup> {
+ return codeDao.getStationsByType(type)
+ }
+
+ @WorkerThread
+ fun getPackagesByTypeAndStation(type: String, stationName: String): List<Code> {
+ return codeDao.getPackagesByTypeAndStation(type, stationName)
+ }
+
+ fun getCurrentWeekStats2(startDateCur: String, endDateCur: String) = codeDao.getCurrentWeekStats2(startDateCur,endDateCur)
+ fun getWeeklyStatsChart(startDateCur: String, endDateCur: String): Flow<List<DailyStat>> = codeDao.getWeeklyStatsChart(startDateCur,endDateCur)
+ fun getDateStatsByType(startDateCur: String, endDateCur: String, type: String) = codeDao.getDateStatsByType(startDateCur,endDateCur,type)
+
}
\ No newline at end of file
--
Gitblit v1.9.3