소스 검색

********************WX***********************
添加微服务和数据中台通讯方式

zhangweixin 4 년 전
부모
커밋
960b90064c

+ 1 - 1
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/objects/Property.kt

@@ -170,7 +170,7 @@ open class Property : BaseInfo(),Comparator<Property> {
     /** 贴码状态 */
     @Schema(description = "贴码状态")
     @Column(name = "code_type")
-    var codeType: Int? = null
+    var codeType: Long? = null
 
     /** 选择状态 */
     @Schema(description = "选择状态")

+ 85 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/archforarch/RBd2Bd.kt

@@ -0,0 +1,85 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2021.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.datacenter.models.entities.rel.archforarch
+
+import com.persagy.server.datacenter.models.entities.base.RBaseInfo
+import io.swagger.v3.oas.annotations.media.Schema
+import javax.persistence.Column
+import javax.persistence.Id
+import javax.persistence.Table
+
+/**
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2021/3/4 15:29
+ */
+@Schema(description = "设备与设备的关系")
+@Table(name = "relationship.r_bd2bd")
+class RBd2Bd : RBaseInfo() {
+
+    /** id1 */
+    @Schema(description = "id1")
+    @Id
+    @Column(name = "id1")
+    var id1: String? = null
+
+    /** id2 */
+    @Schema(description = "id2")
+    @Id
+    @Column(name = "id2")
+    var id2: String? = null
+
+    /** 项目Id */
+    @Schema(description = "项目Id")
+    @Id
+    @Column(name = "project_id")
+    var projectId: String? = null
+
+    /** 类型 */
+    @Schema(description = "类型 " )
+    @Id
+    @Column(name = "type")
+    var type: String? = null
+
+    /** 图类型 */
+    @Schema(description = "图类型 " )
+    @Id
+    @Column(name = "graph_code")
+    var graphCode: String? = null
+
+
+    /** 计算标记 1 为手动 2为自动 */
+    @Schema(description = "计算标记 1 为手动 2为自动 ")
+    @Column(name = "sign")
+    var sign: Int? = null
+
+    /** 是否有方向性 */
+    @Schema(description = "是否有方向性")
+    @Column(name = "has_direction")
+    var hasDirection: Boolean? = null
+
+}

+ 85 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/models/entities/rel/archforarch/RBd2Fl.kt

@@ -0,0 +1,85 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2021.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.datacenter.models.entities.rel.archforarch
+
+import com.persagy.server.datacenter.models.entities.base.RBaseInfo
+import io.swagger.v3.oas.annotations.media.Schema
+import javax.persistence.Column
+import javax.persistence.Id
+import javax.persistence.Table
+
+/**
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2021/3/4 15:29
+ */
+@Schema(description = "设备与设备的关系")
+@Table(name = "relationship.r_bd2fl")
+class RBd2Fl : RBaseInfo() {
+
+    /** id1 */
+    @Schema(description = "id1")
+    @Id
+    @Column(name = "id1")
+    var id1: String? = null
+
+    /** id2 */
+    @Schema(description = "id2")
+    @Id
+    @Column(name = "id2")
+    var id2: String? = null
+
+    /** 项目Id */
+    @Schema(description = "项目Id")
+    @Id
+    @Column(name = "project_id")
+    var projectId: String? = null
+
+    /** 类型 */
+    @Schema(description = "类型 " )
+    @Id
+    @Column(name = "type")
+    var type: String? = null
+
+    /** 图类型 */
+    @Schema(description = "图类型 " )
+    @Id
+    @Column(name = "graph_code")
+    var graphCode: String? = null
+
+
+    /** 计算标记 1 为手动 2为自动 */
+    @Schema(description = "计算标记 1 为手动 2为自动 ")
+    @Column(name = "sign")
+    var sign: Int? = null
+
+    /** 是否有方向性 */
+    @Schema(description = "是否有方向性")
+    @Column(name = "has_direction")
+    var hasDirection: Boolean? = null
+
+}

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/controllers/graphtype/GraphicTypeController.kt

@@ -150,7 +150,7 @@ open class GraphicTypeController {
     @PostMapping(value = ["/relation_type_project"])
     fun relationTypeProject(@RequestBody request: SQueryRequest): SQueryResponse<RelationTypeProject> {
         val service = SObjectService(RelationTypeProject::class.java)
-        return service.pageQuery(request, arrayListOf(SFilter.eq("projectId", SPageContext.getHeader("ProjectId").toString())))
+        return service.pageQuery(request, arrayListOf(SFilter.eq("projectId", SPageContext.getHeader("projectId").toString())))
     } // Fun replaceConnectedBlockSource()
 
 

+ 3 - 3
datacenter/src/main/kotlin/com/persagy/server/services/objects/ComponentService.kt

@@ -26,8 +26,6 @@
 
 package com.persagy.server.services.objects
 
-import com.persagy.server.utils.IdUtils
-import com.persagy.server.utils.ShaftNameUtil
 import com.persagy.database.SFilter
 import com.persagy.database.SQueryBuilder
 import com.persagy.database.extensions.keyValue
@@ -37,6 +35,8 @@ import com.persagy.server.datacenter.models.entities.objects.Equipment
 import com.persagy.server.services.assistant.ObjInfoService
 import com.persagy.server.services.base.Service
 import com.persagy.server.services.log.DataCenterLogsService
+import com.persagy.server.utils.IdUtils
+import com.persagy.server.utils.ShaftNameUtil
 
 /**
  * 部件信息服务
@@ -157,7 +157,7 @@ object ComponentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
             } catch (e: Exception) {
                 e.printStackTrace()
             }
-            ObjInfoService.createInfo(equipment,false,"Ec",equipment.classCode!!)
+//            ObjInfoService.createInfo(equipment,false,"Ec",equipment.classCode!!)
         }
     }
 

+ 2 - 1
datacenter/src/main/kotlin/com/persagy/server/services/objects/EquipmentService.kt

@@ -90,7 +90,7 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
                     SFilter.eq("projectId", equip.projectId!!),
                     SFilter.endWith("code", equip.classCode!!)
             ).entity()
-            if (entity!=null){
+            if (entity!=null&&equip.classCode!!.length>=6){
                 equip.classCode = entity.code
             } else {
                 return false
@@ -189,6 +189,7 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
                         list.add(property)
                         val sUpdateRequest = SUpdateRequest<Property>()
                         sUpdateRequest.content = list
+                        sUpdateRequest.nullItems = arrayListOf("equipId","bimId")
                         val updateList = PropertyService.updateList(sUpdateRequest)
                         val pr = PropertyService.select(SFilter.eq("id", entity.propertyId!!)).entity()
                         val listp = ArrayList<Property>()

+ 25 - 16
datacenter/src/main/kotlin/com/persagy/server/services/objects/FloorService.kt

@@ -26,6 +26,7 @@
 
 package com.persagy.server.services.objects
 
+import com.persagy.base.extensions.toJson
 import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.Opt
@@ -250,12 +251,16 @@ object FloorService : Service<Floor>(SMybatisDao(Floor::class.java)) {
 //                                }
 //                            }
 //                        }else{
-                            val update = update(floor)
-
-                            if (update){
-                                listId.add(floor.id!!)
-                                try {
-                                    /** 日志 */
+                        val update: Boolean
+                        if (!request.nullItems.isNullOrEmpty()) {
+                            update = update(floor,request.nullItems)
+                        }else {
+                            update = update(floor)
+                        }
+                        if (update){
+                            listId.add(floor.id!!)
+                            try {
+                                /** 日志 */
 //                                    val dataCenterLogs = DataCenterLogs()
 //                                    dataCenterLogs.id = IdUtils.uuidCreate()
 //                                    dataCenterLogs.author = "dataCenter"
@@ -270,14 +275,14 @@ object FloorService : Service<Floor>(SMybatisDao(Floor::class.java)) {
 //                                    dataCenterLogs.dataSource = hashMap
 //                                    logService.insert(dataCenterLogs)
 
-                                    rabbitMqService.sendObjects(projectId!!, Opt.UPDATE,floor.id!!)
-                                    logger.debug("更新标记= ***********************************************************************************")
-                                    DataCenterLogsService.addLogs(projectId,"update","floor",
-                                        floor.id!!,floor,account,comming)
-                                } catch (e: Exception) {
-                                    e.printStackTrace()
-                                }
+                                rabbitMqService.sendObjects(projectId!!, Opt.UPDATE,floor.id!!)
+                                logger.debug("更新标记= ***********************************************************************************")
+                                DataCenterLogsService.addLogs(projectId,"update","floor",
+                                    floor.id!!,floor,account,comming)
+                            } catch (e: Exception) {
+                                e.printStackTrace()
                             }
+                        }
 
                     } catch (e: Exception) {
                         e.printStackTrace()
@@ -330,11 +335,15 @@ object FloorService : Service<Floor>(SMybatisDao(Floor::class.java)) {
         return try {
             val sBaseResponse = SBaseResponse(SResponseType.success)
             if (!request.content.isNullOrEmpty()){
-                val listOutline = ArrayList<String>()
-                listOutline.add("outline")
                 if (!request.content.isNullOrEmpty()){
                     for (floorOutline in request.content!!){
-                        val update = update(floorOutline, listOutline)
+                        logger.debug("楼层=${floorOutline.toJson()}")
+                        val update: Boolean
+                        if (!request.nullItems.isNullOrEmpty()) {
+                            update = update(floorOutline,request.nullItems)
+                        }else {
+                            update = update(floorOutline)
+                        }
                         if (update) {
                             rabbitMqService.sendObjects(Opt.projectId!!, Opt.UPDATE,floorOutline.id!!)
                         }

+ 217 - 3
datacenter/src/main/kotlin/com/persagy/server/services/relation_calc/ManualRelationAddService.kt

@@ -34,6 +34,7 @@ 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.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.response.ManualRelationCalcSCreateResponse
 import com.persagy.server.jms.RabbitMqService
 import com.persagy.server.services.objects.*
@@ -65,6 +66,10 @@ class ManualRelationAddService {
         }
     }
 
+    /** 区域服务-建筑和建筑 */
+    private val rRBd2BdService = SObjectService(SMybatisDao(RBd2Bd::class.java))
+
+
 
     /** 资产服务 */
     private val relPropertyService = SObjectService(SMybatisDao(RelProperty::class.java))
@@ -1918,11 +1923,220 @@ class ManualRelationAddService {
             sCreateResponse.message = "添加成功"
             return sCreateResponse
 
-        }else {
+        }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_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))
+
+            if (!relationAddRequest.type.isNullOrEmpty()&&relationAddRequest.type == "cadId"){
+                /** 从对象不存在cadId编码 */
+                sCreateResponse.result = SResponseType.failure
+                sCreateResponse.message = "主对象不存在CADID编码"
+                sCreateResponse.errorType = "1"
+                return sCreateResponse
+            }
+            if (relationAddRequest.relType == "ArchForArch_Bd2Bd"||relationAddRequest.relType == "ArchForArch_Bd2Fl"||relationAddRequest.relType == "ArchForArch_Bd2Sh"
+                ||relationAddRequest.relType == "ArchForArch_Bd2Sp"){
+                /** 建筑服务于建筑 */
+                val buildingList = BuildingService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
+                if (buildingList.size<1){
+                    /** 主对象不存在 */
+                    sCreateResponse.result = SResponseType.failure
+                    sCreateResponse.message = relationAddRequest.mainContent+":不存在"
+                    sCreateResponse.errorType = "1"
+                    return sCreateResponse
+                }
+                if (buildingList.size>1){
+                    /** 主对象编码识别到多个实例 */
+                    sCreateResponse.result = SResponseType.failure
+                    sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
+                    sCreateResponse.errorType = "1"
+                    return sCreateResponse
+                }
+
+                val building = buildingList[0]
+                if (relationAddRequest.relType == "ArchForArch_Bd2Bd") {
+
+                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 rBd2Bd = RBd2Bd()
+                    rBd2Bd.id1 = building.id
+                    rBd2Bd.id2 = buildingTo.id
+                    rBd2Bd.projectId = projectId
+                    rBd2Bd.type = relationAddRequest.relType
+                    rBd2Bd.sign = 1
+                    rRBd2BdService.replace(rBd2Bd)
+                }
+                }else if (relationAddRequest.relType == "ArchForArch_Bd2Fl") {
+                    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 rBd2Bd = RBd2Bd()
+                        rBd2Bd.id1 = building.id
+                        rBd2Bd.id2 = floorTo.id
+                        rBd2Bd.projectId = projectId
+                        rBd2Bd.type = relationAddRequest.relType
+                        rBd2Bd.sign = 1
+//                        sReplaceBuilder.tableName = "relationship.r_bd2bd"
+////                        rRBd2BdService.replace(rBd2Bd,sReplaceBuilder)
+                    }
+
+                }else if (relationAddRequest.relType =="ArchForArch_Bd2Sh") {
+                    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 rBd2Bd = RBd2Bd()
+                        rBd2Bd.id1 = building.id
+                        rBd2Bd.id2 = shaftTo.id
+                        rBd2Bd.projectId = projectId
+                        rBd2Bd.type = relationAddRequest.relType
+                        rBd2Bd.sign = 1
+//                        sReplaceBuilder.tableName = "relationship.r_bd2sh"
+//                        rRBd2BdService.replace(rBd2Bd,sReplaceBuilder)
+                    }
+                }else if (relationAddRequest.relType =="ArchForArch_Bd2Sh") {
+
+                }else if (relationAddRequest.relType =="ArchForArch_Bd2Sp") {
+
+                }
+            }else if (relationAddRequest.relType == "ArchForArch_Fl2Bd"||relationAddRequest.relType == "ArchForArch_Fl2Fl"
+                ||relationAddRequest.relType == "ArchForArch_Fl2Sh"||relationAddRequest.relType == "ArchForArch_Fl2Sp") {
+                /** 楼层服务 */
+                val floorList = FloorService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
+                if (floorList.size<1){
+                    /** 主对象不存在 */
+                    sCreateResponse.result = SResponseType.failure
+                    sCreateResponse.message = relationAddRequest.mainContent+":不存在"
+                    sCreateResponse.errorType = "1"
+                    return sCreateResponse
+                }
+                if (floorList.size>1){
+                    /** 主对象编码识别到多个实例 */
+                    sCreateResponse.result = SResponseType.failure
+                    sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
+                    sCreateResponse.errorType = "1"
+                    return sCreateResponse
+                }
+
+                if (relationAddRequest.relType == "ArchForArch_Fl2Bd") {
+
+                } else if (relationAddRequest.relType == "ArchForArch_Fl2Fl") {
+
+                } else if (relationAddRequest.relType == "ArchForArch_Fl2Sh") {
+
+                }else if (relationAddRequest.relType == "ArchForArch_Fl2Sp") {
+
+                }
+
+            }else if (relationAddRequest.relType == "ArchForArch_Sh2Bd"|| relationAddRequest.relType == "ArchForArch_Sh2Fl"||
+                relationAddRequest.relType == "ArchForArch_Sh2Sh"||relationAddRequest.relType == "ArchForArch_Sh2Sp") {
+                /** 楼层服务 */
+                val shaftList = ShaftService.select(SFilter.eq("projectId", projectId!!), SFilter.eq(relationAddRequest.type!!, relationAddRequest.mainContent!!)).exec()
+                if (shaftList.size<1){
+                    /** 主对象不存在 */
+                    sCreateResponse.result = SResponseType.failure
+                    sCreateResponse.message = relationAddRequest.mainContent+":不存在"
+                    sCreateResponse.errorType = "1"
+                    return sCreateResponse
+                }
+                if (shaftList.size>1){
+                    /** 主对象编码识别到多个实例 */
+                    sCreateResponse.result = SResponseType.failure
+                    sCreateResponse.message = relationAddRequest.mainContent+":存在多个实例"
+                    sCreateResponse.errorType = "1"
+                    return sCreateResponse
+                }
+                if (relationAddRequest.relType == "ArchForArch_Sh2Bd"){
+
+                }else if (relationAddRequest.relType == "ArchForArch_Sh2Fl"){
+
+                }else if (relationAddRequest.relType == "ArchForArch_Sh2Sh"){
+
+                }else if (relationAddRequest.relType == "ArchForArch_Sh2Sp"){
+
+                }
+            }
+
+        }
             sCreateResponse.result = SResponseType.success
             sCreateResponse.message = "添加成功"
