修改多线程安装

This commit is contained in:
squallzhjch 2023-10-27 14:18:38 +08:00
parent 459970d01b
commit 43523d09b4
8 changed files with 549 additions and 525 deletions

View File

@ -83,6 +83,7 @@
"name": "车道边界类型",
"zoomMin": 18,
"zoomMax": 20,
"isDependOnOtherTable": true,
"checkLinkId": false,
"filterData": true,
"catch": true,
@ -154,6 +155,7 @@
"code": 2092,
"name": "车道类型",
"catch": true,
"isDependOnOtherTable": true,
"zoomMin": 18,
"zoomMax": 20,
"transformer": [
@ -176,6 +178,7 @@
"name": "桥",
"catch": true,
"existSubCode": true,
"isDependOnOtherTable": true,
"zoomMin": 15,
"zoomMax": 20,
"transformer": [
@ -352,6 +355,7 @@
"code": 4001,
"name": "路口",
"zoomMin": 15,
"isDependOnOtherTable": true,
"zoomMax": 17,
"catch": true,
"transformer": [
@ -493,6 +497,7 @@
"code": 4009,
"name": "警示信息",
"catch": true,
"isDependOnOtherTable": true,
"zoomMin": 15,
"zoomMax": 20,
"transformer": [
@ -581,6 +586,7 @@
"code": 4601,
"name": "车信",
"catch": true,
"isDependOnOtherTable": true,
"zoomMin": 15,
"zoomMax": 17,
"transformer": [
@ -609,6 +615,7 @@
"code": 5001,
"name": "车道中心线",
"catch": false,
"isDependOnOtherTable": true,
"checkLinkId": false,
"zoomMin": 18,
"zoomMax": 20,

View File

@ -20,14 +20,12 @@ class ImportConfig {
@Expose
var checked: Boolean = true
val preProcess: ImportPreProcess = ImportPreProcess()
fun transformProperties(renderEntity: RenderEntity, realm: Realm): RenderEntity? {
fun transformProperties(renderEntity: RenderEntity, realm: Realm?): RenderEntity? {
preProcess.realm = realm
val transformList = tableMap[renderEntity.code.toString()]?.transformer
if (transformList.isNullOrEmpty()) {
Log.e("qj", "子表转换为空===${renderEntity.code}")
return renderEntity
}
Log.e("qj", "子表转换不为空===${renderEntity.code}")
for (transform in transformList) {
// 开始执行转换
val key: String = transform.k

File diff suppressed because it is too large Load Diff

View File

@ -733,6 +733,7 @@ class ImportPreProcess {
* 生成车道中心线面宽度
* */
fun generateAddWidthLine(renderEntity: RenderEntity) {
var newTime = 0L
// 添加车道中心面渲染原则,根据车道宽度进行渲染
val angleReference = ReferenceEntity()
// angleReference.renderEntityId = renderEntity.id
@ -741,6 +742,7 @@ class ImportPreProcess {
angleReference.geometry =
GeometryTools.createGeometry(renderEntity.geometry).buffer(0.000035)
.toString()//GeometryTools.computeLine(0.000035,0.000035,renderEntity.geometry)
angleReference.properties["qi_table"] = renderEntity.table
angleReference.properties["widthProperties"] = "3"
angleReference.zoomMin = renderEntity.zoomMin
@ -753,6 +755,7 @@ class ImportPreProcess {
)
listResult.add(angleReference)
insertData(listResult)
}
@ -962,11 +965,8 @@ class ImportPreProcess {
private fun insertData(list: List<RealmModel>) {
realm?.let {
Log.e("qj", "子表插入==")
if (list != null && list.isNotEmpty()) {
Log.e("qj", "子表插入开始==")
it.copyToRealm(list)
Log.e("qj", "子表插入结束==")
}
}
}

View File

@ -155,21 +155,20 @@ class TaskDownloadScope(
fileNew
)
if (task != null) {
importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, task, this).collect {
Log.e("jingo", "数据安装 $it")
if (it == "finish") {
change(FileDownloadStatus.DONE)
Log.e("jingo", "数据安装结束")
withContext(Dispatchers.Main) {
//任务与当前一致,需要更新渲染图层
if (MapParamUtils.getTaskId() == taskBean.id) {
downloadManager.mapController.layerManagerHandler.updateOMDBVectorTileLayer()
}
if (importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, task, this)) {
// if (it == "finish") {
change(FileDownloadStatus.DONE)
Log.e("jingo", "数据安装结束")
withContext(Dispatchers.Main) {
//任务与当前一致,需要更新渲染图层
if (MapParamUtils.getTaskId() == taskBean.id) {
downloadManager.mapController.layerManagerHandler.updateOMDBVectorTileLayer()
}
} else {
change(FileDownloadStatus.IMPORTING, it)
}
} else {
change(FileDownloadStatus.IMPORTING, "anzhuang")
}
// }
}
} catch (e: Exception) {
Log.e("jingo", "数据安装失败 ${e.toString()}")

View File

@ -1,17 +1,12 @@
package com.navinfo.omqs.ui.fragment.personalcenter
import android.net.Uri
import android.os.Build
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.blankj.utilcode.util.FileIOUtils
import com.blankj.utilcode.util.UriUtils
import com.blankj.utilcode.util.ZipUtils
import com.google.gson.Gson
import com.navinfo.collect.library.data.entity.*
import com.navinfo.collect.library.data.entity.TaskBean
import com.navinfo.omqs.bean.ScProblemTypeBean
import com.navinfo.omqs.bean.ScRootCauseAnalysisBean
import com.navinfo.omqs.bean.ScWarningCodeBean
@ -24,7 +19,6 @@ import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.apache.commons.io.input.BOMInputStream
import java.io.*
import java.util.*
import javax.inject.Inject
@ -158,16 +152,12 @@ class PersonalCenterViewModel @Inject constructor(
viewModelScope.launch(Dispatchers.IO) {
Log.d("OMQSApplication", "开始导入数据")
if (task != null) {
importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, task, this).collect {
Log.d("importOMDBData", it)
}
importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, task, this)
} else {
val newTask = TaskBean()
newTask.id = -1
importOMDBHelper.importOmdbZipFile(importOMDBHelper.omdbFile, newTask, this)
.collect {
Log.d("importOMDBData", it)
}
}
Log.d("OMQSApplication", "导入数据完成")
}

View File

@ -1,20 +1,14 @@
package com.navinfo.omqs.util
import android.os.Build
import android.util.Log
import androidx.annotation.RequiresApi
import com.navinfo.collect.library.data.entity.HadLinkDvoBean
import com.navinfo.collect.library.data.entity.NiLocation
import com.navinfo.collect.library.data.entity.RenderEntity
import com.navinfo.collect.library.data.entity.TaskBean
import com.navinfo.collect.library.enums.DataCodeEnum
import com.navinfo.collect.library.utils.FootAndDistance
import com.navinfo.collect.library.utils.GeometryTools
import com.navinfo.omqs.db.RealmOperateHelper
import io.realm.Realm
import org.oscim.core.GeoPoint
import java.time.LocalDate
import java.time.LocalDateTime
class NaviEngineNew(
private val realmOperateHelper: RealmOperateHelper,

View File

@ -49,7 +49,6 @@ class GeometryToolsKt {
}
}
}
println("YGeometry-time:" + (System.currentTimeMillis() - startTime))
}
/**
@ -93,7 +92,6 @@ class GeometryToolsKt {
}
}
}
println("XGeometry-time:" + (System.currentTimeMillis() - startTime))
}
fun getMasterPoint(wkt: String): String {