|
@@ -33,20 +33,14 @@ import com.persagy.mybatis.SMybatisDao
|
|
|
import com.persagy.server.Opt
|
|
|
import com.persagy.server.datacenter.datacenter.dao.mappers.SchemeMapper
|
|
|
import com.persagy.server.datacenter.datacenter.models.entities.dictnew.DefClass
|
|
|
-import com.persagy.server.datacenter.datacenter.models.entities.rel.REq2Sp
|
|
|
import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProject
|
|
|
import com.persagy.server.datacenter.datacenter.models.entities.graphtype.rel.RelZoneSpace
|
|
|
-import com.persagy.server.datacenter.datacenter.models.entities.rel.REq2Sy
|
|
|
+import com.persagy.server.datacenter.wanda.rel.REq2Sy
|
|
|
import com.persagy.server.datacenter.models.entities.graphtype.rel.*
|
|
|
-import com.persagy.server.datacenter.models.entities.graphtype.rel.control.*
|
|
|
-import com.persagy.server.datacenter.models.entities.graphtype.rel.drainage.*
|
|
|
-import com.persagy.server.datacenter.models.entities.graphtype.rel.electricity.*
|
|
|
-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.Building
|
|
|
import com.persagy.server.datacenter.wanda.obj.Equipment
|
|
@@ -55,8 +49,6 @@ import com.persagy.server.datacenter.wanda.rel.*
|
|
|
import com.persagy.server.datacenter.wanda.rel.RelGeneralSystem
|
|
|
import com.persagy.server.datacenter.wanda.response.ManualRelationCalcResponse
|
|
|
import com.persagy.server.jms.RabbitMqService
|
|
|
-import com.persagy.server.services.objects.*
|
|
|
-import com.persagy.server.services.rel.*
|
|
|
import com.persagy.service.SObjectService
|
|
|
import com.persagy.service.SPageContext
|
|
|
import com.persagy.service.models.SCascadeQuery
|
|
@@ -119,8 +111,14 @@ open class ManualRelationCalcService {
|
|
|
private val rSp2SpTwoService = SObjectService(SMybatisDao(RSp2SpTwo::class.java))
|
|
|
/** 系统和设备-系统 */
|
|
|
private val relSy2EqSystemService = SObjectService(SMybatisDao(RelSy2EqSystem::class.java))
|
|
|
-
|
|
|
-
|
|
|
+ /**系统下的设备 */
|
|
|
+ private val rEq2SyTwoService = SObjectService(SMybatisDao(REq2SyTwo::class.java))
|
|
|
+ /** 设备和空间 */
|
|
|
+ private val rEq2SpTwoService = SObjectService(SMybatisDao(REq2SpTwo::class.java))
|
|
|
+ /** 设备所在的空间-设备 */
|
|
|
+ private val relEq2SpEquipService = SObjectService(SMybatisDao(RelEq2SpEquip::class.java))
|
|
|
+ /** 设备和空间关系 */
|
|
|
+ private val rEq2SpService = SObjectService(SMybatisDao(REq2Sp::class.java))
|
|
|
|
|
|
|
|
|
/** 资产所在的空间 *******************************************************/
|
|
@@ -143,8 +141,7 @@ open class ManualRelationCalcService {
|
|
|
/** 设备和设备关系 */
|
|
|
private val rEq2EqService = SObjectService(SMybatisDao(REq2Eq::class.java))
|
|
|
|
|
|
- /** 设备和空间关系 */
|
|
|
- private val rEq2SpService = SObjectService(SMybatisDao(REq2Sp::class.java))
|
|
|
+
|
|
|
|
|
|
/** 空间 */
|
|
|
private val relZoneSpaceService = SObjectService(SMybatisDao(RelZoneSpace::class.java))
|
|
@@ -172,6 +169,7 @@ open class ManualRelationCalcService {
|
|
|
private val relGeneralSystemBuildingService = SObjectService(SMybatisDao(RelGeneralSystemBuilding::class.java))
|
|
|
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 查询关系数据
|
|
|
*/
|
|
@@ -335,7 +333,7 @@ open class ManualRelationCalcService {
|
|
|
} else if (manualRelationCalcRequest.graphicType == "ArchForArch" && manualRelationCalcRequest.relType == "Sp2Sp") {
|
|
|
return querySp2Sp(manualRelationCalcRequest)
|
|
|
} else if (manualRelationCalcRequest.graphicType == "MechSubset" && manualRelationCalcRequest.relType == "Sy2Eq") {
|
|
|
- return ManualRelationCalcResponse()
|
|
|
+ return querySy2Eq(manualRelationCalcRequest)
|
|
|
} else if (manualRelationCalcRequest.graphicType == "MechInArch" && manualRelationCalcRequest.relType == "Eq2Sp") {
|
|
|
return ManualRelationCalcResponse()
|
|
|
}else if (manualRelationCalcRequest.graphicType == "MechForArch" && manualRelationCalcRequest.relType == "Eq2Sp"){
|
|
@@ -1090,7 +1088,7 @@ open class ManualRelationCalcService {
|
|
|
/**
|
|
|
* 系统和设备
|
|
|
*/
|
|
|
- fun querySy2Eq(manualRelationCalcRequest: ManualRelationCalcRequest){
|
|
|
+ fun querySy2Eq(manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse{
|
|
|
val sQueryRequest = SQueryRequest()
|
|
|
if(manualRelationCalcRequest.pageNumber>0&&manualRelationCalcRequest.pageSize>0){
|
|
|
SQueryRequest.maxRow = 400000
|
|
@@ -1123,7 +1121,6 @@ open class ManualRelationCalcService {
|
|
|
if (!manualRelationCalcRequest.categoryFrom.isNullOrEmpty()) {
|
|
|
list.add(SFilter.eq("classCode",manualRelationCalcRequest.categoryFrom!!))
|
|
|
}
|
|
|
-
|
|
|
val pageQuery = relSy2EqSystemService.pageQuery(sQueryRequest, list)
|
|
|
manualRelationCalcResponse.content = pageQuery.content
|
|
|
manualRelationCalcResponse.message = pageQuery.message
|
|
@@ -1131,12 +1128,87 @@ open class ManualRelationCalcService {
|
|
|
manualRelationCalcResponse.pageSize = pageQuery.pageSize
|
|
|
manualRelationCalcResponse.result = pageQuery.result
|
|
|
manualRelationCalcResponse.total = pageQuery.total
|
|
|
- }else if (manualRelationCalcRequest.objectType == "2") {
|
|
|
+ }else if (manualRelationCalcRequest.objectType == "2" || manualRelationCalcRequest.objectType == "3" ) {
|
|
|
+ if (!manualRelationCalcRequest.categoryFrom.isNullOrEmpty()) {
|
|
|
+ list.add(SFilter.eq("classCode1",manualRelationCalcRequest.categoryTo!!))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueFrom.isNullOrEmpty()) {
|
|
|
+ list.add(SFilter.or(SFilter.contain("localName1",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localId1",manualRelationCalcRequest.vagueTo!!)
|
|
|
+ ,SFilter.contain("codeName1",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.categoryTo.isNullOrEmpty()) {
|
|
|
+ list.add(SFilter.eq("classCode2",manualRelationCalcRequest.categoryTo!!))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()) {
|
|
|
+ list.add(SFilter.or(SFilter.contain("codeName2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!)
|
|
|
+ ,SFilter.contain("classCode2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("systemCategotry",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rEq2SyTwoList = rEq2SyTwoService.select(list).exec()
|
|
|
+ if (rEq2SyTwoList.size>0) {
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rEq2SyTwo in rEq2SyTwoList) {
|
|
|
+ listId1.add(rEq2SyTwo.id1!!)
|
|
|
+ listId2.add(rEq2SyTwo.id2!!)
|
|
|
+ }
|
|
|
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ list.add(SFilter.eq("projectId",Opt.projectId!!))
|
|
|
+ val pageQuery = relSp2SpSpaceService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.content = pageQuery.content
|
|
|
+ manualRelationCalcResponse.message = pageQuery.message
|
|
|
+ manualRelationCalcResponse.pageNumber = pageQuery.pageNumber
|
|
|
+ manualRelationCalcResponse.pageSize = pageQuery.pageSize
|
|
|
+ manualRelationCalcResponse.result = pageQuery.result
|
|
|
+ manualRelationCalcResponse.total = pageQuery.total
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 空间和空间
|
|
|
+ */
|
|
|
+ fun queryEq2Sp(manualRelationCalcRequest: ManualRelationCalcRequest){
|
|
|
+ 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"
|
|
|
+ sCascadeQueryList.add(sCascadeQuery)
|
|
|
+ sQueryRequest.cascade = sCascadeQueryList
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ val list = ArrayList<SFilter>()
|
|
|
+ list.add(SFilter.eq("projectId",Opt.projectId!!))
|
|
|
+ val rEq2SpList = rEq2SpService.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("graphCode", manualRelationCalcRequest.graphicType!!), SFilter.eq("type", manualRelationCalcRequest.relType!!)
|
|
|
+ , SFilter.eq("zoneType", manualRelationCalcRequest.zoneType!!)).exec()
|
|
|
+ if (rEq2SpList.size>0) {
|
|
|
+ if (manualRelationCalcRequest.objectType == "1") {
|
|
|
|
|
|
+ }else if (manualRelationCalcRequest.objectType == "2" ||manualRelationCalcRequest.objectType == "3"){
|
|
|
|
|
|
- }else if (manualRelationCalcRequest.objectType == "3") {
|
|
|
+ } else {
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1146,6 +1218,7 @@ open class ManualRelationCalcService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
* 删除关系
|
|
|
*/
|
|
@@ -1219,6 +1292,9 @@ open class ManualRelationCalcService {
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
fun time():String {
|
|
|
val df = SimpleDateFormat("yyyy-MM-dd HH:mm:ss") //设置日期格式
|
|
|
println(df.format(Date())) // new Date()为获取当前系统时间
|