|
@@ -167,7 +167,7 @@ class GraphyVM(
|
|
|
modifiedTime = time,
|
|
|
uploadFlag = "",
|
|
|
valid = 1,
|
|
|
- geom = toJson
|
|
|
+ geom = toJson, state = "1"
|
|
|
)
|
|
|
repo.insProblem(problem)
|
|
|
|
|
@@ -201,7 +201,7 @@ class GraphyVM(
|
|
|
modifier = "",
|
|
|
modifiedTime = time,
|
|
|
valid = 1,
|
|
|
- uploadFlag = ""
|
|
|
+ uploadFlag = "", state = "1"
|
|
|
)
|
|
|
repo.insFile(file)
|
|
|
}
|
|
@@ -321,7 +321,7 @@ class GraphyVM(
|
|
|
modifier = "Android",
|
|
|
modifiedTime = time,
|
|
|
valid = 1,
|
|
|
- uploadFlag = ""
|
|
|
+ uploadFlag = "", state = "1"
|
|
|
)
|
|
|
repo.insQrcode(qrcode)
|
|
|
mEmitter.SendDircetive(BIND_QECODE, null)
|
|
@@ -400,6 +400,7 @@ class GraphyVM(
|
|
|
space.archState = 2
|
|
|
space.equipState = 2
|
|
|
}
|
|
|
+ space.state = "1"
|
|
|
repo.insSpace(space)
|
|
|
mEmitter.SendDircetive(SET_JOB, null)
|
|
|
}
|
|
@@ -630,6 +631,7 @@ class GraphyVM(
|
|
|
viewModelScope.launch {
|
|
|
var space = repo.getObject(space.id!!)
|
|
|
space.infos = JSONObject(hashMap as Map<*, *>)
|
|
|
+ space.state = "1"
|
|
|
repo.insObject(space)
|
|
|
mActivity.setResult(RESULT_OK)
|
|
|
mActivity.finish()
|
|
@@ -735,7 +737,7 @@ class GraphyVM(
|
|
|
virtualCodes = null,
|
|
|
infos = JSONObject(hashMap as Map<*, *>),
|
|
|
strInfos = gson.toJson(hashMap),
|
|
|
- floorMap = null
|
|
|
+ floorMap = null, state = "1"
|
|
|
)
|
|
|
repo.insObject(objectEntity)
|
|
|
} else {
|
|
@@ -773,7 +775,7 @@ class GraphyVM(
|
|
|
modifier = "",
|
|
|
modifiedTime = null,
|
|
|
valid = 1,
|
|
|
- uploadFlag = ""
|
|
|
+ uploadFlag = "", state = "1"
|
|
|
)
|
|
|
repo.insFile(file)
|
|
|
}
|
|
@@ -959,7 +961,7 @@ class GraphyVM(
|
|
|
clientDevice = null,
|
|
|
uploadFlag = null,
|
|
|
deliveryState = null,
|
|
|
- valid = 1, d2mState = null, objFromLocalId = null, objToLocalId = null
|
|
|
+ valid = 1, d2mState = null, objFromLocalId = null, objToLocalId = null, state = "1"
|
|
|
)
|
|
|
repo.insRelation(relEntity)
|
|
|
getRelConfig(equipEntity, deviceId, uuid)
|
|
@@ -1013,7 +1015,7 @@ class GraphyVM(
|
|
|
pipeType = groupPipeConfigEntity.pipeType,
|
|
|
pipeSubType = groupPipeConfigEntity.pipeSubType,
|
|
|
route = null,
|
|
|
- infos = null
|
|
|
+ infos = null, state = "1"
|
|
|
)
|
|
|
repo.insPipe(relEntity)
|
|
|
getRelConfig(equipEntity, deviceId, uuid)
|
|
@@ -1022,24 +1024,27 @@ class GraphyVM(
|
|
|
|
|
|
fun insProblemEquip(space: TunableSpaceItem, deviceId: String) {
|
|
|
viewModelScope.launch {
|
|
|
- val entity = ProblemEquipEntity(
|
|
|
- id = UUID.randomUUID().toString(),
|
|
|
- floorId = floorId,
|
|
|
- projectId = projectId,
|
|
|
- buildingId = buildingId,
|
|
|
- equipId = deviceId,
|
|
|
- workId = null,
|
|
|
- problemType = null,
|
|
|
- problemState = 1,
|
|
|
- message = null,
|
|
|
- creator = null,
|
|
|
- creationTime = null,
|
|
|
- modifier = null,
|
|
|
- modifiedTime = null,
|
|
|
- uploadFlag = null,
|
|
|
- valid = 1
|
|
|
- )
|
|
|
- repo.insProblemEquipEntity(entity)
|
|
|
+ val proEntity = repo.getEqProblem(deviceId)
|
|
|
+ if (proEntity == null) {
|
|
|
+ val entity = ProblemEquipEntity(
|
|
|
+ id = UUID.randomUUID().toString(),
|
|
|
+ floorId = floorId,
|
|
|
+ projectId = projectId,
|
|
|
+ buildingId = buildingId,
|
|
|
+ equipId = deviceId,
|
|
|
+ workId = null,
|
|
|
+ problemType = null,
|
|
|
+ problemState = 1,
|
|
|
+ message = null,
|
|
|
+ creator = null,
|
|
|
+ creationTime = null,
|
|
|
+ modifier = null,
|
|
|
+ modifiedTime = null,
|
|
|
+ uploadFlag = null,
|
|
|
+ valid = 1, state = "1"
|
|
|
+ )
|
|
|
+ repo.insProblemEquipEntity(entity)
|
|
|
+ }
|
|
|
}
|
|
|
getSpaceEq(space)
|
|
|
}
|