|
@@ -2,6 +2,7 @@ package com.persagy.server.datacenter.services.relation_calc
|
|
|
|
|
|
import com.persagy.database.SFilter
|
|
import com.persagy.database.SFilter
|
|
import com.persagy.mybatis.SMybatisDao
|
|
import com.persagy.mybatis.SMybatisDao
|
|
|
|
+import com.persagy.server.Opt
|
|
import com.persagy.server.datacenter.datacenter.models.entities.graphtype.block.RelationAddRequest
|
|
import com.persagy.server.datacenter.datacenter.models.entities.graphtype.block.RelationAddRequest
|
|
import com.persagy.server.datacenter.datacenter.models.entities.graphtype.rel.RelZoneSpace
|
|
import com.persagy.server.datacenter.datacenter.models.entities.graphtype.rel.RelZoneSpace
|
|
import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProject
|
|
import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProject
|
|
@@ -13,10 +14,12 @@ import com.persagy.server.datacenter.wanda.rel.REq2Eq
|
|
import com.persagy.server.datacenter.wanda.rel.REq2Sp
|
|
import com.persagy.server.datacenter.wanda.rel.REq2Sp
|
|
import com.persagy.server.datacenter.wanda.rel.REq2Sy
|
|
import com.persagy.server.datacenter.wanda.rel.REq2Sy
|
|
import com.persagy.server.datacenter.wanda.rel.RSp2Sp
|
|
import com.persagy.server.datacenter.wanda.rel.RSp2Sp
|
|
|
|
+import com.persagy.server.jms.RabbitMqService
|
|
import com.persagy.server.services.objects.FloorService
|
|
import com.persagy.server.services.objects.FloorService
|
|
import com.persagy.service.SObjectService
|
|
import com.persagy.service.SObjectService
|
|
import com.persagy.service.SPageContext
|
|
import com.persagy.service.SPageContext
|
|
import com.persagy.service.models.enums.SResponseType
|
|
import com.persagy.service.models.enums.SResponseType
|
|
|
|
+import com.persagy.service.utils.SSpringContextUtil
|
|
import org.springframework.stereotype.Service
|
|
import org.springframework.stereotype.Service
|
|
import java.text.SimpleDateFormat
|
|
import java.text.SimpleDateFormat
|
|
import java.util.*
|
|
import java.util.*
|
|
@@ -41,7 +44,11 @@ class ManualRelationCalcAddService {
|
|
private val rEq2SpService = SObjectService(SMybatisDao(REq2Sp::class.java))
|
|
private val rEq2SpService = SObjectService(SMybatisDao(REq2Sp::class.java))
|
|
/** 阀门限制设备关系 */
|
|
/** 阀门限制设备关系 */
|
|
private val rEq2EqService = SObjectService(SMybatisDao(REq2Eq::class.java))
|
|
private val rEq2EqService = SObjectService(SMybatisDao(REq2Eq::class.java))
|
|
|
|
+ /** RabbitMQ消息对象 */
|
|
|
|
|
|
|
|
+ val rabbitMqService by lazy {
|
|
|
|
+ SSpringContextUtil.getBean(RabbitMqService::class.java) as RabbitMqService
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
/**
|
|
* 添加关系
|
|
* 添加关系
|
|
@@ -151,6 +158,9 @@ class ManualRelationCalcAddService {
|
|
for (relZoneSpace in relZoneSpaceList) {
|
|
for (relZoneSpace in relZoneSpaceList) {
|
|
relZoneSpace.buildingId = buildingList[0].id
|
|
relZoneSpace.buildingId = buildingList[0].id
|
|
relZoneSpaceService.update(relZoneSpace)
|
|
relZoneSpaceService.update(relZoneSpace)
|
|
|
|
+
|
|
|
|
+ //rabbit同步
|
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, relationAddRequest.graphicType!!,relationAddRequest.relType!!,"11",relZoneSpace.buildingId!!,relZoneSpace.id!!)
|
|
}
|
|
}
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.message = "添加成功"
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -208,6 +218,8 @@ class ManualRelationCalcAddService {
|
|
relZoneSpace.floorId = floorList[0].id
|
|
relZoneSpace.floorId = floorList[0].id
|
|
relZoneSpace.buildingId = floorList[0].buildingId
|
|
relZoneSpace.buildingId = floorList[0].buildingId
|
|
relZoneSpaceService.update(relZoneSpace)
|
|
relZoneSpaceService.update(relZoneSpace)
|
|
|
|
+ //rabbit同步
|
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, relationAddRequest.graphicType!!,relationAddRequest.relType!!,"11",relZoneSpace.floorId!!,relZoneSpace.id!!)
|
|
}
|
|
}
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.message = "添加成功"
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -267,6 +279,8 @@ class ManualRelationCalcAddService {
|
|
val equipment = equipmentList[0]
|
|
val equipment = equipmentList[0]
|
|
equipment.buildingId = building.id
|
|
equipment.buildingId = building.id
|
|
EquipmentService.update(equipment)
|
|
EquipmentService.update(equipment)
|
|
|
|
+ //rabbit同步
|
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, relationAddRequest.graphicType!!,relationAddRequest.relType!!,"11",equipment.id!!,equipment.buildingId!!)
|
|
}
|
|
}
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.message = "添加成功"
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -327,6 +341,8 @@ class ManualRelationCalcAddService {
|
|
equipment.buildingId = floor.buildingId
|
|
equipment.buildingId = floor.buildingId
|
|
equipment.floorId = floor.id
|
|
equipment.floorId = floor.id
|
|
EquipmentService.update(equipment)
|
|
EquipmentService.update(equipment)
|
|
|
|
+ //rabbit同步
|
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, relationAddRequest.graphicType!!,relationAddRequest.relType!!,"11",equipment.id!!,equipment.floorId!!)
|
|
}
|
|
}
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.message = "添加成功"
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -459,6 +475,8 @@ class ManualRelationCalcAddService {
|
|
rSp2Sp.zoneType = relZoneSpace.classCode
|
|
rSp2Sp.zoneType = relZoneSpace.classCode
|
|
rSp2Sp.sign = 1
|
|
rSp2Sp.sign = 1
|
|
rSp2SpService.replace(rSp2Sp)
|
|
rSp2SpService.replace(rSp2Sp)
|
|
|
|
+ //rabbit同步
|
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, relationAddRequest.graphicType!!,relationAddRequest.relType!!,"11",rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
}
|
|
}
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.message = "添加成功"
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -514,6 +532,8 @@ class ManualRelationCalcAddService {
|
|
rEq2Sy.sign = 1
|
|
rEq2Sy.sign = 1
|
|
rEq2Sy.projectId = projectId
|
|
rEq2Sy.projectId = projectId
|
|
rEq2SyService.replace(rEq2Sy)
|
|
rEq2SyService.replace(rEq2Sy)
|
|
|
|
+ //rabbit同步
|
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, relationAddRequest.graphicType!!,relationAddRequest.relType!!,"11",rEq2Sy.id1!!,rEq2Sy.id2!!)
|
|
}
|
|
}
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.message = "添加成功"
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -588,6 +608,8 @@ class ManualRelationCalcAddService {
|
|
rEq2Sp.projectId = projectId
|
|
rEq2Sp.projectId = projectId
|
|
rEq2Sp.zoneType = zoneSpace.classCode
|
|
rEq2Sp.zoneType = zoneSpace.classCode
|
|
rEq2SpService.replace(rEq2Sp)
|
|
rEq2SpService.replace(rEq2Sp)
|
|
|
|
+ //rabbit同步
|
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, relationAddRequest.graphicType!!,relationAddRequest.relType!!,"11",rEq2Sp.id1!!,rEq2Sp.id2!!)
|
|
}
|
|
}
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.message = "添加成功"
|
|
sCreateResponse.message = "添加成功"
|