|
@@ -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
|
|
@@ -43,6 +44,7 @@ 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.base.CommonServices
|
|
|
import com.persagy.server.services.objects.*
|
|
|
import com.persagy.server.services.rel.*
|
|
|
import com.persagy.service.SObjectService
|
|
@@ -226,7 +228,39 @@ open class ManualRelationCalcService {
|
|
|
return ss2sps(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
}else if (manualRelationCalcRequest.relType == "eq2sp_x"){
|
|
|
return eq2spsOther(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
- }else{
|
|
|
+ }else if (manualRelationCalcRequest.relType == "bd2bd_ArchForArch"){
|
|
|
+ return queryBd2Bd(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "bd2fl_ArchForArch"){
|
|
|
+ return queryBd2Fl(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "bd2sh_ArchForArch"){
|
|
|
+ return queryBd2Sh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "bd2sp_ArchForArch"){
|
|
|
+ return queryBd2Sp(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "fl2bd_ArchForArch"){
|
|
|
+ return queryFl2Bd(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "fl2fl_ArchForArch"){
|
|
|
+ return queryFl2Fl(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "fl2sh_ArchForArch"){
|
|
|
+ return queryFl2Sh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "fl2sp_ArchForArch"){
|
|
|
+ return queryFl2Sp(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "sh2bd_ArchForArch"){
|
|
|
+ rreturn querySh2Bd(projectId,list,sQueryRequest,manualRelationCalcRequest)eturn ManualRelationCalcResponse()
|
|
|
+ }else if(manualRelationCalcRequest.relType == "sh2fl_ArchForArch"){
|
|
|
+ return querySh2Fl(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "sh2sh_ArchForArch"){
|
|
|
+ return querySh2Sh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "sh2sp_ArchForArch"){
|
|
|
+ return querySh2Sp(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "sp2bd_ArchForArch"){
|
|
|
+ return querySp2Bd(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "sp2fl_ArchForArch"){
|
|
|
+ return querySp2Fl(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "sp2sh_ArchForArch"){
|
|
|
+ return querySp2Sh(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else if(manualRelationCalcRequest.relType == "sp2sp_ArchForArch"){
|
|
|
+ return querySp2Sp(projectId,list,sQueryRequest,manualRelationCalcRequest)
|
|
|
+ }else {
|
|
|
/** 暂无数据 */
|
|
|
val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
manualRelationCalcResponse.result = SResponseType.success
|
|
@@ -267,7 +301,6 @@ open class ManualRelationCalcService {
|
|
|
e.printStackTrace()
|
|
|
}
|
|
|
|
|
|
-
|
|
|
var delete: Boolean = false
|
|
|
if (manualRelationCalcDel.relType == "pe2sp"){ /** 资产所在的业务空间 */
|
|
|
delete = rPeInSpBaseService.delete(SFilter.eq("projectId", projectId!!),
|
|
@@ -517,13 +550,54 @@ open class ManualRelationCalcService {
|
|
|
}else if (manualRelationCalcDel.relType == "eq2sp_x"){
|
|
|
delete = rEq2SpService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
- }else if (relationAddRequest.relType == "bd2bd_ArchForArch"||relationAddRequest.relType == "bd2fl_ArchForArch"||relationAddRequest.relType == "bd2sh_ArchForArch"
|
|
|
- ||relationAddRequest.relType == "bd2sp_ArchForArch"||relationAddRequest.relType == "fl2bd_ArchForArch"||relationAddRequest.relType == "fl2fl_ArchForArch"
|
|
|
- ||relationAddRequest.relType == "fl2sh_ArchForArch"||relationAddRequest.relType == "fl2sp_ArchForArch"||relationAddRequest.relType == "sh2bd_ArchForArch"
|
|
|
- || relationAddRequest.relType == "sh2fl_ArchForArch"||relationAddRequest.relType == "sh2sh_ArchForArch"||relationAddRequest.relType == "sh2sp_ArchForArch"
|
|
|
- || relationAddRequest.relType == "sp2bd_ArchForArch" ||relationAddRequest.relType == "sp2fl_ArchForArch"||relationAddRequest.relType == "sp2sh_ArchForArch"
|
|
|
- ||relationAddRequest.relType == "sp2sp_ArchForArch"){
|
|
|
-
|
|
|
+ }else if (manualRelationCalcDel.relType == "bd2bd_ArchForArch"){
|
|
|
+ delete = CommonServices.rBd2BdService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "bd2fl_ArchForArch"){
|
|
|
+ delete = CommonServices.rBd2FlService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "bd2sh_ArchForArch"){
|
|
|
+ delete = CommonServices.rBd2ShService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "bd2sp_ArchForArch"){
|
|
|
+ delete = CommonServices.rBd2SpService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "fl2bd_ArchForArch"){
|
|
|
+ delete = CommonServices.rFl2BdService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "fl2fl_ArchForArch"){
|
|
|
+ delete = CommonServices.rFl2FlService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "fl2sh_ArchForArch"){
|
|
|
+ delete = CommonServices.rFl2ShService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "fl2sp_ArchForArch"){
|
|
|
+ delete = CommonServices.rFl2SpService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "sh2bd_ArchForArch"){
|
|
|
+ delete = CommonServices.rSh2BdService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "sh2fl_ArchForArch"){
|
|
|
+ delete = CommonServices.rSh2FlService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "sh2sh_ArchForArch"){
|
|
|
+ delete = CommonServices.rSh2ShService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "sh2sp_ArchForArch"){
|
|
|
+ delete = CommonServices.rSh2SpService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "sp2bd_ArchForArch"){
|
|
|
+ delete = CommonServices.rSp2BdService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "sp2fl_ArchForArch"){
|
|
|
+ delete = CommonServices.rSp2FlService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "sp2sh_ArchForArch"){
|
|
|
+ delete = CommonServices.rSp2ShService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
+ }else if(manualRelationCalcDel.relType == "sp2sp_ArchForArch"){
|
|
|
+ delete = CommonServices.rSp2SpService.delete(SFilter.eq("projectId", projectId!!),
|
|
|
+ SFilter.eq("id1", manualRelationCalcDel.fromId!!), SFilter.eq("id2", manualRelationCalcDel.toId!!),SFilter.eq("type", manualRelationCalcDel.relType!!))
|
|
|
}
|
|
|
|
|
|
if (delete){
|
|
@@ -3727,7 +3801,770 @@ open class ManualRelationCalcService {
|
|
|
return manualRelationCalcResponse
|
|
|
} // Fun
|
|
|
|
|
|
+ /**
|
|
|
+ * 空间和空间
|
|
|
+ */
|
|
|
+ fun querySp2Sp(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rSp2SpList = CommonServices.rSp2SpService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rSp2SpList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rSp2SpTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relZoneSpaceForService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 空间和竖井
|
|
|
+ */
|
|
|
+ fun querySp2Sh(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rSp2SpList = CommonServices.rSp2ShService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rSp2SpList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rSp2ShTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relZoneSpaceForShService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 空间和楼层
|
|
|
+ */
|
|
|
+ fun querySp2Fl(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rSp2SpList = CommonServices.rSp2FlService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rSp2SpList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rSp2FlTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relZoneSpaceForFlService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 空间和建筑
|
|
|
+ */
|
|
|
+ fun querySp2Bd(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rSp2SpList = CommonServices.rSp2BdService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rSp2SpList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rSp2BdTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relZoneSpaceForBdService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 竖井和空间
|
|
|
+ */
|
|
|
+ fun querySh2Sp(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rSh2SpList = CommonServices.rSh2SpService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rSh2SpList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rSh2SpTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relShaftForSpService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 竖井和竖井
|
|
|
+ */
|
|
|
+ fun querySh2Sh(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rSh2ShList = CommonServices.rSh2ShService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rSh2ShList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rSh2ShTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relShaftForShService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 竖井和楼层
|
|
|
+ */
|
|
|
+ fun querySh2Fl(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rSh2FlList = CommonServices.rSh2FlService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rSh2FlList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rSh2FlTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relShaftForFlService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 竖井和建筑
|
|
|
+ */
|
|
|
+ fun querySh2Bd(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rSh2BdList = CommonServices.rSh2BdService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rSh2BdList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rSh2BdTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relShaftForBdService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 楼层和空间
|
|
|
+ */
|
|
|
+ fun queryFl2Sp(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rFl2SpList = CommonServices.rFl2SpService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rFl2SpList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rFl2SpTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relFloorForSpService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 楼层和竖井
|
|
|
+ */
|
|
|
+ fun queryFl2Sh(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rFl2ShList = CommonServices.rFl2ShService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rFl2ShList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rFl2ShTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relFloorForShService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 楼层和楼层
|
|
|
+ */
|
|
|
+ fun queryFl2Fl(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rFl2ShList = CommonServices.rFl2FlService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rFl2ShList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rFl2FlTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relFloorForFlService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 楼层和建筑
|
|
|
+ */
|
|
|
+ fun queryFl2Bd(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rFl2ShList = CommonServices.rFl2BdService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rFl2ShList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rFl2BdTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relFloorForBdService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
|
|
|
+ /**
|
|
|
+ * 建筑和空间
|
|
|
+ */
|
|
|
+ fun queryBd2Sp(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rBd2SpList = CommonServices.rBd2SpService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rBd2SpList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rBd2SpTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relBuildingForSpService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 建筑和竖井
|
|
|
+ */
|
|
|
+ fun queryBd2Sh(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rBd2ShList = CommonServices.rBd2ShService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rBd2ShList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rBd2ShTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relBuildingForShService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 建筑和楼层
|
|
|
+ */
|
|
|
+ fun queryBd2Fl(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rBd2FlList = CommonServices.rBd2FlService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rBd2ShList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rBd2FlTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relBuildingForFlService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 建筑和建筑
|
|
|
+ */
|
|
|
+ fun queryBd2Bd(projectId: String,list: ArrayList<SFilter>,sQueryRequest: SQueryRequest,manualRelationCalcRequest: ManualRelationCalcRequest): ManualRelationCalcResponse {
|
|
|
+
|
|
|
+ val rBd2BdList = CommonServices.rBd2BdService.select(SFilter.eq("projectId", projectId), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ if (rBd2BdList.size>0) {
|
|
|
+ if (!manualRelationCalcRequest.vague.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId1",manualRelationCalcRequest.vague!!),SFilter.contain("localName1",manualRelationCalcRequest.vague!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ val rSp2SpTwoList = CommonServices.rBd2BdTwoService.select(list).exec()
|
|
|
+ if (rSp2SpTwoList.size>0) {
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rSp2SpTwo in rSp2SpTwoList){
|
|
|
+ listId1.add(rSp2SpTwo.id1!!)
|
|
|
+ listId2.add(rSp2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+ val sCascadeQuery = sQueryRequest.cascade!!.get(0)
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId", projectId))
|
|
|
+ val pageQuery = CommonServices.relBuildingForBdService.pageQuery(sQueryRequest, listSF)
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ 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.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ manualRelationCalcResponse.content = ArrayList<RelProperty>()
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+ }
|
|
|
|
|
|
|
|
|
fun time():String {
|