|
@@ -30,9 +30,11 @@ import com.persagy.database.SFilter
|
|
|
import com.persagy.mybatis.SMybatisDao
|
|
|
import com.persagy.server.datacenter.models.entities.dictnew.DictProject
|
|
|
import com.persagy.server.datacenter.models.entities.objects.ZoneSpace
|
|
|
+import com.persagy.server.datacenter.models.entities.rel.RSpinBd
|
|
|
import com.persagy.server.syn.Configure
|
|
|
import com.persagy.server.syn.jms.bean.SyncRwdDatacenterMessage
|
|
|
import com.persagy.server.syn.models.api.obj.BuildingApi
|
|
|
+import com.persagy.server.syn.models.api.obj.EquipApi
|
|
|
import com.persagy.server.syn.models.tools.SpaceUtil
|
|
|
import com.persagy.service.SBaseService
|
|
|
import com.persagy.service.SObjectService
|
|
@@ -52,7 +54,8 @@ class RwdSpace {
|
|
|
var syncRwdMessageService = SObjectService(SMybatisDao(SyncRwdDatacenterMessage::class.java))
|
|
|
/** 项目所属的集团 */
|
|
|
private val dictProjectService = SObjectService(SMybatisDao(DictProject::class.java))
|
|
|
-
|
|
|
+ /** 空间所在的建筑 */
|
|
|
+ val rSpinBdService = SObjectService(SMybatisDao(RSpinBd::class.java))
|
|
|
/**
|
|
|
* 空间
|
|
|
*
|
|
@@ -72,34 +75,36 @@ class RwdSpace {
|
|
|
dictProject!!.groupCode!!,
|
|
|
queryIdList[0]
|
|
|
)
|
|
|
-// /** 空间的建筑 */
|
|
|
-// val equipInBuildingList =
|
|
|
-// EquipApi.equipInBuilding(dictProject.groupCode!!, message.projectId!!, message.targetId!!)
|
|
|
-// if (equipInBuildingList.size>0){
|
|
|
-// val hashMap = equipInBuildingList[0]
|
|
|
-// if (hashMap.containsKey("objTo")){
|
|
|
-// equipment.buildingId = hashMap["objTo"].toString()
|
|
|
-// }
|
|
|
-// }
|
|
|
-// /** 查询空间和楼层关系 */
|
|
|
-// val equipInFloorList = EquipApi.equipInFloor(dictProject.groupCode!!, message.projectId!!, message.targetId!!)
|
|
|
-// if (equipInFloorList.size>0){
|
|
|
-// val hashMap = equipInFloorList[0]
|
|
|
-// if (hashMap.containsKey("objTo")){
|
|
|
-// equipment.floorId = hashMap["objTo"].toString()
|
|
|
-// }
|
|
|
-// }
|
|
|
+ /** 空间的建筑 */
|
|
|
+ val equipInBuildingList =
|
|
|
+ EquipApi.equipInBuilding(dictProject.groupCode!!, message.projectId!!, message.targetId!!)
|
|
|
+ if (equipInBuildingList.size>0){
|
|
|
+ val hashMap = equipInBuildingList[0]
|
|
|
+ if (hashMap.containsKey("objTo")){
|
|
|
+ space.buildingId = hashMap["objTo"].toString()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ /** 查询空间和楼层关系 */
|
|
|
+ val equipInFloorList = EquipApi.equipInFloor(dictProject.groupCode!!, message.projectId!!, message.targetId!!)
|
|
|
+ if (equipInFloorList.size>0){
|
|
|
+ val hashMap = equipInFloorList[0]
|
|
|
+ if (hashMap.containsKey("objTo")){
|
|
|
+ space.floorId = hashMap["objTo"].toString()
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
spaceService.insert(space)
|
|
|
message.state = 0
|
|
|
} else {
|
|
|
message.state = 2
|
|
|
+ message.count+1
|
|
|
}
|
|
|
} else {
|
|
|
message.state = 2
|
|
|
+ message.count+1
|
|
|
}
|
|
|
/** 更改标记 */
|
|
|
- syncRwdMessageService.update(message, arrayListOf("state"))
|
|
|
+ syncRwdMessageService.update(message, arrayListOf("state","count"))
|
|
|
}
|
|
|
Configure.RWDUPDATE -> {
|
|
|
/** 修改 */
|
|
@@ -116,12 +121,14 @@ class RwdSpace {
|
|
|
message.state = 0
|
|
|
} else {
|
|
|
message.state = 2
|
|
|
+ message.count+1
|
|
|
}
|
|
|
} else {
|
|
|
message.state = 2
|
|
|
+ message.count+1
|
|
|
}
|
|
|
/** 更改标记 */
|
|
|
- syncRwdMessageService.update(message, arrayListOf("state"))
|
|
|
+ syncRwdMessageService.update(message, arrayListOf("state","count"))
|
|
|
}
|
|
|
Configure.RWDDELETE -> {
|
|
|
/** 删除 */
|
|
@@ -133,9 +140,10 @@ class RwdSpace {
|
|
|
message.state = 0
|
|
|
} else {
|
|
|
message.state = 2
|
|
|
+ message.count+1
|
|
|
}
|
|
|
/** 更改标记 */
|
|
|
- syncRwdMessageService.update(message, arrayListOf("state"))
|
|
|
+ syncRwdMessageService.update(message, arrayListOf("state","count"))
|
|
|
}
|
|
|
}
|
|
|
}
|