|
@@ -45,11 +45,11 @@ import com.persagy.server.datacenter.models.entities.graphtype.rel.hvac.*
|
|
|
import com.persagy.server.datacenter.models.entities.rel.*
|
|
|
import com.persagy.server.datacenter.models.requests.ManualRelationCalcDel
|
|
|
import com.persagy.server.datacenter.datacenter.models.requests.ManualRelationCalcRequest
|
|
|
+import com.persagy.server.datacenter.models.entities.graphtype.rel.RelFloor
|
|
|
+import com.persagy.server.datacenter.services.objects.BuildingService
|
|
|
+import com.persagy.server.datacenter.services.objects.EquipmentService
|
|
|
import com.persagy.server.datacenter.wanda.obj.Equipment
|
|
|
-import com.persagy.server.datacenter.wanda.rel.REq2Eq
|
|
|
-import com.persagy.server.datacenter.wanda.rel.RSp2Sp
|
|
|
-import com.persagy.server.datacenter.wanda.rel.RSy2Sp
|
|
|
-import com.persagy.server.datacenter.wanda.rel.RelEq2BdEquip
|
|
|
+import com.persagy.server.datacenter.wanda.rel.*
|
|
|
import com.persagy.server.datacenter.wanda.response.ManualRelationCalcResponse
|
|
|
import com.persagy.server.jms.RabbitMqService
|
|
|
import com.persagy.server.services.objects.*
|
|
@@ -60,7 +60,6 @@ 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.models.responses.SQueryResponse
|
|
|
import com.persagy.service.utils.SSpringContextUtil
|
|
|
import org.slf4j.LoggerFactory
|
|
|
import org.springframework.stereotype.Service
|
|
@@ -94,7 +93,13 @@ open class ManualRelationCalcService {
|
|
|
|
|
|
/** 设备建筑 设备 */
|
|
|
private val relEquipBuildingService = SObjectService(SMybatisDao(RelEq2BdEquip::class.java))
|
|
|
+ /** 设备级联楼层 */
|
|
|
+ private val relEquipFloorService = SObjectService(SMybatisDao(RelEq2FlEquip::class.java))
|
|
|
+ /** 关系建筑 */
|
|
|
private val relBuildingService = SObjectService(SMybatisDao(RelBuilding::class.java))
|
|
|
+ /** 关系楼层 */
|
|
|
+ private val relFloorService = SObjectService(SMybatisDao(RelFloor::class.java))
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -152,174 +157,313 @@ open class ManualRelationCalcService {
|
|
|
/**
|
|
|
* 查询关系数据
|
|
|
*/
|
|
|
- fun query(manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
-
|
|
|
- try {
|
|
|
- /** 项目id */
|
|
|
- val projectId = SPageContext.getHeader("ProjectId")
|
|
|
- val list = ArrayList<SFilter>()
|
|
|
- list.add(SFilter.eq("projectId",projectId!!))
|
|
|
- /** 模糊查询 */
|
|
|
- if(!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
- list.add( SFilter.or(SFilter.contain("id",manualRelationCalcRequest.vague!!),SFilter.contain("name",manualRelationCalcRequest.vague!!)
|
|
|
- ,SFilter.contain("localName",manualRelationCalcRequest.vague!!),SFilter.contain("localId",manualRelationCalcRequest.vague!!)))
|
|
|
- }
|
|
|
-
|
|
|
- val sQueryRequest = SQueryRequest()
|
|
|
-
|
|
|
- if(manualRelationCalcRequest.pageNumber>0&&manualRelationCalcRequest.pageSize>0){
|
|
|
- SQueryRequest.maxRow = 400000
|
|
|
- sQueryRequest.pageSize= manualRelationCalcRequest.pageSize
|
|
|
- sQueryRequest.pageNumber = manualRelationCalcRequest.pageNumber
|
|
|
- }else{
|
|
|
- /** 控制条数 */
|
|
|
- SQueryRequest.maxRow = 100000
|
|
|
- sQueryRequest.pageSize= 100000
|
|
|
- }
|
|
|
- val sCascadeQueryList = ArrayList<SCascadeQuery>()
|
|
|
- /** 级联资产 */
|
|
|
- val sCascadeQuery = SCascadeQuery()
|
|
|
- sCascadeQuery.name = "objectInfo"
|
|
|
- if (!manualRelationCalcRequest.category.isNullOrEmpty()) {
|
|
|
- sCascadeQuery.filters = "zoneType = '${manualRelationCalcRequest.category}'"
|
|
|
- }
|
|
|
- sCascadeQueryList.add(sCascadeQuery)
|
|
|
- sQueryRequest.cascade = sCascadeQueryList
|
|
|
+// fun query(manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+//
|
|
|
+// try {
|
|
|
+// /** 项目id */
|
|
|
+// val projectId = SPageContext.getHeader("ProjectId")
|
|
|
+// val list = ArrayList<SFilter>()
|
|
|
+// list.add(SFilter.eq("projectId",projectId!!))
|
|
|
+// /** 模糊查询 */
|
|
|
+// if(!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+// list.add( SFilter.or(SFilter.contain("id",manualRelationCalcRequest.vague!!),SFilter.contain("name",manualRelationCalcRequest.vague!!)
|
|
|
+// ,SFilter.contain("localName",manualRelationCalcRequest.vague!!),SFilter.contain("localId",manualRelationCalcRequest.vague!!)))
|
|
|
+// }
|
|
|
+//
|
|
|
+// val sQueryRequest = SQueryRequest()
|
|
|
+//
|
|
|
+// if(manualRelationCalcRequest.pageNumber>0&&manualRelationCalcRequest.pageSize>0){
|
|
|
+// SQueryRequest.maxRow = 400000
|
|
|
+// sQueryRequest.pageSize= manualRelationCalcRequest.pageSize
|
|
|
+// sQueryRequest.pageNumber = manualRelationCalcRequest.pageNumber
|
|
|
+// }else{
|
|
|
+// /** 控制条数 */
|
|
|
+// SQueryRequest.maxRow = 100000
|
|
|
+// sQueryRequest.pageSize= 100000
|
|
|
+// }
|
|
|
+// val sCascadeQueryList = ArrayList<SCascadeQuery>()
|
|
|
+// /** 级联资产 */
|
|
|
+// val sCascadeQuery = SCascadeQuery()
|
|
|
+// sCascadeQuery.name = "objectInfo"
|
|
|
+// if (!manualRelationCalcRequest.category.isNullOrEmpty()) {
|
|
|
+// sCascadeQuery.filters = "zoneType = '${manualRelationCalcRequest.category}'"
|
|
|
+// }
|
|
|
+// sCascadeQueryList.add(sCascadeQuery)
|
|
|
+// sQueryRequest.cascade = sCascadeQueryList
|
|
|
+//
|
|
|
+//
|
|
|
+// if (manualRelationCalcRequest.graphicType == "ArchSubset" && manualRelationCalcRequest.relType == "Bd2Sp") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "ArchSubset" && manualRelationCalcRequest.relType == "Fl2Sp") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Bd") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Fl") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "ArchForArch" && manualRelationCalcRequest.relType == "Sp2Sp") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "MechSubset" && manualRelationCalcRequest.relType == "Sy2Eq") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Sp") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "MechForArch" && manualRelationCalcRequest.relType == "Eq2Sp") {
|
|
|
+//
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (manualRelationCalcRequest.relType == "pe2sp"){
|
|
|
+// /** 资产所在业务空间 */
|
|
|
+// return queryPe2Sp(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "pe2sh"){
|
|
|
+// /** 资产所在竖井 */
|
|
|
+// return queryPe2Sh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "eq2sh_for"){
|
|
|
+// /** 设备服务于竖井 */
|
|
|
+// return queryEqForSh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "eq2fl_for"){
|
|
|
+// /** 设备服务于楼层 */
|
|
|
+// return queryEqForFl(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "eq2bd_for"){
|
|
|
+// /** 设备服务于建筑 */
|
|
|
+// return queryEqForBd(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "sy2sp_for"){
|
|
|
+// /** 系统服务于业务空间 */
|
|
|
+// return querySyForSp(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if(manualRelationCalcRequest.relType == "sy2sh_for"){
|
|
|
+// /** 系统服务于竖井 */
|
|
|
+// return querySyForSh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "sy2fl_for"){
|
|
|
+// /** 系统服务于楼层 */
|
|
|
+// return querySyForFl(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "sy2bd_for"){
|
|
|
+// /** 系统服务于建筑 */
|
|
|
+// return querySyForBd(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "sp2sp_ConvectionNetwork_1"||manualRelationCalcRequest.relType == "sp2sp_ConvectionNetwork_2"||manualRelationCalcRequest.relType == "sp2sp_ConvectionNetwork_3"
|
|
|
+// ||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_5"||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_2"||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_4"
|
|
|
+// ||manualRelationCalcRequest.relType == "sp2sp_TrafficNetwork_3"||manualRelationCalcRequest.relType == "sp2sp_TrafficNetwork_2"||manualRelationCalcRequest.relType == "sp2sp_RadiationNetwork_1"
|
|
|
+// ||manualRelationCalcRequest.relType == "sp2sp_RadiationNetwork_2"||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_1"||manualRelationCalcRequest.relType == "sp2sp_TrafficNetwork_1"
|
|
|
+// ||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_3" ){
|
|
|
+// /** 空间 空气自然对流 */
|
|
|
+// return querySpAirConvection(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "eq2eq_LUDistribution_1"||manualRelationCalcRequest.relType == "eq2eq_LUDistribution_2"||manualRelationCalcRequest.relType == "eq2eq_HUDistribution_1"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_HUDistribution_2"||manualRelationCalcRequest.relType == "eq2eq_EquipPower_1"||manualRelationCalcRequest.relType == "eq2eq_EquipPower_2"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_EquipPower_3"||manualRelationCalcRequest.relType == "eq2eq_EquipPower_4"){
|
|
|
+// /** 系统备用电源 */ /** 强电类 */
|
|
|
+// return queryElectricity(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// } else if (manualRelationCalcRequest.relType == "eq2eq_ACAirNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_ACAirNetwork_3"||manualRelationCalcRequest.relType == "eq2eq_ACAirNetwork_2"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_ChillWaterLoop_4"|| manualRelationCalcRequest.relType == "eq2eq_ChillWaterLoop_1"||manualRelationCalcRequest.relType == "eq2eq_ChillWaterLoop_3"
|
|
|
+// || manualRelationCalcRequest.relType == "eq2eq_ChillWaterLoop_2"||manualRelationCalcRequest.relType == "eq2eq_CondWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_CoolingWaterLoop_4"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_CoolingWaterLoop_1"||manualRelationCalcRequest.relType == "eq2eq_CoolingWaterLoop_3"||manualRelationCalcRequest.relType == "eq2eq_CoolingWaterLoop_2"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eqFreshAirNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_HeatWaterLoop_4"||manualRelationCalcRequest.relType == "eq2eq_HeatWaterLoop_1"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_HeatWaterLoop_3"||manualRelationCalcRequest.relType == "eq2eq_HeatWaterLoop_2"||manualRelationCalcRequest.relType == "eq2eq_VentNetwork_1"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_VentNetwork_3"||manualRelationCalcRequest.relType == "eq2eq_VentNetwork_2"||manualRelationCalcRequest.relType == "eq2eq_VRFNetwork_1"){
|
|
|
+// /** 暖通空调类 */
|
|
|
+// return hvac(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "eq2eq_SupplyWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_SupplyWaterNetwork_2"||manualRelationCalcRequest.relType == "eq2eq_DrainingWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_DrainingWaterNetwork_2"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_DrinkingWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_DrinkingWaterNetwork_2"||manualRelationCalcRequest.relType == "eq2eq_DHWNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_DHWNetwork_2"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_GasNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_GasNetwork_2"||manualRelationCalcRequest.relType == "eq2eq_FireWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_FireWaterNetwork_2"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_FireVentNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_RecycleWaterNetwork_1" ||manualRelationCalcRequest.relType == "eq2eq_RecycleWaterNetwork_2"){
|
|
|
+// /** 给排水类 和 消防类 */
|
|
|
+// return drainage(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "eq2eq_SensorNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_ControlRelation_1"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2eq_SensorRelationship_ss2eq"||manualRelationCalcRequest.relType == "eq2eq_ValveRelationship_vv2eq"||manualRelationCalcRequest.relType =="eq2eq_ControlEquipNetwork"){
|
|
|
+// /** 测控类 */
|
|
|
+// return control(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "eq2eq_ControlRelation_2"||manualRelationCalcRequest.relType == "eq2sy_SensorRelationship_ss2sy"
|
|
|
+// ||manualRelationCalcRequest.relType == "eq2sy_ValveRelationship_vv2sy"){
|
|
|
+// /** 测控类 */
|
|
|
+// return controlSy(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if(manualRelationCalcRequest.relType == "eq2sp_SensorRelationship_ss2sp"){
|
|
|
+// return ss2sps(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else if (manualRelationCalcRequest.relType == "eq2sp_x"){
|
|
|
+// return eq2spsOther(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+// }else{
|
|
|
+// /** 暂无数据 */
|
|
|
+// val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+// manualRelationCalcResponse.result = SResponseType.success
|
|
|
+// manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+// return manualRelationCalcResponse
|
|
|
+// }
|
|
|
+// /** 暂无数据 */
|
|
|
+// val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+// manualRelationCalcResponse.result = SResponseType.success
|
|
|
+// manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+// return manualRelationCalcResponse
|
|
|
+// } catch (e: Exception) {
|
|
|
+// e.printStackTrace()
|
|
|
+// val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+// manualRelationCalcResponse.result = SResponseType.failure
|
|
|
+// manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+// manualRelationCalcResponse.message = e.message.toString()
|
|
|
+// return manualRelationCalcResponse
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
|
|
|
- if (manualRelationCalcRequest.graphicType == "ArchSubset" && manualRelationCalcRequest.relType == "Bd2Sp") {
|
|
|
+ fun queryRel(manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "ArchSubset" && manualRelationCalcRequest.relType == "Fl2Sp") {
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Bd") {
|
|
|
+// if (manualRelationCalcRequest.graphicType == "ArchSubset" && manualRelationCalcRequest.relType == "Bd2Sp") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "ArchSubset" && manualRelationCalcRequest.relType == "Fl2Sp") {
|
|
|
+//
|
|
|
+// } else
|
|
|
+ if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Bd") {
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Fl") {
|
|
|
+ return queryEq2Bd(manualRelationCalcRequest)
|
|
|
+ }
|
|
|
+// else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Fl") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "ArchForArch" && manualRelationCalcRequest.relType == "Sp2Sp") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "MechSubset" && manualRelationCalcRequest.relType == "Sy2Eq") {
|
|
|
+//
|
|
|
+// } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Sp") {
|
|
|
+//
|
|
|
+// }
|
|
|
+ return ManualRelationCalcResponse()
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "ArchForArch" && manualRelationCalcRequest.relType == "Sp2Sp") {
|
|
|
+ }
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "MechSubset" && manualRelationCalcRequest.relType == "Sy2Eq") {
|
|
|
+ /**
|
|
|
+ * 设备所在建筑查询
|
|
|
+ */
|
|
|
+ fun queryEq2Bd(manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+ val sQueryRequest = SQueryRequest()
|
|
|
+ if(manualRelationCalcRequest.pageNumber>0&&manualRelationCalcRequest.pageSize>0){
|
|
|
+ SQueryRequest.maxRow = 400000
|
|
|
+ sQueryRequest.pageSize= manualRelationCalcRequest.pageSize
|
|
|
+ sQueryRequest.pageNumber = manualRelationCalcRequest.pageNumber
|
|
|
+ }else{
|
|
|
+ /** 控制条数 */
|
|
|
+ SQueryRequest.maxRow = 100000
|
|
|
+ sQueryRequest.pageSize= 100000
|
|
|
+ }
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Sp") {
|
|
|
+ val sCascadeQueryList = ArrayList<SCascadeQuery>()
|
|
|
+ /** 级联资产 */
|
|
|
+ val sCascadeQuery = SCascadeQuery()
|
|
|
+ sCascadeQuery.name = "objectInfo"
|
|
|
+ sCascadeQueryList.add(sCascadeQuery)
|
|
|
+ sQueryRequest.cascade = sCascadeQueryList
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "MechForArch" && manualRelationCalcRequest.relType == "Eq2Sp") {
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ val list = ArrayList<SFilter>()
|
|
|
+ list.add(SFilter.eq("projectId",Opt.projectId!!))
|
|
|
+ if (manualRelationCalcRequest.objectType == "1") {
|
|
|
|
|
|
+ list.add(SFilter.not(SFilter.isNull("buildingId")))
|
|
|
+ /** 模糊查询 */
|
|
|
+ if(!manualRelationCalcRequest.vagueFrom.isNullOrEmpty()){
|
|
|
+ list.add( SFilter.or(SFilter.contain("id",manualRelationCalcRequest.vagueFrom!!),SFilter.contain("name",manualRelationCalcRequest.vagueFrom!!)
|
|
|
+ ,SFilter.contain("localName",manualRelationCalcRequest.vagueFrom!!),SFilter.contain("localId",manualRelationCalcRequest.vagueFrom!!)))
|
|
|
}
|
|
|
-
|
|
|
- if (manualRelationCalcRequest.relType == "pe2sp"){
|
|
|
- /** 资产所在业务空间 */
|
|
|
- return queryPe2Sp(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "pe2sh"){
|
|
|
- /** 资产所在竖井 */
|
|
|
- return queryPe2Sh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "eq2sh_for"){
|
|
|
- /** 设备服务于竖井 */
|
|
|
- return queryEqForSh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "eq2fl_for"){
|
|
|
- /** 设备服务于楼层 */
|
|
|
- return queryEqForFl(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "eq2bd_for"){
|
|
|
- /** 设备服务于建筑 */
|
|
|
- return queryEqForBd(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "sy2sp_for"){
|
|
|
- /** 系统服务于业务空间 */
|
|
|
- return querySyForSp(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if(manualRelationCalcRequest.relType == "sy2sh_for"){
|
|
|
- /** 系统服务于竖井 */
|
|
|
- return querySyForSh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "sy2fl_for"){
|
|
|
- /** 系统服务于楼层 */
|
|
|
- return querySyForFl(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "sy2bd_for"){
|
|
|
- /** 系统服务于建筑 */
|
|
|
- return querySyForBd(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "sp2sp_ConvectionNetwork_1"||manualRelationCalcRequest.relType == "sp2sp_ConvectionNetwork_2"||manualRelationCalcRequest.relType == "sp2sp_ConvectionNetwork_3"
|
|
|
- ||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_5"||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_2"||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_4"
|
|
|
- ||manualRelationCalcRequest.relType == "sp2sp_TrafficNetwork_3"||manualRelationCalcRequest.relType == "sp2sp_TrafficNetwork_2"||manualRelationCalcRequest.relType == "sp2sp_RadiationNetwork_1"
|
|
|
- ||manualRelationCalcRequest.relType == "sp2sp_RadiationNetwork_2"||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_1"||manualRelationCalcRequest.relType == "sp2sp_TrafficNetwork_1"
|
|
|
- ||manualRelationCalcRequest.relType == "sp2sp_SpaceNeighborhood_3" ){
|
|
|
- /** 空间 空气自然对流 */
|
|
|
- return querySpAirConvection(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "eq2eq_LUDistribution_1"||manualRelationCalcRequest.relType == "eq2eq_LUDistribution_2"||manualRelationCalcRequest.relType == "eq2eq_HUDistribution_1"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_HUDistribution_2"||manualRelationCalcRequest.relType == "eq2eq_EquipPower_1"||manualRelationCalcRequest.relType == "eq2eq_EquipPower_2"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_EquipPower_3"||manualRelationCalcRequest.relType == "eq2eq_EquipPower_4"){
|
|
|
- /** 系统备用电源 */ /** 强电类 */
|
|
|
- return queryElectricity(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- } else if (manualRelationCalcRequest.relType == "eq2eq_ACAirNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_ACAirNetwork_3"||manualRelationCalcRequest.relType == "eq2eq_ACAirNetwork_2"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_ChillWaterLoop_4"|| manualRelationCalcRequest.relType == "eq2eq_ChillWaterLoop_1"||manualRelationCalcRequest.relType == "eq2eq_ChillWaterLoop_3"
|
|
|
- || manualRelationCalcRequest.relType == "eq2eq_ChillWaterLoop_2"||manualRelationCalcRequest.relType == "eq2eq_CondWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_CoolingWaterLoop_4"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_CoolingWaterLoop_1"||manualRelationCalcRequest.relType == "eq2eq_CoolingWaterLoop_3"||manualRelationCalcRequest.relType == "eq2eq_CoolingWaterLoop_2"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eqFreshAirNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_HeatWaterLoop_4"||manualRelationCalcRequest.relType == "eq2eq_HeatWaterLoop_1"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_HeatWaterLoop_3"||manualRelationCalcRequest.relType == "eq2eq_HeatWaterLoop_2"||manualRelationCalcRequest.relType == "eq2eq_VentNetwork_1"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_VentNetwork_3"||manualRelationCalcRequest.relType == "eq2eq_VentNetwork_2"||manualRelationCalcRequest.relType == "eq2eq_VRFNetwork_1"){
|
|
|
- /** 暖通空调类 */
|
|
|
- return hvac(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "eq2eq_SupplyWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_SupplyWaterNetwork_2"||manualRelationCalcRequest.relType == "eq2eq_DrainingWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_DrainingWaterNetwork_2"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_DrinkingWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_DrinkingWaterNetwork_2"||manualRelationCalcRequest.relType == "eq2eq_DHWNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_DHWNetwork_2"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_GasNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_GasNetwork_2"||manualRelationCalcRequest.relType == "eq2eq_FireWaterNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_FireWaterNetwork_2"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_FireVentNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_RecycleWaterNetwork_1" ||manualRelationCalcRequest.relType == "eq2eq_RecycleWaterNetwork_2"){
|
|
|
- /** 给排水类 和 消防类 */
|
|
|
- return drainage(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "eq2eq_SensorNetwork_1"||manualRelationCalcRequest.relType == "eq2eq_ControlRelation_1"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2eq_SensorRelationship_ss2eq"||manualRelationCalcRequest.relType == "eq2eq_ValveRelationship_vv2eq"||manualRelationCalcRequest.relType =="eq2eq_ControlEquipNetwork"){
|
|
|
- /** 测控类 */
|
|
|
- return control(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "eq2eq_ControlRelation_2"||manualRelationCalcRequest.relType == "eq2sy_SensorRelationship_ss2sy"
|
|
|
- ||manualRelationCalcRequest.relType == "eq2sy_ValveRelationship_vv2sy"){
|
|
|
- /** 测控类 */
|
|
|
- return controlSy(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if(manualRelationCalcRequest.relType == "eq2sp_SensorRelationship_ss2sp"){
|
|
|
- return ss2sps(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else if (manualRelationCalcRequest.relType == "eq2sp_x"){
|
|
|
- return eq2spsOther(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else{
|
|
|
- /** 暂无数据 */
|
|
|
- val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
- manualRelationCalcResponse.result = SResponseType.success
|
|
|
- manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
- return manualRelationCalcResponse
|
|
|
+ if (!manualRelationCalcRequest.categoryFrom.isNullOrEmpty()) {
|
|
|
+ list.add(SFilter.eq("classCode",manualRelationCalcRequest.categoryFrom!!))
|
|
|
}
|
|
|
- /** 暂无数据 */
|
|
|
- val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
- manualRelationCalcResponse.result = SResponseType.success
|
|
|
- manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
- return manualRelationCalcResponse
|
|
|
- } catch (e: Exception) {
|
|
|
- e.printStackTrace()
|
|
|
- val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
- manualRelationCalcResponse.result = SResponseType.failure
|
|
|
- manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
- manualRelationCalcResponse.message = e.message.toString()
|
|
|
+ val pageQuery = relEquipBuildingService.pageQuery(sQueryRequest,list)
|
|
|
+ manualRelationCalcResponse.content = pageQuery.content
|
|
|
+ manualRelationCalcResponse.message = pageQuery.message
|
|
|
+ manualRelationCalcResponse.pageNumber = pageQuery.pageNumber
|
|
|
+ manualRelationCalcResponse.pageSize = pageQuery.pageSize
|
|
|
+ manualRelationCalcResponse.result = pageQuery.result
|
|
|
+ manualRelationCalcResponse.total = pageQuery.total
|
|
|
+
|
|
|
return manualRelationCalcResponse
|
|
|
- }
|
|
|
- }
|
|
|
+ }else if (manualRelationCalcRequest.objectType == "2"){
|
|
|
|
|
|
+ if (!manualRelationCalcRequest.vagueFrom.isNullOrEmpty()) {
|
|
|
+ val relEquipBuildingList = relEquipBuildingService.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.not(SFilter.isNull("buildingId"))).exec()
|
|
|
+ if (relEquipBuildingList.size>0) {
|
|
|
|
|
|
- fun query(manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+ val buildingIdList = schemeMapper.buildingId(Opt.projectId!!)
|
|
|
+ val listId = ArrayList<String>()
|
|
|
+ for (buildingId in buildingIdList) {
|
|
|
+ listId.add(buildingId.id!!)
|
|
|
+ }
|
|
|
|
|
|
+ val relBuildinglist = relBuildingService.select(SFilter.inList("id", listId), SFilter.contain("localName", manualRelationCalcRequest.vagueFrom!!)).exec()
|
|
|
+ if (relBuildinglist.size>0) {
|
|
|
+ val listIds = ArrayList<String>()
|
|
|
+ for (building in relBuildinglist) {
|
|
|
+ listIds.add(building.id!!)
|
|
|
+ }
|
|
|
+ list.add(SFilter.inList("buildingId",listIds))
|
|
|
+ val pageQuery = relEquipBuildingService.pageQuery(sQueryRequest,list)
|
|
|
+ manualRelationCalcResponse.content = pageQuery.content
|
|
|
+ manualRelationCalcResponse.message = pageQuery.message
|
|
|
+ manualRelationCalcResponse.pageNumber = pageQuery.pageNumber
|
|
|
+ manualRelationCalcResponse.pageSize = pageQuery.pageSize
|
|
|
+ manualRelationCalcResponse.result = pageQuery.result
|
|
|
+ manualRelationCalcResponse.total = pageQuery.total
|
|
|
|
|
|
- if (manualRelationCalcRequest.graphicType == "ArchSubset" && manualRelationCalcRequest.relType == "Bd2Sp") {
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "ArchSubset" && manualRelationCalcRequest.relType == "Fl2Sp") {
|
|
|
+ }else if (manualRelationCalcRequest.objectType == "3") {
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Bd") {
|
|
|
+ val listType = ArrayList<SFilter>()
|
|
|
+ /** 模糊查询 */
|
|
|
+ if(!manualRelationCalcRequest.vagueFrom.isNullOrEmpty()){
|
|
|
+ listType.add( SFilter.or(SFilter.contain("id",manualRelationCalcRequest.vagueFrom!!),SFilter.contain("name",manualRelationCalcRequest.vagueFrom!!)
|
|
|
+ ,SFilter.contain("localName",manualRelationCalcRequest.vagueFrom!!),SFilter.contain("localId",manualRelationCalcRequest.vagueFrom!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.categoryFrom.isNullOrEmpty()) {
|
|
|
+ listType.add(SFilter.eq("classCode",manualRelationCalcRequest.categoryFrom!!))
|
|
|
+ }
|
|
|
+ listType.add(SFilter.not(SFilter.isNull("buildingId")))
|
|
|
+ val relEquipBuildingList = relEquipBuildingService.select(listType).exec()
|
|
|
+ if (relEquipBuildingList.size>0) {
|
|
|
|
|
|
- return queryEq2Bd(manualRelationCalcRequest)
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Fl") {
|
|
|
+ val relBuildinglist = relBuildingService.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.contain("localName", manualRelationCalcRequest.vagueFrom!!)).exec()
|
|
|
+ if (relBuildinglist.size>0) {
|
|
|
+ val listIds = ArrayList<String>()
|
|
|
+ for (building in relBuildinglist) {
|
|
|
+ listIds.add(building.id!!)
|
|
|
+ }
|
|
|
+ val listEquipIds = ArrayList<String>()
|
|
|
+ for (relEquipBuilding in relEquipBuildingList) {
|
|
|
+ listEquipIds.add(relEquipBuilding.id!!)
|
|
|
+ }
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "ArchForArch" && manualRelationCalcRequest.relType == "Sp2Sp") {
|
|
|
+ list.add(SFilter.inList("buildingId",listIds))
|
|
|
+ list.add(SFilter.inList("id",listEquipIds))
|
|
|
+ val pageQuery = relEquipBuildingService.pageQuery(sQueryRequest,list)
|
|
|
+ manualRelationCalcResponse.content = pageQuery.content
|
|
|
+ manualRelationCalcResponse.message = pageQuery.message
|
|
|
+ manualRelationCalcResponse.pageNumber = pageQuery.pageNumber
|
|
|
+ manualRelationCalcResponse.pageSize = pageQuery.pageSize
|
|
|
+ manualRelationCalcResponse.result = pageQuery.result
|
|
|
+ manualRelationCalcResponse.total = pageQuery.total
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "MechSubset" && manualRelationCalcRequest.relType == "Sy2Eq") {
|
|
|
|
|
|
- } else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Sp") {
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
+ return manualRelationCalcResponse
|
|
|
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 设备所在建筑查询
|
|
|
- */
|
|
|
- fun queryEq2Bd(manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+ fun queryEq2Fl(manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
val sQueryRequest = SQueryRequest()
|
|
|
if(manualRelationCalcRequest.pageNumber>0&&manualRelationCalcRequest.pageSize>0){
|
|
|
SQueryRequest.maxRow = 400000
|
|
@@ -414,17 +558,48 @@ open class ManualRelationCalcService {
|
|
|
if (!manualRelationCalcRequest.categoryFrom.isNullOrEmpty()) {
|
|
|
listType.add(SFilter.eq("classCode",manualRelationCalcRequest.categoryFrom!!))
|
|
|
}
|
|
|
- relEquipBuildingService
|
|
|
+ listType.add(SFilter.not(SFilter.isNull("buildingId")))
|
|
|
+ val relEquipBuildingList = relEquipBuildingService.select(listType).exec()
|
|
|
+ if (relEquipBuildingList.size>0) {
|
|
|
+
|
|
|
+ val relBuildinglist = relBuildingService.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.contain("localName", manualRelationCalcRequest.vagueFrom!!)).exec()
|
|
|
+ if (relBuildinglist.size>0) {
|
|
|
+ val listIds = ArrayList<String>()
|
|
|
+ for (building in relBuildinglist) {
|
|
|
+ listIds.add(building.id!!)
|
|
|
+ }
|
|
|
+ val listEquipIds = ArrayList<String>()
|
|
|
+ for (relEquipBuilding in relEquipBuildingList) {
|
|
|
+ listEquipIds.add(relEquipBuilding.id!!)
|
|
|
+ }
|
|
|
+
|
|
|
+ list.add(SFilter.inList("buildingId",listIds))
|
|
|
+ list.add(SFilter.inList("id",listEquipIds))
|
|
|
+ val pageQuery = relEquipBuildingService.pageQuery(sQueryRequest,list)
|
|
|
+ manualRelationCalcResponse.content = pageQuery.content
|
|
|
+ manualRelationCalcResponse.message = pageQuery.message
|
|
|
+ manualRelationCalcResponse.pageNumber = pageQuery.pageNumber
|
|
|
+ manualRelationCalcResponse.pageSize = pageQuery.pageSize
|
|
|
+ manualRelationCalcResponse.result = pageQuery.result
|
|
|
+ manualRelationCalcResponse.total = pageQuery.total
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
|
|
|
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
+ return manualRelationCalcResponse
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
/**
|
|
|
* 删除关系
|
|
|
*/
|