Browse Source

********************WX******************
getEquipByBimId

zhangweixin 4 năm trước cách đây
mục cha
commit
b6e206bed7

+ 6 - 7
datacenter/src/main/kotlin/com/persagy/server/mappers/IRelationExcelExportMapper.kt

@@ -125,13 +125,12 @@ interface IRelationExcelExportMapper {
      * @param   type            关系类型
      * @return  关系记录
      */
-    @Select("SELECT r.id1 AS id, eq.name, eq.local_id, eq.local_name,eq.cad_id, '设备' AS object_type,\n" +
-            "(SELECT local_name FROM public.building WHERE id = eq.building_id) AS building_name,\n" +
-            "(SELECT local_name FROM public.floor WHERE id = eq.floor_id) AS floor_name\n" +
-            ",r.id2 AS _id, sp.name AS _name, sp.local_id AS _local_id, sp.local_name AS _local_name, '设备' AS _object_type, \n" +
-            "(SELECT local_name FROM building WHERE id = sp.building_id ) AS _building_name,\n" +
-            "(SELECT local_name FROM floor WHERE id = sp.floor_id) AS _floor_name \n" +
-            "FROM relationship.r_eq2eq r JOIN equipment AS eq ON r.id1 = eq.id JOIN equipment AS sp ON r.id2 = sp.id WHERE r.project_id = #{projectId} AND r.type = #{type} ")
+    @Select("SELECT r.id1 AS id,eq.cad_id, eq.name, eq.local_id, eq.local_name,eq.cad_id, '设备' AS object_type," +
+            "(SELECT local_name FROM public.building WHERE id = eq.building_id) AS building_name,(SELECT local_name FROM public.floor " +
+            "WHERE id = eq.floor_id) AS floor_name,r.id2 AS _id, sp.cad_id AS _cad_id ,sp.name AS _name, sp.local_id AS _local_id, sp.local_name" +
+            " AS _local_name, '设备' AS _object_type,(SELECT local_name FROM building WHERE id = sp.building_id ) AS _building_name," +
+            "(SELECT local_name FROM floor WHERE id = sp.floor_id) AS _floor_name FROM relationship.r_eq2eq r JOIN equipment AS eq ON r.id1 " +
+            "= eq.id JOIN equipment AS sp ON r.id2 = sp.id WHERE r.project_id = #{projectId} AND r.type = #{type} ")
     fun eq2eq(projectId: String, type: String): List<HashMap<String, Any?>>
 
     /**

+ 5 - 2
datacenter/src/main/kotlin/com/persagy/server/mappers/RelationProvider.kt

@@ -116,8 +116,11 @@ class RelationProvider {
                 WHERE("block.project_id = '${projectId}'")
                 AND()
                 WHERE("mep_system_type in (${mepStr})")
-                AND()
-                WHERE("bimid in (${bimStr})")
+                if (!bimStr.trim().isEmpty()) {
+                    AND()
+                    WHERE("bimid in (${bimStr})")
+                }
+
                 if(buildingId != null) {
                     AND()
                     WHERE("building_id = '${buildingId}'")

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

@@ -116,8 +116,8 @@ object RelationTypeProjectService : RService<RelationTypeProject>(SMybatisDao(Re
         map
     }
 
-    val itemList = arrayOf("_sbm", "abc", "name", "id", "local_id", "local_name", "object_type", "building_floor",
-            "_sbm", "_abc", "_name", "_id", "_local_id", "_local_name","_object_type", "_building_floor")
+    val itemList = arrayOf("_sbm", "cad_id", "name", "id", "local_id", "local_name", "object_type", "building_floor",
+            "_sbm", "_cad_id", "_name", "_id", "_local_id", "_local_name","_object_type", "_building_floor")
     val itemListTwo = arrayOf( "id", "local_id", "local_name","category")
 
     /** 关系记录启始行 */

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

@@ -34,9 +34,9 @@ spring:
     type:                               com.alibaba.druid.pool.DruidDataSource
     driver-class-name:                  org.postgresql.Driver
 #    url:                                jdbc:postgresql://60.205.177.43:5432/datacenterlabsl
-#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
 #    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
-    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
+#    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
     username:                           postgres
 #    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj

+ 12 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/controllers/obj/ObjectToFromController.kt

@@ -205,7 +205,18 @@ class ObjectToFromController {
                     val updateObj =
                         EquipApi.updateObj(dictProject!!.groupCode!!, projectId, EquipUtil.equipTools(projectId, equip))
                     if (updateObj!=null&&updateObj.result == "success") {
-                        logger.debug("设备更新失败:${equip.toJson()}")
+                        logger.debug("设备更新成功:${equip.id}")
+                    }else {
+                        logger.debug("设备更新失败:${equip.id}")
+                    }
+                }else {
+                    logger.debug("设备创建失败:${equip.id}")
+                    val updateObj =
+                        EquipApi.updateObj(dictProject!!.groupCode!!, projectId, EquipUtil.equipTools(projectId, equip))
+                    if (updateObj!=null&&updateObj.result == "success") {
+                        logger.debug("设备更新成功:${equip.id}")
+                    }else {
+                        logger.debug("设备更新失败:${equip.id}")
                     }
                 }
                 if (!equip.buildingId.isNullOrEmpty()) {

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

@@ -236,7 +236,7 @@ object EquipApi {
             if (!Configure.customProperties.eurekaorhttp) {
                 val url = "${opts.data_rwd}/rwd/instance/object/create?groupCode=$groupCode&projectId=${projectId}&appId=datacenter"
                 logger.debug("url= ${url}")
-                logger.debug("url= ${listObj.toJson()}")
+                logger.debug("boby= ${listObj.toJson()}")
                 logger.debug("结果=${listObj.toJson()}")
                 val postObject = SHttpUtil.postObject<MiddleGroundDataRespose>(url, listObj)
                 return postObject
@@ -244,7 +244,7 @@ object EquipApi {
                 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("boby= ${listObj.toJson()}")
                 logger.debug("结果=${postObject.toJson()}")
                 if (postObject.result == "success") {
                     return postObject

+ 5 - 4
datasyn/src/main/resources/application-dev.yml

@@ -5,9 +5,9 @@ spring:
 #    url:                                jdbc:postgresql://60.205.177.43:5432/datacenterlabsl
     #    username:                           postgres
     #    password:                           123qwe!@#
-#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
 #    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
-    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
+#    url:                                jdbc:postgresql://39.102.40.239:5432/datacenter
     username:                           postgres
     #    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
@@ -29,7 +29,8 @@ eureka:
   client:                                   #客户端注册进eureka服务列表内
     service-url:
 #      defaultZone:                          http://192.168.64.18:9931/eureka
-      defaultZone:                          http://frame:123456@192.168.64.18:9931/eureka
+#      defaultZone:                          http://frame:123456@192.168.64.18:9931/eureka
+      defaultZone:                           http://frame:123456@39.102.43.179:9931/eureka/
 #      defaultZone:                          http://admin:1qaz2wsx@127.0.0.1:8888/eureka/ #增加密码
       enable-self-preservation: false # 设为false,关闭自我保护
       eviction-interval-timer-in-ms: 5000 # 清理间隔(单位毫秒,默认是60*1000)启用主动失效,
@@ -46,7 +47,7 @@ mqtopid:
 
 custom:
   #true 代表eureka  false  代表 http
-  eurekaorhttp:                       false
+  eurekaorhttp:                       true
 
 # 服务名
 servicename:

+ 1 - 1
datasyn/src/main/resources/application-prod.yml

@@ -52,7 +52,7 @@ mqtopid:
 
 custom: # 自定义类型
   #true 代表eureka  false  代表 http
-  eurekaorhttp:                       false
+  eurekaorhttp:                       true
 
 # 服务名
 servicename: #注册中心使用,服务名

+ 2 - 1
datasyn/src/main/resources/application-test.yml

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