-            return sCreateResponse
-        }
+
+        return sCreateResponse
     } // Fun
 
 

+ 2 - 2
datacenter/src/main/resources/application-test.yml

@@ -28,8 +28,8 @@ server:
 
 spring:
   datasource:
-    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
-#    url:                                jdbc:postgresql://datacenter:5432/datacenterlabsl
+    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://datacenter:5432/datacenter
     username:                           postgres
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 

+ 3 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/models/api/obj/EquipApi.kt

@@ -228,6 +228,9 @@ object EquipApi {
             } else {
                 val url = "http://${Configure.serviceNameConfig.DMPRWD}/rwd/instance/object/create?groupCode=$groupCode&projectId=${projectId}&appId=datacenter"
                 val postObject = Configure.restTemplate.postForObject(url, listObj, MiddleGroundDataRespose::class.java)
+                logger.debug("url= ${url}")
+                logger.debug("url= ${listObj.toJson()}")
+                logger.debug("结果=${postObject.toJson()}")
                 if (postObject.result == "success") {
                     return postObject
                 }

+ 2 - 2
equip-component/src/main/kotlin/com/persagy/server/service/base/Service.kt

@@ -67,7 +67,7 @@ open class Service<ENTITY : BaseInfo>(daoClass: SAbstractDao<ENTITY>) : SObjectS
             jsonObject.put("projectId",projectId)
             jsonObject.put("id", it.keyValue("id"))
             /** 发送消息 */
-            messageHandler!!.sendMessage(jsonObject.toString())
+//            messageHandler!!.sendMessage(jsonObject.toString())
         }
         logger.debug("创建完成 =******************************************************************")
         return
