Browse Source

Merge branch 'master' of http://39.106.8.246:3003/server/datacenter-wanda

caiaf 3 years ago
parent
commit
322aadfc87

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

@@ -93,7 +93,7 @@ object SpaceService : Service<ZoneIspace>(SMybatisDao(ZoneIspace::class.java)) {
             zoneSpace.buildingId = zoneIspace.buildingId
             zoneSpace.floorId = zoneIspace.floorId
             zoneSpace.bimId = zoneIspace.bimId
-            zoneSpace.classCode = "FunctionZone"
+            zoneSpace.classCode = "GeneralZone"
             zoneSpace.infos = zoneIspace.infos
             if(zoneIspace.outline != null){
                 zoneSpace.outline = arrayListOf(zoneIspace.outline!!)

+ 1 - 1
datasyn/build.gradle

@@ -66,7 +66,7 @@ dependencies {
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // spring cloud 依赖
-    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka', version: SPRING_CLOUD_VERSION
+//    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-eureka', version: SPRING_CLOUD_VERSION
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // MySQL

+ 1 - 1
datasyn/src/main/kotlin/com/persagy/server/datacenter/syn/Configure.kt

@@ -123,7 +123,7 @@ object Configure {
         jsonObject["objTo"] = objTo
         if (!relValue.isNullOrEmpty()) {
             /** 边类型属性, */
-            jsonObject["relValue"] = objTo
+            jsonObject["relValue"] = relValue
         }
         /** 添加到列表 */
         jsonArray.add(jsonObject)

+ 9 - 8
datasyn/src/main/kotlin/com/persagy/server/datacenter/syn/DataSynApp.kt

@@ -33,8 +33,9 @@ import org.springframework.boot.SpringApplication
 import org.springframework.boot.autoconfigure.SpringBootApplication
 import org.springframework.boot.builder.SpringApplicationBuilder
 import org.springframework.boot.web.servlet.support.SpringBootServletInitializer
-import org.springframework.cloud.client.loadbalancer.LoadBalanced
-import org.springframework.cloud.netflix.eureka.EnableEurekaClient
+//import org.springframework.cloud.client.loadbalancer.LoadBalanced
+//import org.springframework.cloud.client.loadbalancer.LoadBalanced
+//import org.springframework.cloud.netflix.eureka.EnableEurekaClient
 import org.springframework.context.annotation.Bean
 import org.springframework.context.annotation.ComponentScan
 import org.springframework.scheduling.annotation.EnableAsync
@@ -51,7 +52,7 @@ import org.springframework.web.client.RestTemplate
 @EnableScheduling   //开启定时注解
 @ComponentScan(basePackages = ["com.persagy", "com.persagy.server"])           // 配置组件扫描路径
 @MapperScan("com.persagy", "com.persagy.server")                       // Mapper组件扫描路径
-@EnableEurekaClient
+//@EnableEurekaClient
 @SpringBootApplication
 open class DataSynApp : SpringBootServletInitializer() {
     companion object {
@@ -60,11 +61,11 @@ open class DataSynApp : SpringBootServletInitializer() {
     } // Companion object
 
 
-    @Bean
-    @LoadBalanced //在注册中心里进行查找微服务,负载均衡
-    open fun restTemplate(): RestTemplate? {
-        return RestTemplate()
-    }
+//    @Bean
+//    @LoadBalanced //在注册中心里进行查找微服务,负载均衡
+//    open fun restTemplate(): RestTemplate? {
+//        return RestTemplate()
+//    }
 
     /**
      * 配置应用

+ 19 - 16
datasyn/src/main/kotlin/com/persagy/server/datacenter/syn/controllers/obj/ObjectToFromController.kt

@@ -159,28 +159,31 @@ class ObjectToFromController {
     fun equipSync(@RequestParam projectId: String): SBaseResponse {
         try {
             val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
-            val equipList = equipmentService.select(SFilter.eq("projectId", projectId)).exec()
+            val equipList = equipmentService.select(SFilter.eq("projectId", projectId)).order("lastUpdate desc").exec()
             for (equip in equipList) {
                 val createObj =
                     EquipApi.createObj(dictProject!!.groupCode!!, projectId, EquipUtil.equipTools(projectId, equip))
                 if (!createObj) {
-                    val updateObj =
-                        EquipApi.updateObj(dictProject!!.groupCode!!, projectId, EquipUtil.equipTools(projectId, equip))
-                    if (!updateObj) {
-                        logger.debug("设备更新失败:${equip.toJson()}")
-                    }
+
                 }
-                if (!equip.buildingId.isNullOrEmpty()) {
-                    val toJsonObjArray =
-                        Configure.toJsonObjArray("MechInArch", "Eq2Bd", equip.id!!, equip.buildingId!!)
-                    val toJsonObjArray2 =
-                        Configure.toJsonObjArray("MechInArch", "Eq2Fl", equip.id!!, equip.floorId!!)
-                    toJsonObjArray.add(toJsonObjArray2[0])
-                    val createRel = EquipApi.createRel(dictProject.groupCode!!, projectId, toJsonObjArray)
-                    if (!createRel){
-                        logger.debug("设备和楼层的关系失败:${equip.toJson()}")
-                    }
+                val updateObj =
+                    EquipApi.updateObj(dictProject!!.groupCode!!, projectId, EquipUtil.equipTools(projectId, equip))
+                if (!updateObj) {
+                    logger.debug("设备更新失败:${equip.toJson()}")
                 }
+//                if (!equip.buildingId.isNullOrEmpty()) {
+//                    val toJsonObjArray =
+//                        Configure.toJsonObjArray("MechInArch", "Eq2Bd", equip.id!!, equip.buildingId!!)
+//                    if (!equip.floorId.isNullOrEmpty()){
+//                        val toJsonObjArray2 =
+//                            Configure.toJsonObjArray("MechInArch", "Eq2Fl", equip.id!!, equip.floorId!!)
+//                        toJsonObjArray.add(toJsonObjArray2[0])
+//                    }
+//                    val createRel = EquipApi.createRel(dictProject.groupCode!!, projectId, toJsonObjArray)
+//                    if (!createRel){
+//                        logger.debug("设备和楼层的关系失败:${equip.toJson()}")
+//                    }
+//                }
             }
             return SBaseResponse(SResponseType.success)
         } catch (e: Exception) {

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

@@ -324,7 +324,7 @@ class RelToFromController {
             if (rEq2SpList.size>0) {
                 for (rEq2Sp in rEq2SpList) {
                     if (isDel) {
-                        val toJsonObj = Configure.toJsonObj(graphCode, type, rEq2Sp.id1!!, null)
+                        val toJsonObj = Configure.toJsonObj(graphCode, type, rEq2Sp.id1!!, rEq2Sp.id2)
                         EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
                     }
                     val toJsonObjArray =