|
@@ -131,7 +131,7 @@ class RelToFromController {
|
|
|
if (equipmentList.size>0) {
|
|
|
for (equipment in equipmentList) {
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, equipment.id!!, equipment.floorId!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, equipment.id!!, equipment.floorId!!,null)
|
|
|
if (isDel) {
|
|
|
val toJsonObj = Configure.toJsonObj(graphCode, type, equipment.id!!, null)
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
@@ -151,7 +151,7 @@ class RelToFromController {
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rEqForFl.equipId!!, rEqForFl.floorId!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rEqForFl.equipId!!, rEqForFl.floorId!!,null)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("设备服务楼层的关系失败:${toJsonObjArray.toJson()}")
|
|
@@ -185,7 +185,7 @@ class RelToFromController {
|
|
|
if (equipmentList.size>0) {
|
|
|
for (equipment in equipmentList) {
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, equipment.id!!, equipment.buildingId!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, equipment.id!!, equipment.buildingId!!,null)
|
|
|
if (isDel) {
|
|
|
val toJsonObj = Configure.toJsonObj(graphCode, type, equipment.id!!, null)
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
@@ -205,7 +205,7 @@ class RelToFromController {
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rEqForFl.equipId!!, rEqForFl.buildingId!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rEqForFl.equipId!!, rEqForFl.buildingId!!,null)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("设备服务建筑的关系失败:${toJsonObjArray.toJson()}")
|
|
@@ -230,9 +230,7 @@ class RelToFromController {
|
|
|
try {
|
|
|
val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
|
|
|
val rSyEqList = rSyEqService.select(
|
|
|
- SFilter.eq("projectId", projectId),
|
|
|
- SFilter.eq("graphCode", graphCode),
|
|
|
- SFilter.eq("type", type)
|
|
|
+ SFilter.eq("projectId", projectId)
|
|
|
).exec()
|
|
|
if (rSyEqList.size>0){
|
|
|
for (rSyEq in rSyEqList){
|
|
@@ -241,7 +239,7 @@ class RelToFromController {
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rSyEq.sysId!!, rSyEq.equipId!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rSyEq.sysId!!, rSyEq.equipId!!,null)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("系统下的设备关系失败:${toJsonObjArray.toJson()}")
|
|
@@ -273,7 +271,7 @@ class RelToFromController {
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rEqInSh.equipId!!, rEqInSh.shaftId!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rEqInSh.equipId!!, rEqInSh.shaftId!!,null)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("设备所在竖井关系失败:${toJsonObjArray.toJson()}")
|
|
@@ -313,9 +311,7 @@ class RelToFromController {
|
|
|
try {
|
|
|
val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
|
|
|
val rEq2SpList = rEq2SpService.select(
|
|
|
- SFilter.eq("projectId", projectId),
|
|
|
- SFilter.eq("graphCode", graphCode),
|
|
|
- SFilter.eq("type", type)
|
|
|
+ SFilter.eq("projectId", projectId)
|
|
|
).exec()
|
|
|
if (rEq2SpList.size>0) {
|
|
|
for (rEq2Sp in rEq2SpList) {
|
|
@@ -324,7 +320,7 @@ class RelToFromController {
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rEq2Sp.id1!!, rEq2Sp.id2!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rEq2Sp.id1!!, rEq2Sp.id2!!,rEq2Sp.zoneType)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("设备和空间关系失败:${toJsonObjArray.toJson()}")
|
|
@@ -439,7 +435,7 @@ class RelToFromController {
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rSh2Sp.id1!!, rSh2Sp.id2!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rSh2Sp.id1!!, rSh2Sp.id2!!,rSh2Sp.zoneType)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("竖井下的业务空间:${toJsonObjArray.toJson()}")
|
|
@@ -757,7 +753,7 @@ class RelToFromController {
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rSy2Sp.id1!!, rSy2Sp.id2!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rSy2Sp.id1!!, rSy2Sp.id2!!,rSy2Sp.zoneType)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("系统所在业务空间:${toJsonObjArray.toJson()}")
|
|
@@ -776,7 +772,7 @@ class RelToFromController {
|
|
|
EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
|
|
|
}
|
|
|
val toJsonObjArray =
|
|
|
- Configure.toJsonObjArray(graphCode, type, rSy2Sp.id1!!, rSy2Sp.id2!!)
|
|
|
+ Configure.toJsonObjArray(graphCode, type, rSy2Sp.id1!!, rSy2Sp.id2!!,rSy2Sp.zoneType)
|
|
|
val createRel = EquipApi.createRel(dictProject!!.groupCode!!, projectId, toJsonObjArray)
|
|
|
if (!createRel){
|
|
|
logger.debug("系统服务于业务空间:${toJsonObjArray.toJson()}")
|
|
@@ -799,9 +795,12 @@ class RelToFromController {
|
|
|
fun sp2sp(projectId: String,graphCode: String,type: String,isDel: Boolean = false): SBaseResponse {
|
|
|
try {
|
|
|
val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
|
|
|
- val rSp2SpList = rSp2SpService.select(SFilter.eq("projectId", projectId),
|
|
|
- SFilter.eq("graphCode", graphCode),
|
|
|
- SFilter.eq("type", type)).exec()
|
|
|
+ val relContrast = Configure.relContrast(graphCode, type)
|
|
|
+ if (relContrast.isNullOrEmpty()){
|
|
|
+ return SBaseResponse(SResponseType.failure)
|
|
|
+ }
|
|
|
+
|
|
|
+ val rSp2SpList = rSp2SpService.select(SFilter.eq("projectId", projectId), SFilter.eq("type",relContrast)).exec()
|
|
|
if (rSp2SpList.size>0) {
|
|
|
for (rSp2Sp in rSp2SpList) {
|
|
|
if (isDel) {
|
|
@@ -831,9 +830,12 @@ class RelToFromController {
|
|
|
fun eq2eq(projectId: String,graphCode: String,type: String,isDel: Boolean = false) : SBaseResponse {
|
|
|
try {
|
|
|
val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
|
|
|
+ val relContrastEq = Configure.relContrastEq(graphCode, type)
|
|
|
+ if (relContrastEq.isNullOrEmpty()){
|
|
|
+ return SBaseResponse(SResponseType.failure)
|
|
|
+ }
|
|
|
val rEq2EqList = rEq2EqService.select(SFilter.eq("projectId", projectId),
|
|
|
- SFilter.eq("graphCode", graphCode),
|
|
|
- SFilter.eq("type", type)).exec()
|
|
|
+ SFilter.eq("type", relContrastEq)).exec()
|
|
|
if (rEq2EqList.size>0) {
|
|
|
for (rEq2Eq in rEq2EqList) {
|
|
|
if (isDel) {
|
|
@@ -855,14 +857,4 @@ class RelToFromController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 所有关系同步到数据中台
|
|
|
- */
|
|
|
- @Operation(summary= "所有关系-同步到中台", description = "")
|
|
|
- @PostMapping("/all/rel")
|
|
|
- fun allRel(projectId: String,graphCode: String,type: String,isDel: Boolean = false) {
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
}
|