修改任务线刷新,数据安装刷新

This commit is contained in:
squallzhjch
2023-05-06 11:01:50 +08:00
parent 752550f376
commit d86ec46943
15 changed files with 160 additions and 84 deletions

View File

@@ -3,6 +3,7 @@ package com.navinfo.omqs.http.taskdownload
import android.content.Context
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.Observer
import com.navinfo.collect.library.map.NIMapController
import com.navinfo.omqs.bean.TaskBean
import com.navinfo.omqs.hilt.ImportOMDBHiltFactory
import com.navinfo.omqs.hilt.OMDBDataBaseHiltFactory
@@ -19,6 +20,7 @@ import javax.inject.Inject
class TaskDownloadManager constructor(
val importFactory: ImportOMDBHiltFactory,
val netApi: RetrofitNetworkServiceAPI,
val mapController:NIMapController
) {
lateinit var context: Context

View File

@@ -131,6 +131,9 @@ class TaskDownloadScope(
Log.e("jingo", "数据安装 $it")
if (it == "finish") {
change(FileDownloadStatus.DONE)
withContext(Dispatchers.Main) {
downloadManager.mapController.mMapView.updateMap(true)
}
} else {
change(FileDownloadStatus.IMPORTING, it)
}
@@ -138,6 +141,8 @@ class TaskDownloadScope(
} catch (e: Exception) {
Log.e("jingo", "数据安装失败 ${e.toString()}")
change(FileDownloadStatus.ERROR)
}finally {
}
Log.e("jingo", "importData EEE")

View File

@@ -115,15 +115,16 @@ class TaskUploadScope(
taskBean.hadLinkDvoList.forEach { hadLinkDvoBean ->
val objects = realm.where(QsRecordBean::class.java)
.equalTo("linkId", /*"84207223282277331"*/hadLinkDvoBean.linkPid).findAll()
if(objects.size == 0){
// change(FileUploadStatus.NONE)
if (objects.size == 0) {
if (taskBean.syncStatus == FileUploadStatus.WAITING)
change(FileUploadStatus.NONE)
return
}
val bodyList: MutableList<EvaluationInfo> = ArrayList()
if (objects != null) {
val copyList =realm.copyFromRealm(objects)
val copyList = realm.copyFromRealm(objects)
copyList.forEach {
val evaluationInfo = EvaluationInfo(
taskBean.id.toString(),