Browse Source

fix 设备选择空间

lihao1 2 years ago
parent
commit
e1a719ce5b

+ 5 - 4
demo/src/main/java/com/sybotan/android/demo/viewmodel/ChooseSpaceVM.kt

@@ -15,6 +15,7 @@ import com.framework.mvvm.model.db.entity.task.RelationEntity
 import com.framework.mvvm.model.db.entity.task.ServeAreaEntity
 import com.framework.mvvm.model.repository.AdmRepository
 import com.google.gson.Gson
+import com.google.gson.JsonArray
 import com.google.gson.reflect.TypeToken
 import com.sybotan.android.demo.activities.BaseActivity
 import com.sybotan.android.demo.bean.RelConfigEntityPackClass
@@ -206,11 +207,11 @@ class ChooseSpaceVM(
                 val objFrom: String
                 val objto: String
                 if (direction == "->") {
-                    objFrom = deviceId
-                    objto = id
-                } else {
                     objto = deviceId
                     objFrom = id
+                } else {
+                    objFrom = deviceId
+                    objto = id
                 }
                 val en = repo.getRelByGraphCodeAndRelCodeAndObjFromAndObjTo(
                     groupRelConfigEntity.entity.graphCode!!,
@@ -261,7 +262,7 @@ class ChooseSpaceVM(
                 }
                 objEntity?.let {
                     val obj = objEntity.infos!!.asJsonObject
-                    if (obj["outline"] is ArrayList<*>) {
+                    if (obj["outline"] is JsonArray) {
                         val info = gson.fromJson(obj, SpaceInfo::class.java)
                         equips.add(objEntity)
 //                spaces.add(info.outline[0])

+ 2 - 2
gradle.properties

@@ -17,14 +17,14 @@ SAGA_SERVICE_VERSION=1.4.140
 MAVEN_REPO_RELEASE_URL=http\://dev.dp.sagacloud.cn\:8082/repository/maven-releases/
 EVENTBUS_VERSION=3.1.1
 EASYPERMISSIONS_VERSION=1.2.0
-SAGA_ANDROID_VERSION=1.0.19
+SAGA_ANDROID_VERSION=1.0.20
 JUNIT_VERSION=5.3.1
 KOTLIN_VERSION=1.5.31
 SAGA_GROUP=cn.sagacloud
 SYBOTAN_KOTLIN_VERSION=1.2.42
 android.useAndroidX=true
 LICENSE_NAME=The Apache Software License, Version 2.0
-SAGA_CODE=31
+SAGA_CODE=32
 MAVEN_REPO_SNAPSHOT_URL=http\://dev.dp.sagacloud.cn\:8082/repository/maven-snapshots/
 NEXUS_USERNAME=saga
 DEVELOPER_ID=Andy.Sybotan