|
@@ -239,8 +239,14 @@ class AdmRepository(
|
|
|
}
|
|
|
|
|
|
|
|
|
- suspend fun getRelByGraphCodeAndRelCodeAndObjFromAndObjTo(graphCode: String, relCode: String, objFrom: String, objto: String): RelationEntity? {
|
|
|
- return db.relationDao().getRelByGraphCodeAndRelCodeAndObjFromAndObjTo(graphCode, relCode, objFrom, objto)
|
|
|
+ suspend fun getRelByGraphCodeAndRelCodeAndObjFromAndObjTo(
|
|
|
+ graphCode: String,
|
|
|
+ relCode: String,
|
|
|
+ objFrom: String,
|
|
|
+ objto: String
|
|
|
+ ): RelationEntity? {
|
|
|
+ return db.relationDao()
|
|
|
+ .getRelByGraphCodeAndRelCodeAndObjFromAndObjTo(graphCode, relCode, objFrom, objto)
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -266,12 +272,11 @@ class AdmRepository(
|
|
|
request(
|
|
|
from = { api.getFrame(request) },
|
|
|
to = { frame ->
|
|
|
- println("frame: $frame")
|
|
|
val projects = frame.projects
|
|
|
val objects = frame.buildingsAndFloors
|
|
|
try {
|
|
|
db.projectDao().insProject(projects)
|
|
|
- db.objectDao().insObjects(objects)
|
|
|
+ objects.forEach { it.state = 2 }.let { db.objectDao().insObjects(objects) }
|
|
|
} catch (e: Exception) {
|
|
|
Log.d("IRepository:${AdmRepository::class.simpleName}", e.message!!)
|
|
|
}
|
|
@@ -398,7 +403,12 @@ class AdmRepository(
|
|
|
/**
|
|
|
* 上传建筑数据
|
|
|
*/
|
|
|
- suspend fun uploadBuilding(projectId: String, buildingId: String) {
|
|
|
+ suspend fun uploadBuilding(
|
|
|
+ userId: String,
|
|
|
+ groupCode: String,
|
|
|
+ projectId: String,
|
|
|
+ buildingId: String
|
|
|
+ ) {
|
|
|
try {
|
|
|
val pipeDao = db.pipeDao()
|
|
|
val fileDao = db.fileDao()
|
|
@@ -456,6 +466,8 @@ class AdmRepository(
|
|
|
)
|
|
|
|
|
|
val uploadBuilding = UploadBuilding(
|
|
|
+ userId = userId,
|
|
|
+ groupCode = groupCode,
|
|
|
projectId = projectId,
|
|
|
clientId = clientId,
|
|
|
uploadData = building
|