|
@@ -34,6 +34,7 @@ import com.persagy.server.datacenter.models.entities.dictnew.DictProject
|
|
|
import com.persagy.server.datacenter.wanda.obj.Equipment
|
|
|
import com.persagy.server.datacenter.models.entities.rel.*
|
|
|
import com.persagy.server.datacenter.wanda.obj.Floor
|
|
|
+import com.persagy.server.datacenter.wanda.obj.ZoneSpace
|
|
|
import com.persagy.server.datacenter.wanda.rel.REq2Eq
|
|
|
import com.persagy.server.datacenter.wanda.rel.REq2Sp
|
|
|
import com.persagy.server.datacenter.wanda.rel.RSp2Sp
|
|
@@ -132,9 +133,10 @@ class RelToFromController {
|
|
|
try {
|
|
|
val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
|
|
|
if (graphCode == "MechInArch") {
|
|
|
- val equipmentList = equipmentService.select(SFilter.eq("projectId", projectId)).exec()
|
|
|
+ val equipmentList = equipmentService.select(SFilter.eq("projectId", projectId), SFilter.not(SFilter.isNull("floorId"))).exec()
|
|
|
if (equipmentList.size>0) {
|
|
|
for (equipment in equipmentList) {
|
|
|
+
|
|
|
val toJsonObjArray =
|
|
|
Configure.toJsonObjArray(graphCode, type, equipment.id!!, equipment.floorId!!,null)
|
|
|
if (isDel) {
|
|
@@ -656,15 +658,16 @@ class RelToFromController {
|
|
|
fun fl2sp(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
|
|
|
try {
|
|
|
val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
|
|
|
- val rSpinFlList = rSpinFlService.select(SFilter.eq("projectId", projectId)).exec()
|
|
|
- if (rSpinFlList.size>0){
|
|
|
- for (rSpinFl in rSpinFlList) {
|
|
|
+// val rSpinFlList = rSpinFlService.select(SFilter.eq("projectId", projectId)).exec()
|
|
|
+ val spaceList = spaceService.select(SFilter.eq("projectId", projectId), SFilter.not(SFilter.isNull("floorId"))).exec()
|
|
|
+ if (spaceList.size>0){
|
|
|
+ for (rSpinFl in spaceList) {
|
|
|
if (isDel) {
|
|
|
- val toJsonObj = Configure.toJsonObj(graphCode, type, rSpinFl.floorId!!, null)
|
|
|
+ val toJsonObj = Configure.toJsonObj(graphCode, type, rSpinFl.floorId!!, rSpinFl.id!!)
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rSpinFl.floorId!!, rSpinFl.spaceId!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rSpinFl.floorId!!, rSpinFl.id!!)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("楼层下的业务空间关系:${toJsonObjArray.toJson()}")
|
|
@@ -678,6 +681,8 @@ class RelToFromController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /** 数据中心空间服务 */
|
|
|
+ private val spaceService = SObjectService(SMybatisDao(ZoneSpace::class.java))
|
|
|
/**
|
|
|
* 建筑体下的业务空间
|
|
|
*/
|
|
@@ -686,15 +691,16 @@ class RelToFromController {
|
|
|
fun bd2sp(@RequestParam projectId: String,@RequestParam graphCode: String,@RequestParam type: String,@RequestParam isDel: Boolean = false): SBaseResponse {
|
|
|
try {
|
|
|
val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
|
|
|
- val rSpinBdList = rSpinBdService.select(SFilter.eq("projectId", projectId)).exec()
|
|
|
- if (rSpinBdList.size>0){
|
|
|
- for (rSpinBd in rSpinBdList) {
|
|
|
+// val rSpinBdList = rSpinBdService.select(SFilter.eq("projectId", projectId)).exec()
|
|
|
+ val spaceList = spaceService.select(SFilter.eq("projectId", projectId), SFilter.not(SFilter.isNull("buildingId"))).exec()
|
|
|
+ if (spaceList.size>0){
|
|
|
+ for (rSpinBd in spaceList) {
|
|
|
if (isDel) {
|
|
|
- val toJsonObj = Configure.toJsonObj(graphCode, type, rSpinBd.buildingId!!, null)
|
|
|
+ val toJsonObj = Configure.toJsonObj(graphCode, type, rSpinBd.buildingId!!, rSpinBd.id!!)
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rSpinBd.buildingId!!, rSpinBd.spaceId!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rSpinBd.buildingId!!, rSpinBd.id!!)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("建筑体下的业务空间关系:${toJsonObjArray.toJson()}")
|