Pārlūkot izejas kodu

******************************************* wx *****************
修改接口

zhangweixin 4 gadi atpakaļ
vecāks
revīzija
9a12c765a0

+ 61 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/RwdRelationAdd.kt

@@ -26,13 +26,74 @@
 
 package com.persagy.server.syn.services.jms
 
+import com.persagy.server.syn.jms.bean.SyncRwdDatacenterMessage
+import org.springframework.stereotype.Service
+
 /**
  *
  * @author wx  <zhangweixin@sagacloud.com>
  * @date  2020/12/25 17:33
  */
+@Service
 class RwdRelationAdd {
 
+    /**
+     * 添加关系-中台
+     */
+    fun addRelation(message: SyncRwdDatacenterMessage){
+
+        if (!message.exts.isNullOrEmpty()){
+            val graphCodeContains = message.exts!!.contains("graphCode")
+            val relCodeContains = message.exts!!.contains("relCode")
+
+            if (graphCodeContains&&relCodeContains){
+                val graphCode = message.exts!!["graphCode"]
+                val relCode = message.exts!!["relCode"]
+                val objFrom = message.exts!!["objFrom"]
+                val objTo = message.exts!!["relCode"]
+                if (graphCode=="ArchSubset") {
+                    /** 建筑从属关系 */
+                }else if (graphCode=="ThroughRelationship") {
+                    /** 贯通关系 */
+                }else if (graphCode=="MechInArch") {
+                    /** 机电类所在区域关系 */
+                }else if (graphCode=="MechForArch") {
+                    /** 机电类服务区域关系 */
+                }
+
+
+
+                if (graphCode=="ArchSubset"&&relCode=="Bd2Fl"){
+                    /** 建筑下的楼层 */
+                } else if (graphCode=="ArchSubset"&&relCode=="Bd2Sh") {
+                    /** 建筑下的竖井 */
+                } else if (graphCode=="ArchSubset"&&relCode=="Bd2Sp") {
+                    /** 建筑下的业务空间 */
+                } else if (graphCode=="ArchSubset"&&relCode=="Fl2Sp") {
+                    /** 楼层下的业务空间 */
+                }else if (graphCode=="ArchSubset"&&relCode=="Sh2Sp") {
+                    /** 竖井下的业务空间 */
+                }else if (graphCode=="ArchSubset"&&relCode=="Sh2Sp") {
+                    /** 竖井下的业务空间 */
+                }else if (graphCode=="MechInArch"&&relCode=="Sy2Bd") {
+                    /** 系统所在建筑 */
+                }else if (graphCode=="MechInArch"&&relCode=="Sy2Fl") {
+                    /** 系统所在楼层 */
+                }else if (graphCode=="MechInArch"&&relCode=="Sy2Sh") {
+                    /** 系统所在竖井 */
+                }else if (graphCode=="MechInArch"&&relCode=="Sy2Sp") {
+                    /** 系统所在空间 */
+                }else if (graphCode=="MechInArch"&&relCode=="Eq2Bd") {
+                    /** 设备设施所在建筑 */
+                }else if (graphCode=="MechInArch"&&relCode=="Eq2Fl") {
+                    /** 设备设施所在楼层 */
+                }else if (graphCode=="MechInArch"&&relCode=="Eq2Fl") {
+                    /** 设备设施所在楼层 */
+                }
+
+            }
+        }
+    }
 
 
 }

+ 14 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/RwdRelationDel.kt

@@ -26,10 +26,24 @@
 
 package com.persagy.server.syn.services.jms
 
+import com.persagy.server.syn.jms.bean.SyncRwdDatacenterMessage
+
 /**
  *
  * @author wx  <zhangweixin@sagacloud.com>
  * @date  2020/12/25 17:33
  */
 class RwdRelationDel {
+
+    /**
+     * 删除关系-中台
+     *
+     * @param message   消息
+     */
+    fun delRelation(message: SyncRwdDatacenterMessage){
+        if (!message.exts.isNullOrEmpty()){
+
+        }
+    }
+
 }

+ 4 - 4
scanbuilding/src/main/kotlin/com/persagy/server/mappers/StatisticsCountMapper.kt

