|
@@ -34,7 +34,9 @@ import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProje
|
|
import com.persagy.server.datacenter.models.entities.graphtype.block.RelationAddRequest
|
|
import com.persagy.server.datacenter.models.entities.graphtype.block.RelationAddRequest
|
|
import com.persagy.server.datacenter.models.entities.graphtype.rel.*
|
|
import com.persagy.server.datacenter.models.entities.graphtype.rel.*
|
|
import com.persagy.server.datacenter.models.entities.rel.*
|
|
import com.persagy.server.datacenter.models.entities.rel.*
|
|
-import com.persagy.server.datacenter.models.entities.rel.archforarch.RBd2Bd
|
|
|
|
|
|
+import com.persagy.server.datacenter.models.entities.rel.archforarch.*
|
|
|
|
+import com.persagy.server.datacenter.models.entities.rel.archforarch.RSh2Bd
|
|
|
|
+import com.persagy.server.datacenter.models.entities.rel.archforarch.RSh2Sp
|
|
import com.persagy.server.datacenter.models.response.ManualRelationCalcSCreateResponse
|
|
import com.persagy.server.datacenter.models.response.ManualRelationCalcSCreateResponse
|
|
import com.persagy.server.jms.RabbitMqService
|
|
import com.persagy.server.jms.RabbitMqService
|
|
import com.persagy.server.services.objects.*
|
|
import com.persagy.server.services.objects.*
|
|
@@ -67,8 +69,36 @@ class ManualRelationAddService {
|
|
}
|
|
}
|
|
|
|
|
|
/** 区域服务-建筑和建筑 */
|
|
/** 区域服务-建筑和建筑 */
|
|
- private val rRBd2BdService = SObjectService(SMybatisDao(RBd2Bd::class.java))
|
|
|
|
-
|
|
|
|
|
|
+ private val rBd2BdService = SObjectService(SMybatisDao(RBd2Bd::class.java))
|
|
|
|
+ /** 建筑和楼层 */
|
|
|
|
+ private val rBd2FlService = SObjectService(SMybatisDao(RBd2Fl::class.java))
|
|
|
|
+ /** 建筑和竖井 */
|
|
|
|
+ private val rBd2ShService = SObjectService(SMybatisDao(RBd2Sh::class.java))
|
|
|
|
+ /** 建筑和空间 */
|
|
|
|
+ private val rBd2SpService = SObjectService(SMybatisDao(RBd2Sp::class.java))
|
|
|
|
+ /** 区域服务-楼层和建筑 */
|
|
|
|
+ private val rFl2BdService = SObjectService(SMybatisDao(RFl2Bd::class.java))
|
|
|
|
+ /** 楼层和楼层 */
|
|
|
|
+ private val rFl2FlService = SObjectService(SMybatisDao(RFl2Fl::class.java))
|
|
|
|
+ /** 楼层和竖井 */
|
|
|
|
+ private val rFl2ShService = SObjectService(SMybatisDao(RFl2Sh::class.java))
|
|
|
|
+ /** 楼层和空间 */
|
|
|
|
+ private val rFl2SpService = SObjectService(SMybatisDao(RFl2Sp::class.java))
|
|
|
|
+ /** 区域服务-竖井和建筑 */
|
|
|
|
+ private val rSh2BdService = SObjectService(SMybatisDao(RSh2Bd::class.java))
|
|
|
|
+ /** 竖井和楼层 */
|
|
|
|
+ private val rSh2FlService = SObjectService(SMybatisDao(RSh2Fl::class.java))
|
|
|
|
+ /** 竖井和竖井 */
|
|
|
|
+ private val rSh2ShService = SObjectService(SMybatisDao(RSh2Sh::class.java))
|
|
|
|
+ /** 竖井和空间 */
|
|
|
|
+ private val rSh2SpService = SObjectService(SMybatisDao(RSh2Sp::class.java))
|
|
|
|
+
|
|
|
|
+ /** 区域服务-空间和建筑 */
|
|
|
|
+ private val rSp2BdService = SObjectService(SMybatisDao(RSp2Bd::class.java))
|
|
|
|
+ /** 空间和楼层 */
|
|
|
|
+ private val rSp2FlService = SObjectService(SMybatisDao(RSp2Fl::class.java))
|
|
|
|
+ /** 空间和竖井 */
|
|
|
|
+ private val rSp2ShService = SObjectService(SMybatisDao(RSp2Sh::class.java))
|
|
|
|
|
|
|
|
|
|
/** 资产服务 */
|
|
/** 资产服务 */
|
|
@@ -127,7 +157,7 @@ class ManualRelationAddService {
|
|
*/
|
|
*/
|
|
fun addRel(relationAddRequest: RelationAddRequest): ManualRelationCalcSCreateResponse {
|
|
fun addRel(relationAddRequest: RelationAddRequest): ManualRelationCalcSCreateResponse {
|
|
/** 项目id */
|
|
/** 项目id */
|
|
- val projectId = SPageContext.getHeader("ProjectId")
|
|
|
|
|
|
+ val projectId = SPageContext.getHeader("projectId")
|
|
|
|
|
|
val sCreateResponse = ManualRelationCalcSCreateResponse()
|
|
val sCreateResponse = ManualRelationCalcSCreateResponse()
|
|
|
|
|
|
@@ -1925,9 +1955,10 @@ class ManualRelationAddService {
|
|
|
|
|
|
}else if (relationAddRequest.relType == "ArchForArch_Bd2Bd"||relationAddRequest.relType == "ArchForArch_Bd2Fl"||relationAddRequest.relType == "ArchForArch_Bd2Sh"
|
|
}else if (relationAddRequest.relType == "ArchForArch_Bd2Bd"||relationAddRequest.relType == "ArchForArch_Bd2Fl"||relationAddRequest.relType == "ArchForArch_Bd2Sh"
|
|
||relationAddRequest.relType == "ArchForArch_Bd2Sp"||relationAddRequest.relType == "ArchForArch_Fl2Bd"||relationAddRequest.relType == "ArchForArch_Fl2Fl"
|
|
||relationAddRequest.relType == "ArchForArch_Bd2Sp"||relationAddRequest.relType == "ArchForArch_Fl2Bd"||relationAddRequest.relType == "ArchForArch_Fl2Fl"
|
|
- ||relationAddRequest.relType == "ArchForArch_Fl2Sh"||relationAddRequest.relType == "ArchForArch_Fl2Sp"||relationAddRequest.relType == "ArchForArch_Sh2Bd"||
|
|
|
|
- relationAddRequest.relType == "ArchForArch_Sh2Fl"||relationAddRequest.relType == "ArchForArch_Sh2Sh"||relationAddRequest.relType == "ArchForArch_Sh2Sp"||relationAddRequest.relType == "ArchForArch_Sp2Bd"
|
|
|
|
- ||relationAddRequest.relType == "ArchForArch_Sp2Fl"||relationAddRequest.relType == "ArchForArch_Sp2Sh"||relationAddRequest.relType == "ArchForArch_Sp2Sp"){
|
|
|
|
|
|
+ ||relationAddRequest.relType == "ArchForArch_Fl2Sh"||relationAddRequest.relType == "ArchForArch_Fl2Sp"||relationAddRequest.relType == "ArchForArch_Sh2Bd"
|
|
|
|
+ || relationAddRequest.relType == "ArchForArch_Sh2Fl"||relationAddRequest.relType == "ArchForArch_Sh2Sh"||relationAddRequest.relType == "ArchForArch_Sh2Sp"
|
|
|
|
+ || relationAddRequest.relType == "ArchForArch_Sp2Bd" ||relationAddRequest.relType == "ArchForArch_Sp2Fl"||relationAddRequest.relType == "ArchForArch_Sp2Sh"
|
|
|
|
+ ||relationAddRequest.relType == "ArchForArch_Sp2Sp"){
|
|
// val sReplaceBuilder = SReplaceBuilder<RBd2Bd>(SMybatisDao(RBd2Bd::class.java))
|
|
// val sReplaceBuilder = SReplaceBuilder<RBd2Bd>(SMybatisDao(RBd2Bd::class.java))
|
|
|
|
|
|
if (!relationAddRequest.type.isNullOrEmpty()&&relationAddRequest.type == "cadId"){
|
|
if (!relationAddRequest.type.isNullOrEmpty()&&relationAddRequest.type == "cadId"){
|
|
@@ -1992,7 +2023,7 @@ class ManualRelationAddService {
|
|
rBd2Bd.projectId = projectId
|
|
rBd2Bd.projectId = projectId
|
|
rBd2Bd.type = relationAddRequest.relType
|
|
rBd2Bd.type = relationAddRequest.relType
|
|
rBd2Bd.sign = 1
|
|
rBd2Bd.sign = 1
|
|
- rRBd2BdService.replace(rBd2Bd)
|
|
|
|
|
|
+ rBd2BdService.replace(rBd2Bd)
|
|
}
|
|
}
|
|
}else if (relationAddRequest.relType == "ArchForArch_Bd2Fl") {
|
|
}else if (relationAddRequest.relType == "ArchForArch_Bd2Fl") {
|
|
for (fromContent in relationAddRequest.fromContent!!){
|
|
for (fromContent in relationAddRequest.fromContent!!){
|
|
@@ -2022,14 +2053,14 @@ class ManualRelationAddService {
|
|
/** 查询空间 */
|
|
/** 查询空间 */
|
|
val floorToList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
val floorToList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
for (floorTo in floorToList) {
|
|
for (floorTo in floorToList) {
|
|
- val rBd2Bd = RBd2Bd()
|
|
|
|
- rBd2Bd.id1 = building.id
|
|
|
|
- rBd2Bd.id2 = floorTo.id
|
|
|
|
- rBd2Bd.projectId = projectId
|
|
|
|
- rBd2Bd.type = relationAddRequest.relType
|
|
|
|
- rBd2Bd.sign = 1
|
|
|
|
|
|
+ val rBd2Fl = RBd2Fl()
|
|
|
|
+ rBd2Fl.id1 = building.id
|
|
|
|
+ rBd2Fl.id2 = floorTo.id
|
|
|
|
+ rBd2Fl.projectId = projectId
|
|
|
|
+ rBd2Fl.type = relationAddRequest.relType
|
|
|
|
+ rBd2Fl.sign = 1
|
|
// sReplaceBuilder.tableName = "relationship.r_bd2bd"
|
|
// sReplaceBuilder.tableName = "relationship.r_bd2bd"
|
|
-//// rRBd2BdService.replace(rBd2Bd,sReplaceBuilder)
|
|
|
|
|
|
+ rBd2FlService.replace(rBd2Fl)
|
|
}
|
|
}
|
|
|
|
|
|
}else if (relationAddRequest.relType =="ArchForArch_Bd2Sh") {
|
|
}else if (relationAddRequest.relType =="ArchForArch_Bd2Sh") {
|
|
@@ -2060,19 +2091,55 @@ class ManualRelationAddService {
|
|
/** 查询空间 */
|
|
/** 查询空间 */
|
|
val shaftToList = ShaftService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
val shaftToList = ShaftService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
for (shaftTo in shaftToList) {
|
|
for (shaftTo in shaftToList) {
|
|
- val rBd2Bd = RBd2Bd()
|
|
|
|
- rBd2Bd.id1 = building.id
|
|
|
|
- rBd2Bd.id2 = shaftTo.id
|
|
|
|
- rBd2Bd.projectId = projectId
|
|
|
|
- rBd2Bd.type = relationAddRequest.relType
|
|
|
|
- rBd2Bd.sign = 1
|
|
|
|
|
|
+ val rBd2Sh = RBd2Sh()
|
|
|
|
+ rBd2Sh.id1 = building.id
|
|
|
|
+ rBd2Sh.id2 = shaftTo.id
|
|
|
|
+ rBd2Sh.projectId = projectId
|
|
|
|
+ rBd2Sh.type = relationAddRequest.relType
|
|
|
|
+ rBd2Sh.sign = 1
|
|
// sReplaceBuilder.tableName = "relationship.r_bd2sh"
|
|
// sReplaceBuilder.tableName = "relationship.r_bd2sh"
|
|
// rRBd2BdService.replace(rBd2Bd,sReplaceBuilder)
|
|
// rRBd2BdService.replace(rBd2Bd,sReplaceBuilder)
|
|
|
|
+ rBd2ShService.replace(rBd2Sh)
|
|
}
|
|
}
|
|
- }else if (relationAddRequest.relType =="ArchForArch_Bd2Sh") {
|
|
|
|
-
|
|
|
|
}else if (relationAddRequest.relType =="ArchForArch_Bd2Sp") {
|
|
}else if (relationAddRequest.relType =="ArchForArch_Bd2Sp") {
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val spaceToList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
|
|
|
|
+ if (spaceToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (spaceToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val spaceToList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (spaceTo in spaceToList) {
|
|
|
|
+ val rBd2Sp = RBd2Sp()
|
|
|
|
+ rBd2Sp.id1 = building.id
|
|
|
|
+ rBd2Sp.id2 = spaceTo.id
|
|
|
|
+ rBd2Sp.projectId = projectId
|
|
|
|
+ rBd2Sp.type = relationAddRequest.relType
|
|
|
|
+ rBd2Sp.sign = 1
|
|
|
|
+ rBd2Sp.zoneType = spaceTo.classCode
|
|
|
|
+// sReplaceBuilder.tableName = "relationship.r_bd2sh"
|
|
|
|
+// rRBd2BdService.replace(rBd2Bd,sReplaceBuilder)
|
|
|
|
+ rBd2SpService.replace(rBd2Sp)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}else if (relationAddRequest.relType == "ArchForArch_Fl2Bd"||relationAddRequest.relType == "ArchForArch_Fl2Fl"
|
|
}else if (relationAddRequest.relType == "ArchForArch_Fl2Bd"||relationAddRequest.relType == "ArchForArch_Fl2Fl"
|
|
||relationAddRequest.relType == "ArchForArch_Fl2Sh"||relationAddRequest.relType == "ArchForArch_Fl2Sp") {
|
|
||relationAddRequest.relType == "ArchForArch_Fl2Sh"||relationAddRequest.relType == "ArchForArch_Fl2Sp") {
|
|
@@ -2094,13 +2161,152 @@ class ManualRelationAddService {
|
|
}
|
|
}
|
|
|
|
|
|
if (relationAddRequest.relType == "ArchForArch_Fl2Bd") {
|
|
if (relationAddRequest.relType == "ArchForArch_Fl2Bd") {
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val buildingToList = BuildingService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
|
|
|
|
+ if (buildingToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (buildingToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val buildingToList = BuildingService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (buildingTo in buildingToList) {
|
|
|
|
+ val rFl2Bd = RFl2Bd()
|
|
|
|
+ rFl2Bd.id1 = floorList[0].id
|
|
|
|
+ rFl2Bd.id2 = buildingTo.id
|
|
|
|
+ rFl2Bd.projectId = projectId
|
|
|
|
+ rFl2Bd.type = relationAddRequest.relType
|
|
|
|
+ rFl2Bd.sign = 1
|
|
|
|
+ rFl2BdService.replace(rFl2Bd)
|
|
|
|
+ }
|
|
} else if (relationAddRequest.relType == "ArchForArch_Fl2Fl") {
|
|
} else if (relationAddRequest.relType == "ArchForArch_Fl2Fl") {
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val floorToList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
|
|
|
|
+ if (floorToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (floorToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val floorToList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (floorTo in floorToList) {
|
|
|
|
+ val rFl2Fl = RFl2Fl()
|
|
|
|
+ rFl2Fl.id1 = floorList[0].id
|
|
|
|
+ rFl2Fl.id2 = floorTo.id
|
|
|
|
+ rFl2Fl.projectId = projectId
|
|
|
|
+ rFl2Fl.type = relationAddRequest.relType
|
|
|
|
+ rFl2Fl.sign = 1
|
|
|
|
+ rFl2FlService.replace(rFl2Fl)
|
|
|
|
+ }
|
|
} else if (relationAddRequest.relType == "ArchForArch_Fl2Sh") {
|
|
} else if (relationAddRequest.relType == "ArchForArch_Fl2Sh") {
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val shaftToList = ShaftService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent!!)).exec()
|
|
|
|
+ if (shaftToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (shaftToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val shaftToList = ShaftService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (shaftTo in shaftToList) {
|
|
|
|
+ val rFl2Sh = RFl2Sh()
|
|
|
|
+ rFl2Sh.id1 = floorList[0].id
|
|
|
|
+ rFl2Sh.id2 = shaftTo.id
|
|
|
|
+ rFl2Sh.projectId = projectId
|
|
|
|
+ rFl2Sh.type = relationAddRequest.relType
|
|
|
|
+ rFl2Sh.sign = 1
|
|
|
|
+ rFl2Sh.graphCode = relationAddRequest.graphicType
|
|
|
|
+ rFl2ShService.replace(rFl2Sh)
|
|
|
|
+ }
|
|
}else if (relationAddRequest.relType == "ArchForArch_Fl2Sp") {
|
|
}else if (relationAddRequest.relType == "ArchForArch_Fl2Sp") {
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val spaceToList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent)).exec()
|
|
|
|
+ if (spaceToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (spaceToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val spaceToList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (spaceTo in spaceToList) {
|
|
|
|
+ val rFl2Sp = RFl2Sp()
|
|
|
|
+ rFl2Sp.id1 = floorList[0].id
|
|
|
|
+ rFl2Sp.id2 = spaceTo.id
|
|
|
|
+ rFl2Sp.projectId = projectId
|
|
|
|
+ rFl2Sp.type = relationAddRequest.relType
|
|
|
|
+ rFl2Sp.sign = 1
|
|
|
|
+ rFl2Sp.graphCode = relationAddRequest.graphicType
|
|
|
|
+ rFl2Sp.zoneType = spaceTo.classCode
|
|
|
|
+ rFl2SpService.replace(rFl2Sp)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
}else if (relationAddRequest.relType == "ArchForArch_Sh2Bd"|| relationAddRequest.relType == "ArchForArch_Sh2Fl"||
|
|
}else if (relationAddRequest.relType == "ArchForArch_Sh2Bd"|| relationAddRequest.relType == "ArchForArch_Sh2Fl"||
|
|
@@ -2122,20 +2328,326 @@ class ManualRelationAddService {
|
|
return sCreateResponse
|
|
return sCreateResponse
|
|
}
|
|
}
|
|
if (relationAddRequest.relType == "ArchForArch_Sh2Bd"){
|
|
if (relationAddRequest.relType == "ArchForArch_Sh2Bd"){
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val buildingToList = BuildingService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent)).exec()
|
|
|
|
+ if (buildingToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (buildingToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val buildingToList = BuildingService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (buildingTo in buildingToList) {
|
|
|
|
+ val rSh2Bd = RSh2Bd()
|
|
|
|
+ rSh2Bd.id1 = shaftList[0].id
|
|
|
|
+ rSh2Bd.id2 = buildingTo.id
|
|
|
|
+ rSh2Bd.projectId = projectId
|
|
|
|
+ rSh2Bd.type = relationAddRequest.relType
|
|
|
|
+ rSh2Bd.sign = 1
|
|
|
|
+ rSh2BdService.replace(rSh2Bd)
|
|
|
|
+ }
|
|
}else if (relationAddRequest.relType == "ArchForArch_Sh2Fl"){
|
|
}else if (relationAddRequest.relType == "ArchForArch_Sh2Fl"){
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val floorToList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent)).exec()
|
|
|
|
+ if (floorToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (floorToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val floorToList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (floorTo in floorToList) {
|
|
|
|
+ val rSh2Fl = RSh2Fl()
|
|
|
|
+ rSh2Fl.id1 = shaftList[0].id
|
|
|
|
+ rSh2Fl.id2 = floorTo.id
|
|
|
|
+ rSh2Fl.projectId = projectId
|
|
|
|
+ rSh2Fl.type = relationAddRequest.relType
|
|
|
|
+ rSh2Fl.sign = 1
|
|
|
|
+ rSh2FlService.replace(rSh2Fl)
|
|
|
|
+ }
|
|
}else if (relationAddRequest.relType == "ArchForArch_Sh2Sh"){
|
|
}else if (relationAddRequest.relType == "ArchForArch_Sh2Sh"){
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val shaftToList = ShaftService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent)).exec()
|
|
|
|
+ if (shaftToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (shaftToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val shaftToList = ShaftService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (shaftTo in shaftToList) {
|
|
|
|
+ val rSh2Sh = RSh2Sh()
|
|
|
|
+ rSh2Sh.id1 = shaftList[0].id
|
|
|
|
+ rSh2Sh.id2 = shaftTo.id
|
|
|
|
+ rSh2Sh.projectId = projectId
|
|
|
|
+ rSh2Sh.type = relationAddRequest.relType
|
|
|
|
+ rSh2Sh.sign = 1
|
|
|
|
+ rSh2Sh.graphCode = relationAddRequest.graphicType
|
|
|
|
+ rSh2ShService.replace(rSh2Sh)
|
|
|
|
+ }
|
|
}else if (relationAddRequest.relType == "ArchForArch_Sh2Sp"){
|
|
}else if (relationAddRequest.relType == "ArchForArch_Sh2Sp"){
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val spaceToList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent)).exec()
|
|
|
|
+ if (spaceToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (spaceToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val spaceToList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (spaceTo in spaceToList) {
|
|
|
|
+ val rSh2Sp = RSh2Sp()
|
|
|
|
+ rSh2Sp.id1 = shaftList[0].id
|
|
|
|
+ rSh2Sp.id2 = spaceTo.id
|
|
|
|
+ rSh2Sp.projectId = projectId
|
|
|
|
+ rSh2Sp.type = relationAddRequest.relType
|
|
|
|
+ rSh2Sp.sign = 1
|
|
|
|
+ rSh2Sp.graphCode = relationAddRequest.graphicType
|
|
|
|
+ rSh2Sp.zoneType = spaceTo.classCode
|
|
|
|
+ rSh2SpService.replace(rSh2Sp)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else if(relationAddRequest.relType == "ArchForArch_Sp2Bd" ||relationAddRequest.relType == "ArchForArch_Sp2Fl"
|
|
|
|
+ ||relationAddRequest.relType == "ArchForArch_Sp2Sh"||relationAddRequest.relType == "ArchForArch_Sp2Sp") {
|
|
|
|
+
|
|
|
|
+ /** 楼层服务 */
|
|
|
|
+ val zoneSpaceList = relZoneSpaceService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
|
|
|
|
+ if (zoneSpaceList.size<1){
|
|
|
|
+ /** 主对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = relationAddRequest.mainContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "1"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (zoneSpaceList.size>1){
|
|
|
|
+ /** 主对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "1"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (relationAddRequest.relType == "ArchForArch_Sp2Sp") {
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val spaceToList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent)).exec()
|
|
|
|
+ if (spaceToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (spaceToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val spaceToList = relZoneSpaceService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (spaceTo in spaceToList) {
|
|
|
|
+ val rSp2Sp = RSp2Sp()
|
|
|
|
+ rSp2Sp.id1 = zoneSpaceList[0].id
|
|
|
|
+ rSp2Sp.id2 = spaceTo.id
|
|
|
|
+ rSp2Sp.projectId = projectId
|
|
|
|
+ rSp2Sp.type = relationAddRequest.relType
|
|
|
|
+ rSp2Sp.sign = 1
|
|
|
|
+ rSp2Sp.zoneType = zoneSpaceList[0].classCode
|
|
|
|
+ rSp2SpService.replace(rSp2Sp)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }else if (relationAddRequest.relType == "ArchForArch_Sp2Bd") {
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val buildingToList = BuildingService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent)).exec()
|
|
|
|
+ if (buildingToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (buildingToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val buildingToList = BuildingService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (buildingTo in buildingToList) {
|
|
|
|
+ val rSp2Bd = RSp2Bd()
|
|
|
|
+ rSp2Bd.id1 = zoneSpaceList[0].id
|
|
|
|
+ rSp2Bd.id2 = buildingTo.id
|
|
|
|
+ rSp2Bd.projectId = projectId
|
|
|
|
+ rSp2Bd.type = relationAddRequest.relType
|
|
|
|
+ rSp2Bd.sign = 1
|
|
|
|
+ rSp2Bd.zoneType = zoneSpaceList[0].classCode
|
|
|
|
+ rSp2BdService.replace(rSp2Bd)
|
|
|
|
+ }
|
|
|
|
+ }else if (relationAddRequest.relType == "ArchForArch_Sp2Fl") {
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val floorToList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent)).exec()
|
|
|
|
+ if (floorToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (floorToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val floorToList = FloorService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (floorTo in floorToList) {
|
|
|
|
+ val rSp2Fl = RSp2Fl()
|
|
|
|
+ rSp2Fl.id1 = zoneSpaceList[0].id
|
|
|
|
+ rSp2Fl.id2 = floorTo.id
|
|
|
|
+ rSp2Fl.projectId = projectId
|
|
|
|
+ rSp2Fl.type = relationAddRequest.relType
|
|
|
|
+ rSp2Fl.sign = 1
|
|
|
|
+ rSp2Fl.zoneType = zoneSpaceList[0].classCode
|
|
|
|
+ rSp2FlService.replace(rSp2Fl)
|
|
|
|
+ }
|
|
|
|
+ }else if (relationAddRequest.relType == "ArchForArch_Sp2Sh") {
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ /** 去除主对象空间id */
|
|
|
|
+ val shaftToList = ShaftService.select(SFilter.eq("projectId", projectId), SFilter.eq(relationAddRequest.type!!, fromContent)).exec()
|
|
|
|
+ if (shaftToList.size<1){
|
|
|
|
+ /** 从对象不存在 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":不存在"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ if (shaftToList.size>1){
|
|
|
|
+ /** 从对象编码识别到多个实例 */
|
|
|
|
+ sCreateResponse.result = SResponseType.failure
|
|
|
|
+ sCreateResponse.message = fromContent+":存在多个实例"
|
|
|
|
+ sCreateResponse.errorType = "2"
|
|
|
|
+ return sCreateResponse
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ /** 处理关系 */
|
|
|
|
+ val setCode = HashSet<String>()
|
|
|
|
+ for (fromContent in relationAddRequest.fromContent!!){
|
|
|
|
+ setCode.add(fromContent)
|
|
|
|
+ }
|
|
|
|
+ /** 查询空间 */
|
|
|
|
+ val shaftToList = ShaftService.select(SFilter.eq("projectId", projectId), SFilter.inList(relationAddRequest.type!!, setCode.toList())).exec()
|
|
|
|
+ for (shaftTo in shaftToList) {
|
|
|
|
+ val rSp2Sh = RSp2Sh()
|
|
|
|
+ rSp2Sh.id1 = zoneSpaceList[0].id
|
|
|
|
+ rSp2Sh.id2 = shaftTo.id
|
|
|
|
+ rSp2Sh.projectId = projectId
|
|
|
|
+ rSp2Sh.type = relationAddRequest.relType
|
|
|
|
+ rSp2Sh.sign = 1
|
|
|
|
+ rSp2Sh.zoneType = zoneSpaceList[0].classCode
|
|
|
|
+ rSp2ShService.replace(rSp2Sh)
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.result = SResponseType.success
|
|
sCreateResponse.message = "添加成功"
|
|
sCreateResponse.message = "添加成功"
|
|
-
|
|
|
|
return sCreateResponse
|
|
return sCreateResponse
|
|
} // Fun
|
|
} // Fun
|
|
|
|
|