修改数据类型增加PA/SA要素编码处理

This commit is contained in:
qiji4215
2023-08-14 14:18:19 +08:00
parent f100578627
commit 08283761e0
12 changed files with 211 additions and 93 deletions

View File

@@ -11,6 +11,7 @@ import com.google.gson.Gson
import com.google.gson.reflect.TypeToken
import com.navinfo.collect.library.data.entity.RenderEntity
import com.navinfo.collect.library.data.entity.TaskBean
import com.navinfo.collect.library.enum.DataCodeEnum
import com.navinfo.omqs.Constant
import com.navinfo.omqs.bean.ImportConfig
import com.navinfo.omqs.db.deep.LinkList
@@ -167,7 +168,7 @@ class ImportOMDBHelper @AssistedInject constructor(
// 先查询这个mesh下有没有数据如果有则跳过即可
// val meshEntity = Realm.getDefaultInstance().where(RenderEntity::class.java).equalTo("properties['mesh']", map["mesh"].toString()).findFirst()
val renderEntity = RenderEntity()
renderEntity.code = map["qi_code"].toString().toInt()
renderEntity.code = map["qi_code"].toString()
renderEntity.name = map["qi_name"].toString()
renderEntity.table = map["qi_table"].toString()
renderEntity.taskId = task.id
@@ -263,6 +264,24 @@ class ImportOMDBHelper @AssistedInject constructor(
renderEntity.enable = 2
Log.e("qj","${renderEntity.name}==不包括任务linkPid")
}
//道路属性code编码需要特殊处理 存在多个属性值时渲染优先级SA>PA
if(renderEntity.table == "OMDB_LINK_ATTRIBUTE"){
var type = renderEntity.properties["SA"]
if(type!=null&&type=="1"){
renderEntity.code = DataCodeEnum.OMDB_LINK_ATTRIBUTE_SA.code
}else{
type = renderEntity.properties["PA"]
if(type!=null&&type=="1"){
renderEntity.code = DataCodeEnum.OMDB_LINK_ATTRIBUTE_PA.code
}else{//不满足条件时过滤该数据
continue
}
}
}
listResult.add(renderEntity)
// 对renderEntity做预处理后再保存
val resultEntity = importConfig.transformProperties(renderEntity)

View File

@@ -397,7 +397,7 @@ class ImportPreProcess {
"markingCount" to 1
)
)
if (renderEntity.code == 2013 && !renderEntity.properties["shapeList"].isNullOrEmpty() && renderEntity.properties["shapeList"] != "null") {
if (renderEntity.code == "2013" && !renderEntity.properties["shapeList"].isNullOrEmpty() && renderEntity.properties["shapeList"] != "null") {
// 解析shapeList将数组中的属性放会properties
val shapeList = JSONArray(renderEntity.properties["shapeList"])
for (i in 0 until shapeList.length()) {
@@ -416,7 +416,7 @@ class ImportPreProcess {
* 解析车信数据二级属性
* */
fun unpackingLaneInfo(renderEntity: RenderEntity) {
if (renderEntity.code == 4601) {
if (renderEntity.code == "4601") {
if (!renderEntity.properties["laneinfoGroup"].isNullOrEmpty() && renderEntity.properties["laneinfoGroup"] != "null") {
// 解析laneinfoGroup将数组中的属性放会properties
val laneinfoGroup = JSONArray(
@@ -451,6 +451,20 @@ class ImportPreProcess {
}
}
/**
* 生成默认道路名数据
* */
fun generateRoadText(renderEntity: RenderEntity) {
// 根据类型进行文字转换
if (renderEntity.code != null) {
if(renderEntity.code=="2004-1"){
renderEntity.properties["name"] = "SA"
}else if(renderEntity.code=="2004-2"){
renderEntity.properties["name"] = "PA"
}
}
}
/**
* 生成默认道路名数据

View File

@@ -34,7 +34,7 @@ interface ScProblemTypeDao {
suspend fun findClassTypeList(): List<ScProblemTypeBean>?
@Query("select DISTINCT CLASS_TYPE from ScProblemType where ELEMENT_CODE=:code")
suspend fun findClassTypeByCode(code: Int): String?
suspend fun findClassTypeByCode(code: String): String?
/**
* 获取问题类型,并去重