|
@@ -29,6 +29,7 @@ package com.persagy.server.services.relation_calc
|
|
|
import com.persagy.base.extensions.toJson
|
|
|
import com.persagy.database.SFilter
|
|
|
import com.persagy.mybatis.SMybatisDao
|
|
|
+import com.persagy.server.Opt
|
|
|
import com.persagy.server.datacenter.models.entities.dictnew.DefClass
|
|
|
import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProject
|
|
|
import com.persagy.server.datacenter.models.entities.graphtype.block.RelationAddRequest
|
|
@@ -42,6 +43,7 @@ import com.persagy.server.datacenter.models.requests.ManualRelationCalcDel
|
|
|
import com.persagy.server.datacenter.models.requests.ManualRelationCalcRequest
|
|
|
import com.persagy.server.datacenter.models.response.ManualRelationCalcResponse
|
|
|
import com.persagy.server.datacenter.models.response.ManualRelationCalcSCreateResponse
|
|
|
+import com.persagy.server.jms.RabbitMqService
|
|
|
import com.persagy.server.services.objects.*
|
|
|
import com.persagy.server.services.rel.*
|
|
|
import com.persagy.service.SObjectService
|
|
@@ -50,6 +52,7 @@ import com.persagy.service.models.SCascadeQuery
|
|
|
import com.persagy.service.models.enums.SResponseType
|
|
|
import com.persagy.service.models.requests.SQueryRequest
|
|
|
import com.persagy.service.models.responses.SBaseResponse
|
|
|
+import com.persagy.service.utils.SSpringContextUtil
|
|
|
import org.slf4j.LoggerFactory
|
|
|
import org.springframework.stereotype.Service
|
|
|
import java.text.SimpleDateFormat
|
|
@@ -65,6 +68,10 @@ open class ManualRelationCalcService {
|
|
|
companion object {
|
|
|
/** 日志 */
|
|
|
private val logger = LoggerFactory.getLogger(ManualRelationCalcService::class.java)
|
|
|
+ /** RabbitMQ消息对象 */
|
|
|
+ val rabbitMqService by lazy {
|
|
|
+ SSpringContextUtil.getBean(RabbitMqService::class.java) as RabbitMqService
|
|
|
+ }
|
|
|
} // Companion object
|
|
|
/** 资产服务 */
|
|
|
private val relPropertyService = SObjectService(SMybatisDao(RelProperty::class.java))
|
|
@@ -490,8 +497,14 @@ open class ManualRelationCalcService {
|
|
|
rEq2Sh.projectId = projectId
|
|
|
rEq2Sh.equipId = relProperty.id
|
|
|
rEq2Sh.sign = 1
|
|
|
- REqInShService.replace(rEq2Sh)
|
|
|
+ val replace = REqInShService.replace(rEq2Sh)
|
|
|
+ if (replace){
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "Eq2Sh","11",rEq2Sh.equipId!!,rEq2Sh.shaftId!!)
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
sCreateResponse.result = SResponseType.success
|
|
|
sCreateResponse.message = "添加成功"
|
|
|
return sCreateResponse
|
|
@@ -557,7 +570,11 @@ open class ManualRelationCalcService {
|
|
|
rEq2Fl.equipId = relEquipment.id
|
|
|
// rEq2Fl.type = "eq2fl_for"
|
|
|
rEq2Fl.sign = 1
|
|
|
- REqForFlService.replace(rEq2Fl)
|
|
|
+ val replace = REqForFlService.replace(rEq2Fl)
|
|
|
+ if (replace){
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "Eq2Fl","11",rEq2Fl.equipId!!,rEq2Fl.floorId!!)
|
|
|
+ }
|
|
|
}
|
|
|
sCreateResponse.result = SResponseType.success
|
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -625,6 +642,8 @@ open class ManualRelationCalcService {
|
|
|
// rEq2Bd.type = "eq2bd_for"
|
|
|
rEq2Bd.sign = 1
|
|
|
REqForBdService.replace(rEq2Bd)
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "Eq2Bd","11",rEq2Bd.equipId!!,rEq2Bd.buildingId!!)
|
|
|
}
|
|
|
sCreateResponse.result = SResponseType.success
|
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -690,6 +709,8 @@ open class ManualRelationCalcService {
|
|
|
rSy2Sp.type = "sy2sp_for"
|
|
|
rSy2Sp.sign = 1
|
|
|
rSy2SpService.replace(rSy2Sp)
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sy2sp_for","11", rSy2Sp.id1!!,rSy2Sp.id2!!)
|
|
|
}
|
|
|
sCreateResponse.result = SResponseType.success
|
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -753,7 +774,12 @@ open class ManualRelationCalcService {
|
|
|
rSy2Sh.sysId = relProperty.id
|
|
|
// rSy2Sh.type = "sy2sh_for"
|
|
|
rSy2Sh.sign = 1
|
|
|
- RSyForShService.replace(rSy2Sh)
|
|
|
+ val replace = RSyForShService.replace(rSy2Sh)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sy2sp_for","11", rSy2Sh.sysId!!,rSy2Sh.shaftId!!)
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
sCreateResponse.result = SResponseType.success
|
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -818,7 +844,11 @@ open class ManualRelationCalcService {
|
|
|
rSy2Fl.sysId = relEquipment.id
|
|
|
// rSy2Fl.type = "sy2fl_for"
|
|
|
rSy2Fl.sign = 1
|
|
|
- RSyForFlService.replace(rSy2Fl)
|
|
|
+ val replace = RSyForFlService.replace(rSy2Fl)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sy2fl_for","11", rSy2Fl.sysId!!,rSy2Fl.floorId!!)
|
|
|
+ }
|
|
|
}
|
|
|
sCreateResponse.result = SResponseType.success
|
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -880,7 +910,11 @@ open class ManualRelationCalcService {
|
|
|
rSy2Bd.projectId = projectId
|
|
|
rSy2Bd.sysId = relEquipment.id
|
|
|
rSy2Bd.sign = 1
|
|
|
- RSyForBdService.replace(rSy2Bd)
|
|
|
+ val replace = RSyForBdService.replace(rSy2Bd)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sy2bd_for","11", rSy2Bd.sysId!!,rSy2Bd.buildingId!!)
|
|
|
+ }
|
|
|
}
|
|
|
sCreateResponse.result = SResponseType.success
|
|
|
sCreateResponse.message = "添加成功"
|
|
@@ -967,7 +1001,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_ConvectionNetwork_1"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_ConvectionNetwork_1","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_ConvectionNetwork_2"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -978,7 +1016,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_ConvectionNetwork_2"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_ConvectionNetwork_2","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_ConvectionNetwork_3"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -989,7 +1031,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_ConvectionNetwork_3"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_ConvectionNetwork_3","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_SpaceNeighborhood_5"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1000,7 +1046,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_SpaceNeighborhood_5"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_SpaceNeighborhood_5","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_SpaceNeighborhood_2"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1011,7 +1061,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_SpaceNeighborhood_2"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_SpaceNeighborhood_2","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_SpaceNeighborhood_4"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1022,7 +1076,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_SpaceNeighborhood_4"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_SpaceNeighborhood_4","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_TrafficNetwork_3"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1033,7 +1091,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_TrafficNetwork_3"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_TrafficNetwork_3","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_TrafficNetwork_2"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1044,7 +1106,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_TrafficNetwork_2"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_TrafficNetwork_2","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_RadiationNetwork_1"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1055,7 +1121,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_RadiationNetwork_1"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_RadiationNetwork_1","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_RadiationNetwork_2"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1066,7 +1136,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_RadiationNetwork_2"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_RadiationNetwork_2","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_SpaceNeighborhood_1"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1077,7 +1151,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_SpaceNeighborhood_1"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_SpaceNeighborhood_1","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_TrafficNetwork_1"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1088,7 +1166,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_TrafficNetwork_1"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_TrafficNetwork_1","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}else if (relationAddRequest.relType == "sp2sp_SpaceNeighborhood_3"){
|
|
|
for (relZoneTo in relZoneToSpaceList) {
|
|
@@ -1099,7 +1181,11 @@ open class ManualRelationCalcService {
|
|
|
rSp2Sp.id2 = relZoneTo.id
|
|
|
rSp2Sp.type = "sp2sp_SpaceNeighborhood_3"
|
|
|
rSp2Sp.zoneType = relZoneSpace.objectType
|
|
|
- rSp2SpService.replace(rSp2Sp)
|
|
|
+ val replace = rSp2SpService.replace(rSp2Sp)
|
|
|
+ if (replace) {
|
|
|
+ /** 发送消息 */
|
|
|
+ rabbitMqService.sendRel(Opt.projectId!!, "sp2sp_SpaceNeighborhood_3","11", rSp2Sp.id1!!,rSp2Sp.id2!!)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
sCreateResponse.result = SResponseType.success
|