修改多线程安装

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

View File

@ -20,14 +20,12 @@ class ImportConfig {
@Expose @Expose
var checked: Boolean = true var checked: Boolean = true
val preProcess: ImportPreProcess = ImportPreProcess() val preProcess: ImportPreProcess = ImportPreProcess()
fun transformProperties(renderEntity: RenderEntity, realm: Realm): RenderEntity? { fun transformProperties(renderEntity: RenderEntity, realm: Realm?): RenderEntity? {
preProcess.realm = realm preProcess.realm = realm
val transformList = tableMap[renderEntity.code.toString()]?.transformer val transformList = tableMap[renderEntity.code.toString()]?.transformer
if (transformList.isNullOrEmpty()) { if (transformList.isNullOrEmpty()) {
Log.e("qj", "子表转换为空===${renderEntity.code}")
return renderEntity return renderEntity
} }
Log.e("qj", "子表转换不为空===${renderEntity.code}")
for (transform in transformList) { for (transform in transformList) {
// 开始执行转换 // 开始执行转换
val key: String = transform.k 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) { fun generateAddWidthLine(renderEntity: RenderEntity) {
var newTime = 0L
// 添加车道中心面渲染原则,根据车道宽度进行渲染 // 添加车道中心面渲染原则,根据车道宽度进行渲染
val angleReference = ReferenceEntity() val angleReference = ReferenceEntity()
// angleReference.renderEntityId = renderEntity.id // angleReference.renderEntityId = renderEntity.id
@ -741,6 +742,7 @@ class ImportPreProcess {
angleReference.geometry = angleReference.geometry =
GeometryTools.createGeometry(renderEntity.geometry).buffer(0.000035) GeometryTools.createGeometry(renderEntity.geometry).buffer(0.000035)
.toString()//GeometryTools.computeLine(0.000035,0.000035,renderEntity.geometry) .toString()//GeometryTools.computeLine(0.000035,0.000035,renderEntity.geometry)
angleReference.properties["qi_table"] = renderEntity.table angleReference.properties["qi_table"] = renderEntity.table
angleReference.properties["widthProperties"] = "3" angleReference.properties["widthProperties"] = "3"
angleReference.zoomMin = renderEntity.zoomMin angleReference.zoomMin = renderEntity.zoomMin
@ -753,6 +755,7 @@ class ImportPreProcess {
) )
listResult.add(angleReference) listResult.add(angleReference)
insertData(listResult) insertData(listResult)
} }
@ -962,11 +965,8 @@ class ImportPreProcess {
private fun insertData(list: List<RealmModel>) { private fun insertData(list: List<RealmModel>) {
realm?.let { realm?.let {
Log.e("qj", "子表插入==")
if (list != null && list.isNotEmpty()) { if (list != null && list.isNotEmpty()) {
Log.e("qj", "子表插入开始==")
it.copyToRealm(list) it.copyToRealm(list)
Log.e("qj", "子表插入结束==")
} }
} }
} }

View File

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

View File

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

View File

@ -1,20 +1,14 @@
package com.navinfo.omqs.util 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.HadLinkDvoBean
import com.navinfo.collect.library.data.entity.NiLocation import com.navinfo.collect.library.data.entity.NiLocation
import com.navinfo.collect.library.data.entity.RenderEntity import com.navinfo.collect.library.data.entity.RenderEntity
import com.navinfo.collect.library.data.entity.TaskBean import com.navinfo.collect.library.data.entity.TaskBean
import com.navinfo.collect.library.enums.DataCodeEnum import com.navinfo.collect.library.enums.DataCodeEnum
import com.navinfo.collect.library.utils.FootAndDistance
import com.navinfo.collect.library.utils.GeometryTools import com.navinfo.collect.library.utils.GeometryTools
import com.navinfo.omqs.db.RealmOperateHelper import com.navinfo.omqs.db.RealmOperateHelper
import io.realm.Realm import io.realm.Realm
import org.oscim.core.GeoPoint import org.oscim.core.GeoPoint
import java.time.LocalDate
import java.time.LocalDateTime
class NaviEngineNew( class NaviEngineNew(
private val realmOperateHelper: RealmOperateHelper, 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 { fun getMasterPoint(wkt: String): String {