From 1897c4ad5fa73b3f0a36e1aa0e1e9000302a6ace Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期五, 31 十月 2025 17:35:09 +0800
Subject: [PATCH] 2025.10.31 1. 新增巡查场景历史详情相关数据逻辑(待完成);
---
app/src/main/java/cn/flightfeather/thirdappmodule/repository/EvaluationRepository.kt | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/app/src/main/java/cn/flightfeather/thirdappmodule/repository/EvaluationRepository.kt b/app/src/main/java/cn/flightfeather/thirdappmodule/repository/EvaluationRepository.kt
index 8983881..19949b9 100644
--- a/app/src/main/java/cn/flightfeather/thirdappmodule/repository/EvaluationRepository.kt
+++ b/app/src/main/java/cn/flightfeather/thirdappmodule/repository/EvaluationRepository.kt
@@ -9,6 +9,7 @@
import cn.flightfeather.thirdappmodule.common.net.ResultObserver
import cn.flightfeather.thirdappmodule.common.net.RetrofitFactory
import cn.flightfeather.thirdappmodule.httpservice.EvaluationService
+import cn.flightfeather.thirdappmodule.model.bean.BaseResponse
import cn.flightfeather.thirdappmodule.repository.dao.EvaluationDao
import io.reactivex.Observable
import io.reactivex.functions.BiFunction
@@ -21,10 +22,17 @@
* 璇勫垎鐩稿叧鏁版嵁鎿嶄綔
*/
class EvaluationRepository {
+ companion object {
+ @JvmStatic
+ val instance: EvaluationRepository by lazy(LazyThreadSafetyMode.SYNCHRONIZED) { EvaluationRepository()}
+ }
private val retrofit = RetrofitFactory.instance.retrofit
private val evaluationDao = EvaluationDao()
+ /**
+ * 鑾峰彇璇勪及鎬昏鍒�
+ */
fun getEvaluationRule(
provinceCode: String, cityCode: String,
districtCode: String, sceneTypeId: Byte, resultCallBack: ResultCallBack<List<Evaluationrule>>) {
@@ -44,11 +52,36 @@
})
}
+ /**
+ * 鏍规嵁宸℃煡璁板綍id鑾峰彇璇勪及鎬诲垎
+ */
fun getEvaluation(inspectionGuid: String, resultCallBack: ResultCallBack<List<Evaluation>>) {
retrofit.create(EvaluationService::class.java)
.findByInspectionId(inspectionGuid).enqueue(ResponseBodyCallBack(resultCallBack))
}
+ /**
+ * 鏍规嵁鍦烘櫙id鑾峰彇璇勪及鎬诲垎
+ */
+ fun getEvaluationByScene(sceneId: String, page: Int = 1, pageSize: Int = 4, resultCallBack: ResultCallBack<List<Evaluation>>) {
+ val service = retrofit.create(EvaluationService::class.java).getEvaluationListByScene(sceneId, page, pageSize)
+
+ RetrofitFactory.executeResult(service, object : ResultObserver<BaseResponse<List<Evaluation>>>() {
+ override fun onPage(current: Int, total: Int) {
+ super.onPage(current, total)
+ resultCallBack.onPage(current, total)
+ }
+
+ override fun onSuccess(result: BaseResponse<List<Evaluation>>?) {
+ resultCallBack.onSuccess(result?.data)
+ }
+
+ override fun onFailure(e: Throwable, isNetWorkError: Boolean) {
+ resultCallBack.onFailure()
+ }
+ })
+ }
+
fun getRuleItem(evaluationruleGuid: String, subTaskGuid: String,resultCallBack: ResultCallBack<ArrayList<EvaluationsubruleVo>>) {
val dbService = evaluationDao.getEvaluationSubRule(evaluationruleGuid).map {
val list = it.map {
--
Gitblit v1.9.3