Browse Source

**************************************万达adm*********************************************
修改手动同步设备对象

zhangweixin 3 years ago
parent
commit
1b6bb5bb95

+ 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()
+//    }
 
     /**
      * 配置应用

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

@@ -159,7 +159,7 @@ 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))