|
@@ -191,6 +191,8 @@ open class ManualRelationCalcService {
|
|
|
return queryEq2Sp(manualRelationCalcRequest)
|
|
|
}else if (manualRelationCalcRequest.graphicType == "MechForArch" && manualRelationCalcRequest.relType == "Eq2Sp"){
|
|
|
return queryEq2SpFor(manualRelationCalcRequest)
|
|
|
+ }else if (manualRelationCalcRequest.graphicType == "ValveRelationship" && manualRelationCalcRequest.relType == "Vv2Eq"){
|
|
|
+ return queryVv2Eq(manualRelationCalcRequest)
|
|
|
}
|
|
|
return ManualRelationCalcResponse()
|
|
|
|
|
@@ -1148,6 +1150,114 @@ open class ManualRelationCalcService {
|
|
|
return manualRelationCalcResponse
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * @Description: 阀门限制设备
|
|
|
+ * @Param:
|
|
|
+ * @Return:
|
|
|
+ */
|
|
|
+ fun queryVv2Eq(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
|
|
|
+ }
|
|
|
+
|
|
|
+ val sCascadeQueryList = ArrayList<SCascadeQuery>()
|
|
|
+ /** 级联资产 */
|
|
|
+ val sCascadeQuery = SCascadeQuery()
|
|
|
+ sCascadeQuery.name = "objectInfo"
|
|
|
+ sCascadeQuery.filters = "classCode = '${manualRelationCalcRequest.zoneType!!}'"
|
|
|
+ sCascadeQueryList.add(sCascadeQuery)
|
|
|
+ sQueryRequest.cascade = sCascadeQueryList
|
|
|
+
|
|
|
+ val manualRelationCalcResponse = ManualRelationCalcResponse()
|
|
|
+ manualRelationCalcResponse.direction = "Left"
|
|
|
+ val list = ArrayList<SFilter>()
|
|
|
+ list.add(SFilter.eq("projectId",Opt.projectId!!))
|
|
|
+ val rEq2EqList = rEq2EqService.select(SFilter.eq("projectId", Opt.projectId!!), SFilter.eq("graphCode", manualRelationCalcRequest.graphicType!!), SFilter.eq("type", manualRelationCalcRequest.relType!!)).exec()
|
|
|
+ val equipIds = ArrayList<String>()
|
|
|
+ if (rEq2EqList.size>0) {
|
|
|
+ equipIds.addAll(rEq2EqList.map { r -> r.id1!! })
|
|
|
+ if (manualRelationCalcRequest.objectType == "1") {
|
|
|
+ //限制结果为存在关联关系的数据
|
|
|
+ list.add(SFilter.inList("id",equipIds))
|
|
|
+ if (!manualRelationCalcRequest.categoryFrom.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.eq("classCode",manualRelationCalcRequest.categoryFrom!!))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueFrom.isNullOrEmpty()) {
|
|
|
+ list.add(SFilter.or(SFilter.contain("codeName",manualRelationCalcRequest.vagueFrom!!),SFilter.contain("localId1",manualRelationCalcRequest.vagueFrom!!)
|
|
|
+ ,SFilter.contain("bimTypeId",manualRelationCalcRequest.vagueFrom!!),SFilter.contain("systemCategotry",manualRelationCalcRequest.vagueFrom!!)))
|
|
|
+ }
|
|
|
+ val pageQuery = relEq2SpForEquipService.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
|
|
|
+
|
|
|
+ }else if (manualRelationCalcRequest.objectType == "2" ||manualRelationCalcRequest.objectType == "3"){
|
|
|
+ if (!manualRelationCalcRequest.categoryFrom.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.eq("classCode",manualRelationCalcRequest.categoryFrom!!))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.vagueFrom.isNullOrEmpty()) {
|
|
|
+ list.add(SFilter.or(SFilter.contain("codeName",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localId1",manualRelationCalcRequest.vagueTo!!)
|
|
|
+ ,SFilter.contain("bimTypeId",manualRelationCalcRequest.vagueTo!!),SFilter.contain("systemCategotry",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+
|
|
|
+ if (!manualRelationCalcRequest.vagueTo.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.or(SFilter.contain("localName2",manualRelationCalcRequest.vagueTo!!),SFilter.contain("localId2",manualRelationCalcRequest.vagueTo!!)))
|
|
|
+ }
|
|
|
+ if (!manualRelationCalcRequest.zoneType.isNullOrEmpty()){
|
|
|
+ list.add(SFilter.eq("zoneType",manualRelationCalcRequest.zoneType!!))
|
|
|
+ }
|
|
|
+ val rEq2SpTwoList = rEq2SpTwoService.select(list).exec()
|
|
|
+ if (rEq2SpTwoList.size>0){
|
|
|
+ for (rEq2SpTwo in rEq2SpTwoList){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ val listId1 = ArrayList<String>()
|
|
|
+ val listId2 = ArrayList<String>()
|
|
|
+ for (rEq2SpTwo in rEq2SpTwoList){
|
|
|
+ listId1.add(rEq2SpTwo.id1!!)
|
|
|
+ listId2.add(rEq2SpTwo.id2!!)
|
|
|
+ }
|
|
|
+
|
|
|
+ val listSF = ArrayList<SFilter>()
|
|
|
+ sCascadeQuery.filters = "id in ${listId2.toJson()}"
|
|
|
+ listSF.add(SFilter.inList("id",listId1.toList()))
|
|
|
+ listSF.add(SFilter.eq("projectId",Opt.projectId!!))
|
|
|
+ val pageQuery = relEq2SpForEquipService.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
|
|
|
+ }
|
|
|
+
|
|
|
+ }else {
|
|
|
+ manualRelationCalcResponse.content = ArrayList()
|
|
|
+ manualRelationCalcResponse.result = SResponseType.success
|
|
|
+ }
|
|
|
+ return manualRelationCalcResponse
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 设备服务空间
|
|
@@ -1307,6 +1417,9 @@ open class ManualRelationCalcService {
|
|
|
} else if (manualRelationCalcDel.graphicType == "MechForArch" && manualRelationCalcDel.relType == "Eq2Sp") {
|
|
|
delete = rSp2SpService.delete(SFilter.eq("id1",manualRelationCalcDel.fromId!!),SFilter.eq("id2",manualRelationCalcDel.toId!!),
|
|
|
SFilter.eq("graphCode",manualRelationCalcDel.graphicType!!),SFilter.eq("type",manualRelationCalcDel.relType!!))
|
|
|
+ } else if (manualRelationCalcDel.graphicType == "ValveRelationship" && manualRelationCalcDel.relType == "Vv2Eq") {
|
|
|
+ delete = rEq2EqService.delete(SFilter.eq("id1",manualRelationCalcDel.fromId!!),SFilter.eq("id2",manualRelationCalcDel.toId!!),
|
|
|
+ SFilter.eq("graphCode",manualRelationCalcDel.graphicType!!),SFilter.eq("type",manualRelationCalcDel.relType!!))
|
|
|
}
|
|
|
if (delete){
|
|
|
/** 发送消息 */
|