@@ -92,7 +92,7 @@ open class Service<ENTITY : BaseInfo>(daoClass: SAbstractDao<ENTITY>) : SObjectS
         jsonObject.put("infos", jsonArray)
         logger.debug("修改发送消息$jsonObject")
         /** 发送消息 */
-        messageHandler!!.sendMessage(jsonObject.toString())
+//        messageHandler!!.sendMessage(jsonObject.toString())
 
         return
     } // Function onUpdateSuccess()

+ 9 - 3
equip-component/src/main/kotlin/com/persagy/server/service/labsl/CustomSqlLabslService.kt

@@ -107,9 +107,11 @@ class CustomSqlLabslService {
                     ).exec()
                 /** 系统类型 */
                 val setSystem = HashSet<String>()
-                for (defClass in defClassList){
+                for (defClass in defClassList) {
                     setSystem.add(defClass.systemCode!!)
                 }
+                if (setSystem.size > 0) {
+
                 /** 系统类型列表 */
                 val systemCodeList =
                     defClassService.select(
@@ -117,7 +119,7 @@ class CustomSqlLabslService {
                         SFilter.eq("groupCode", dictProject!!.groupCode!!),
                         SFilter.inList("code", setSystem.toList())
                     ).exec()
-                for(systemCode in systemCodeList) {
+                for (systemCode in systemCodeList) {
                     for (defClass in defClassList) {
                         if (defClass.systemCode == systemCode.code) {
                             if (systemCode.children.isNullOrEmpty()) {
@@ -147,7 +149,7 @@ class CustomSqlLabslService {
                     defClass.aliasCode = majorCode.aliasCode
                     defClass.aliasName = majorCode.aliasName
                     for (systemCode in systemCodeList) {
-                        if (systemCode.majorCode == majorCode.code ) {
+                        if (systemCode.majorCode == majorCode.code) {
                             if (defClass.children.isNullOrEmpty()) {
                                 defClass.children = ArrayList<DefClass>()
                             }
@@ -166,6 +168,10 @@ class CustomSqlLabslService {
                 sQueryResponse.content = majorList
                 /** 总数量 */
                 sQueryResponse.total = majorList.size.toLong()
+            }else {
+                    /** 返回的对象列表 */
+                    sQueryResponse.content = ArrayList()
+               }
             } else {
                 sQueryResponse.result = SResponseType.failure
                 sQueryResponse.message = "项目下没有设备类型"

+ 3 - 2
equip-component/src/main/resources/application-test.yml

@@ -12,14 +12,15 @@ eureka:
     prefer-ip-address:                      true
 
 server:
-  port: 8080
+  port: 8087
 
 spring:
   datasource:
 #    url:                                jdbc:postgresql://data-center:5432/datacenter
 #    username:                           postgres
 #    password:                           123qwe!@#
-    url:                                jdbc:postgresql://datacenter:5432/datacenter
+#    url:                                jdbc:postgresql://datacenter:5432/datacenter
+    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
 #    url:                                jdbc:postgresql://datacenter:5432/datacenterlabsl
     username:                           postgres
 #    password:                           persagy_2020qwe!@#

+ 3 - 0
gradle.properties

@@ -28,6 +28,9 @@ PERSAGY_URL = http://www.persagy.cn
 PERSAGY_KOTLIN_VERSION = 1.4.121
 PERSAGY_SERVICE_VERSION = 1.4.164
 
+#PERSAGY_KOTLIN_VERSION = 1.4.128
+#PERSAGY_SERVICE_VERSION = 1.4.165
+
 MAVEN_REPO_PUBLIC_URL = http://dev.dp.sagacloud.cn:8082/repository/maven-public/
 MAVEN_REPO_RELEASE_URL = http://dev.dp.sagacloud.cn:8082/repository/maven-releases/
 MAVEN_REPO_SNAPSHOT_URL = http://dev.dp.sagacloud.cn:8082/repository/maven-snapshots/