@@ -158,14 +158,14 @@ interface StatisticsCountMapper {
     /**
      * 统计设备任务下的部件类型以及数量
      */
-    @Select("SELECT category as code,(SELECT name FROM dict.class_def WHERE id = category) as name, COUNT(category) FROM scantask.equip_scan_task WHERE task_parent_id = #{id} AND parent_id = #{equipId} GROUP BY category")
-    fun categoryStatistics(id: String,equipId: String): ArrayList<CategoryStatistics>
+    @Select("SELECT class_code as code,(SELECT name FROM dict.def_class WHERE code = class_code and project_id = #{projectId})  ) as name, COUNT(class_code) FROM scantask.equip_scan_task WHERE task_parent_id = #{id} AND parent_id = #{equipId} GROUP BY class_code")
+    fun categoryStatistics(projectId:String,id: String,equipId: String): ArrayList<CategoryStatistics>
 
     /**
      * 统计模型设备部件类型以及数量
      */
-    @Select("SELECT category as code,(SELECT name FROM dict.class_def WHERE id = category) as name, COUNT(category) FROM scantask.model_scan_task WHERE task_parent_id = #{id} AND parent_id = #{equipId} GROUP BY category")
-    fun categoryStatisticsModel(id: String,equipId: String): ArrayList<CategoryStatistics>
+    @Select("SELECT mt.class_code as code,(SELECT name FROM dict.def_class WHERE code = mt.class_code and project_id = #{projectId}) as name, COUNT(class_code) FROM scantask.model_scan_task mt WHERE mt.task_parent_id = #{id} AND mt.parent_id = #{equipId} GROUP BY mt.class_code")
+    fun categoryStatisticsModel(projectId:String,id: String,equipId: String): ArrayList<CategoryStatistics>
 
     /**
      * 查询 当前模型文件下指定元空间内的设备

+ 2 - 1
scanbuilding/src/main/kotlin/com/persagy/server/services/task/ModelScanTaskService.kt

@@ -575,8 +575,9 @@ object ModelScanTaskService : RService<ModelScanTask>(SMybatisDao(ModelScanTask:
      */
     fun categoryCounts(equipScanTask: ModelScanTask): SQueryResponse<CategoryStatistics>{
         try {
+            val projectId = SPageContext.getHeader("projectId")
             if (!equipScanTask.id.isNullOrEmpty()&&!equipScanTask.equipId.isNullOrEmpty()){
-                val categoryStatistics = mapper.categoryStatisticsModel(equipScanTask.id!!, equipScanTask.equipId!!)
+                val categoryStatistics = mapper.categoryStatisticsModel(projectId!!,equipScanTask.id!!, equipScanTask.equipId!!)
                 val sQueryResponse = SQueryResponse<CategoryStatistics>()
                 sQueryResponse.total = categoryStatistics.size.toLong()
                 sQueryResponse.content = categoryStatistics

+ 5 - 3
scanbuilding/src/main/kotlin/com/persagy/server/services/task/ScanTaskBaseService.kt

@@ -174,8 +174,9 @@ object ScanTaskBaseService : RService<ScanTaskBase>(SMybatisDao(ScanTaskBase::cl
      */
     fun categoryCounts(equipScanTask: EquipScanTask): SQueryResponse<CategoryStatistics>{
         try {
+            val projectId = SPageContext.getHeader("projectId").toString()
             if (!equipScanTask.id.isNullOrEmpty()&&!equipScanTask.equipId.isNullOrEmpty()){
-                val categoryStatistics = mapper.categoryStatistics(equipScanTask.id!!, equipScanTask.equipId!!)
+                val categoryStatistics = mapper.categoryStatistics(projectId,equipScanTask.id!!, equipScanTask.equipId!!)
                 val sQueryResponse = SQueryResponse<CategoryStatistics>()
                 sQueryResponse.total = categoryStatistics.size.toLong()
                 sQueryResponse.content = categoryStatistics
@@ -198,16 +199,17 @@ object ScanTaskBaseService : RService<ScanTaskBase>(SMybatisDao(ScanTaskBase::cl
      */
     fun categoryCountsModel(type: String?,equipScanTask: ModelScanTask): SQueryResponse<CategoryStatistics>{
         try {
+            val projectId = SPageContext.getHeader("projectId")
             if (!equipScanTask.id.isNullOrEmpty()&&!equipScanTask.equipId.isNullOrEmpty()){
                 if (!type.isNullOrEmpty()&&type == "model"){
-                    val categoryStatistics = ModelScanTaskService.mapper.categoryStatisticsModel(equipScanTask.id!!, equipScanTask.equipId!!)
+                    val categoryStatistics = ModelScanTaskService.mapper.categoryStatisticsModel(projectId!!,equipScanTask.id!!, equipScanTask.equipId!!)
                     val sQueryResponse = SQueryResponse<CategoryStatistics>()
                     sQueryResponse.total = categoryStatistics.size.toLong()
                     sQueryResponse.content = categoryStatistics
                     sQueryResponse.result = SResponseType.success
                     return sQueryResponse
                 }else{
-                    val categoryStatistics = mapper.categoryStatistics(equipScanTask.id!!, equipScanTask.equipId!!)
+                    val categoryStatistics = mapper.categoryStatistics(projectId!!,equipScanTask.id!!, equipScanTask.equipId!!)
                     val sQueryResponse = SQueryResponse<CategoryStatistics>()
                     sQueryResponse.total = categoryStatistics.size.toLong()
                     sQueryResponse.content = categoryStatistics