增加路口要素按任务link渲染

This commit is contained in:
qiji4215 2023-08-10 13:37:39 +08:00
parent 96316fe1bb
commit af4baf80b5
4 changed files with 52 additions and 38 deletions

View File

@ -9,17 +9,15 @@ import com.blankj.utilcode.util.FileIOUtils
import com.blankj.utilcode.util.ZipUtils import com.blankj.utilcode.util.ZipUtils
import com.google.gson.Gson import com.google.gson.Gson
import com.google.gson.reflect.TypeToken import com.google.gson.reflect.TypeToken
import com.navinfo.collect.library.data.entity.ReferenceEntity
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.omqs.Constant import com.navinfo.omqs.Constant
import com.navinfo.omqs.bean.ImportConfig import com.navinfo.omqs.bean.ImportConfig
import com.navinfo.omqs.db.deep.ListList import com.navinfo.omqs.db.deep.LinkList
import com.navinfo.omqs.hilt.OMDBDataBaseHiltFactory import com.navinfo.omqs.hilt.OMDBDataBaseHiltFactory
import dagger.assisted.Assisted import dagger.assisted.Assisted
import dagger.assisted.AssistedInject import dagger.assisted.AssistedInject
import io.realm.Realm import io.realm.Realm
import io.realm.RealmQuery
import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow import kotlinx.coroutines.flow.flow
@ -194,18 +192,12 @@ class ImportOMDBHelper @AssistedInject constructor(
} }
//遍历判断只显示与任务Link相关的任务数据 //遍历判断只显示与任务Link相关的任务数据
if(currentConfig.checkLinkId){ if(currentConfig.checkLinkId){
if(renderEntity.properties.containsKey("linkPid")&&renderEntity.properties["linkPid"]!=null){
task.hadLinkDvoList.forEach{
if(it.linkPid==renderEntity.properties["linkPid"]){
renderEntity.enable = 1
Log.e("qj","${renderEntity.name}==包括任务link")
return@forEach
}
}
}else if(renderEntity.table == "OMDB_RESTRICTION" && renderEntity.properties.containsKey("linkIn")){
if (renderEntity.properties["linkIn"] != null) {
var currentLinkPid = renderEntity.properties["linkIn"] if(renderEntity.properties.containsKey("linkPid")){
var currentLinkPid = renderEntity.properties["linkPid"]
if(!currentLinkPid.isNullOrEmpty()&&currentLinkPid!="null"){
task.hadLinkDvoList.forEach{ task.hadLinkDvoList.forEach{
if(it.linkPid==renderEntity.properties["linkPid"]){ if(it.linkPid==renderEntity.properties["linkPid"]){
@ -215,29 +207,51 @@ class ImportOMDBHelper @AssistedInject constructor(
} }
} }
} }
}else if(renderEntity.table == "OMDB_INTERSECTION" &&renderEntity.properties.containsKey("type")&& renderEntity.properties.containsKey("linkList")){
if (renderEntity.properties["type"]!=null&&renderEntity.properties["linkList"] != null) {
val type = renderEntity.properties["type"] }else if(renderEntity.table == "OMDB_RESTRICTION" && renderEntity.properties.containsKey("linkIn")){
if(type=="1"){ if (renderEntity.properties["linkIn"] != null) {
if (renderEntity.properties["linkList"] != null) { var currentLinkPid = renderEntity.properties["linkIn"]
val list: List<ListList> = gson.fromJson(renderEntity.properties["linkList"], object : TypeToken<List<ListList>>() {}.type) if(!currentLinkPid.isNullOrEmpty()&&currentLinkPid!="null"){
if (list != null) { task.hadLinkDvoList.forEach{
m@for (link in list){ if(it.linkPid==currentLinkPid){
for(hadLink in task.hadLinkDvoList){ renderEntity.enable = 1
if (link.featureType == 1 && hadLink.linkPid == link.linkPid) { Log.e("qj","${renderEntity.name}==包括任务link")
renderEntity.enable = 1 return@forEach
Log.e("qj", "${renderEntity.name}==包括任务link") }
break@m }
} }
}
}else if(renderEntity.table == "OMDB_INTERSECTION" && renderEntity.properties.containsKey("linkList")){
if (renderEntity.properties["linkList"] != null) {
Log.e("qj", "linkList==开始${renderEntity.name}==${renderEntity.properties["linkList"]}}")
val linkList = renderEntity.properties["linkList"]
if (!linkList.isNullOrEmpty()&&linkList!="null") {
Log.e("qj", "linkList==${renderEntity.name}==${renderEntity.properties["linkList"]}}")
val list: List<LinkList> = gson.fromJson(linkList, object : TypeToken<List<LinkList>>() {}.type)
if (list != null) {
m@for (link in list){
for(hadLink in task.hadLinkDvoList){
if (hadLink.linkPid == link.linkPid) {
renderEntity.enable = 1
Log.e("qj", "${renderEntity.name}==包括任务link==${renderEntity.geometry}")
break@m
} }
} }
} }
} }
}else{
Log.e("qj", "linkList==$linkList}")
} }
} }
}else{ }else{

View File

@ -1,6 +1,6 @@
package com.navinfo.omqs.db.deep package com.navinfo.omqs.db.deep
data class ListList( data class LinkList(
var featureType: Int = -1, var featureType: Int = -1,
var linkPid: String = "" var linkPid: String = ""
) )

View File

@ -1956,15 +1956,15 @@
</m> </m>
<!-- 路口 --> <!-- 路口 -->
<m v="OMDB_INTERSECTION"> <m v="OMDB_INTERSECTION">
<!-- <m k="type" v="node">--> <m k="type" v="node">
<!-- <symbol src="assets:symbols/dot_blue_dark.svg"></symbol>--> <symbol src="assets:symbols/dot_blue_dark.svg"></symbol>
<!-- </m>-->
<!-- <m k="intersectionPid">-->
<!-- <symbol src="assets:symbols/dot_magenta.svg"></symbol>-->
<!-- </m>-->
<m k="geometry">
<symbol src="@typesrc"></symbol>
</m> </m>
<m k="intersectionPid">
<symbol src="assets:symbols/dot_magenta.svg"></symbol>
</m>
<!-- <m k="geometry">
<symbol src="@typesrc"></symbol>
</m>-->
</m> </m>
<!--车道中心线--> <!--车道中心线-->

2
vtm

@ -1 +1 @@
Subproject commit 58f231037c44ccc1c82d00818c402a2894ca4e09 Subproject commit 8717b07ebff4dd61226abb19474be6567a736ad8