修改任务线刷新,数据安装刷新
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user