Parcourir la source

**************************************万达adm**********************************************
提交

zhangweixin il y a 4 ans
Parent
commit
53ae82d85b

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

@@ -24,7 +24,7 @@
  * *********************************************************************************************************************
  */
 
-package com.persagy.server.datacenter.datacenter.models.entities.rel
+package com.persagy.server.datacenter.wanda.rel
 
 import com.persagy.server.datacenter.models.entities.base.RBaseInfo
 import io.swagger.v3.oas.annotations.media.Schema

+ 101 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/REq2SpTwo.kt

@@ -0,0 +1,101 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.datacenter.wanda.rel
+
+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 张维新
+ */
+@Schema(description = "设备空间分区关系")
+@Table(name = "relationship.r_eq2sp")
+class REq2SpTwo : RBaseInfo(){
+
+    /** 设备Id */
+    @Schema(description = "设备Id")
+    @Id
+    @Column(name = "eq_id")
+    var id1: String? = null
+
+    /** 空间Id */
+    @Schema(description = "空间Id")
+    @Id
+    @Column(name = "sp_id")
+    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
+
+    /** 空间类型 */
+    @Schema(description = "空间类型 " )
+    @Id
+    @Column(name = "zone_type")
+    var zoneType: String? = null
+
+    @Column(name = "bim_type_id")
+    var bimTypeId: String? = null
+
+    @Column(name = "system_category")
+    var systemCategotry: String? = null
+
+    @Column(name = "code_name")
+    var codeName2: String? = null
+
+    @Column(name = "local_id1")
+    var localId1: String? = null
+
+    @Column(name = "class_code")
+    var classCode1: String? = null
+
+    @Column(name = "local_id2")
+    var localId2: String? = null
+
+    @Column(name = "local_name2")
+    var localName2: String? = null
+
+}

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

@@ -24,7 +24,7 @@
  * *********************************************************************************************************************
  */
 
-package com.persagy.server.datacenter.datacenter.models.entities.rel
+package com.persagy.server.datacenter.wanda.rel
 
 import com.persagy.server.datacenter.models.entities.base.RBaseInfo
 import io.swagger.v3.oas.annotations.media.Schema

+ 101 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/REq2SyTwo.kt

@@ -0,0 +1,101 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .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-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.datacenter.wanda.rel
+
+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 张维新
+ */
+@Schema(description = "设备系统关系")
+@Table(name = "relationship.r_sy2eq")
+class REq2SyTwo : RBaseInfo(){
+
+    /** 设备Id */
+    @Schema(description = "设备Id")
+    @Id
+    @Column(name = "eq_id")
+    var id2: String? = null
+
+    /** 系统Id */
+    @Schema(description = "系统Id")
+    @Id
+    @Column(name = "sy_id")
+    var id1: 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
+
+    @Column(name = "bim_type_id")
+    var bimTypeId: String? = null
+
+    @Column(name = "system_category")
+    var systemCategotry: String? = null
+
+    @Column(name = "code_name2")
+    var codeName2: String? = null
+
+    @Column(name = "code_name1")
+    var codeName1: String? = null
+
+    @Column(name = "local_id1")
+    var localId1: String? = null
+
+    @Column(name = "local_id2")
+    var localId2: String? = null
+
+    @Column(name = "local_name1")
+    var localName1: String? = null
+
+    @Column(name = "class_code1")
+    var classCode1: String? = null
+
+    @Column(name = "class_code2")
+    var classCode2: String? = null
+
+}

+ 22 - 0
data-core/src/main/kotlin/com/persagy/server/datacenter/wanda/rel/RelEq2SpEquip.kt

@@ -0,0 +1,22 @@
+package com.persagy.server.datacenter.wanda.rel
+
+import com.persagy.service.models.annotations.SCascade
+import io.swagger.v3.oas.annotations.media.Schema
+import javax.persistence.Table
+
+/**
+ * 设备和建筑的关系
+ *
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2021/2/25 18:16
+ */
+@Schema(description = "设备信息实体类")
+@Table(name = "equipment")
+class RelEq2SpEquip: EquipmentBase() {
+
+    /** 级联-设备服务的建筑 */
+    @Schema(description = "级联-设备服务的建筑")
+    @SCascade(table="relationship.r_eq2sp", idColumn="eq_id", childIdColumn="sp_id")
+    var objectInfo: ArrayList<RelZoneSpaceBd>? = null
+
+}

+ 2 - 2
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/graphtype/GraphicTypeMapperService.kt

@@ -28,8 +28,8 @@ package com.persagy.server.datacenter.services.graphtype
 
 import com.persagy.database.SFilter
 import com.persagy.mybatis.SMybatisDao
-import com.persagy.server.datacenter.datacenter.models.entities.rel.REq2Sp
-import com.persagy.server.datacenter.datacenter.models.entities.rel.REq2Sy
+import com.persagy.server.datacenter.wanda.rel.REq2Sp
+import com.persagy.server.datacenter.wanda.rel.REq2Sy
 import com.persagy.server.datacenter.models.entities.graphtype.GraphicType
 import com.persagy.server.datacenter.models.entities.graphtype.RelationTypeProject
 import com.persagy.server.mappers.IRelationCountMapper

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REq2SpService.kt

@@ -26,7 +26,7 @@
 
 package com.persagy.server.services.rel
 
-import com.persagy.server.datacenter.datacenter.models.entities.rel.REq2Sp
+import com.persagy.server.datacenter.wanda.rel.REq2Sp
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.Opt
 import com.persagy.server.jms.RabbitMqService

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqForSpBaseService.kt

@@ -29,7 +29,7 @@ package com.persagy.server.services.rel
 import com.persagy.base.extensions.toJson
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.Opt
-import com.persagy.server.datacenter.datacenter.models.entities.rel.REq2Sp
+import com.persagy.server.datacenter.wanda.rel.REq2Sp
 import com.persagy.server.datacenter.models.entities.rel.REqForSpBase
 import com.persagy.server.datacenter.models.entities.rel.RSpForEqBaseList
 import com.persagy.server.datacenter.services.base.RService

+ 1 - 1
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/rel/REqInSpBaseService.kt

@@ -29,7 +29,7 @@ package com.persagy.server.services.rel
 import com.persagy.base.extensions.toJson
 import com.persagy.mybatis.SMybatisDao
 import com.persagy.server.Opt
-import com.persagy.server.datacenter.datacenter.models.entities.rel.REq2Sp
+import com.persagy.server.datacenter.wanda.rel.REq2Sp
 import com.persagy.server.datacenter.models.entities.rel.REqInSpBase
 import com.persagy.server.datacenter.models.entities.rel.REqInSpBaseList
 import com.persagy.server.datacenter.models.entities.rel.RSpInEqBaseList

+ 94 - 18
datacenter/src/main/kotlin/com/persagy/server/datacenter/services/relation_calc/ManualRelationCalcService.kt

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