Browse Source

********************WX******************
调整空间关系

zhangweixin 4 years ago
parent
commit
30a33e171f

+ 1 - 1
datacenter/build.gradle

@@ -65,7 +65,7 @@ dependencies {
     compile group: 'org.springframework.boot',    name: 'spring-boot-starter-amqp', version: SPRING_BOOT_VERSION
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 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
 
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////*

+ 16 - 11
datacenter/src/main/kotlin/com/persagy/server/services/objects/GeneralSystemService.kt

@@ -54,6 +54,7 @@ import com.persagy.service.models.requests.SCreateRequest
 import com.persagy.service.models.requests.SQueryRequest
 import com.persagy.service.models.responses.SCreateResponse
 import com.persagy.service.models.responses.SQueryResponse
+import org.slf4j.LoggerFactory
 
 /**
  * 系统信息服务
@@ -63,6 +64,8 @@ import com.persagy.service.models.responses.SQueryResponse
 object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::class.java)) {
 
 
+    /** 日志 */
+    private val logger = LoggerFactory.getLogger(FloorService::class.java)
     /**
      * 创建之前的操作
      */
@@ -396,7 +399,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
         val syinFlService = SObjectService(SMybatisDao(RSyInFl::class.java))
         val syinBdService = SObjectService(SMybatisDao(RSyInBd::class.java))
         val buildingFloorInfoService = SObjectService(SMybatisDao(BuildingFloorInfo::class.java))
-        val idList = ArrayList<String>()
+        val idList = HashSet<String>()
         val notIdList = ArrayList<String>()
         var list = ArrayList<SFilter>()
         list.add(SFilter.eq("projectId",projectId!!))
@@ -411,7 +414,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
             }else{
                 idList.add("")
             }
-            list.add(SFilter.inList("id",idList))
+            list.add(SFilter.inList("id",idList.toList()))
         }else if((floorId.isNullOrEmpty()||floorId.equals("1"))&&!buildingId.isNullOrEmpty()&&!buildingId.equals("1")){
             /** 楼层id为空,建筑id不为空且不为1 ---> 系统和建筑关系表 取系统id */
             val objList = syinBdService.select(SFilter.eq("buildingId", buildingId)).distinct().projection("sysId").exec()
@@ -422,7 +425,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
             }else{
                 idList.add("")
             }
-            list.add(SFilter.inList("id", idList))
+            list.add(SFilter.inList("id", idList.toList()))
         }else if(!floorId.isNullOrEmpty()&&floorId.equals("1")&&!buildingId.isNullOrEmpty()&&buildingId.equals("1")){
             /** 楼层id为1,建筑id为1 ---> 系统id不在(系统和楼层关系表 取系统id  系统和建筑关系表 取系统id)之内*/
             val objList1 = syinFlService.selectAll().distinct().projection("sysId").exec()
@@ -437,7 +440,7 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
                     idList.add(obj.sysId!!)
                 }
             }
-            list.add(SFilter.not(SFilter.inList("id", idList)))
+            list.add(SFilter.not(SFilter.inList("id", idList.toList())))
         }else if(!floorId.isNullOrEmpty()&&!floorId.equals("1")&&!buildingId.isNullOrEmpty()&&!buildingId.equals("1")){
             /** 楼层id不为空,建筑id不为空 ---> 系统和楼层关系表 取系统id  将建筑id作为条件 */
             val objList = syinFlService.select(SFilter.eq("floorId", floorId),SFilter.eq("buildingId", buildingId)).distinct().projection("sysId").exec()
@@ -448,19 +451,21 @@ object GeneralSystemService : Service<GeneralSystem>(SMybatisDao(GeneralSystem::
             }else{
                 idList.add("")
             }
-            list.add(SFilter.inList("id", idList))
+
+            list.add(SFilter.inList("id", idList.toList()))
         }
 //        else if(floorId.isNullOrEmpty()&&buildingId.isNullOrEmpty()){
 //            /** 楼层id为空,建筑id为空 ---> 查询所有 */
 //        }
+        logger.debug("id01= ${list.toJson()}")
         val pageInfo = pageQuery(request, list)
 
-        for(system in pageInfo.content!!){
-            val queryBuilder = buildingFloorInfoService.selectAll()
-            queryBuilder.tableName="f_get_bd_and_fl('${system.id}','$buildingId','$floorId')"
-            val bdflList = queryBuilder.exec()
-            system.buildingFloorInfoList = bdflList
-        }
+//        for(system in pageInfo.content!!){
+//            val queryBuilder = buildingFloorInfoService.selectAll()
+//            queryBuilder.tableName="f_get_bd_and_fl('${system.id}','$buildingId','$floorId')"
+//            val bdflList = queryBuilder.exec()
+//            system.buildingFloorInfoList = bdflList
+//        }
         return pageInfo
     } // Fun pageQuerys
 

+ 11 - 6
datacenter/src/main/resources/application-prod.yml

@@ -3,13 +3,18 @@
 eureka:
   client:                                   #客户端注册进eureka服务列表内
     service-url:
-      defaultZone:                          http://eureka-service:8761/eureka
-
+      #      defaultZone:                          http://192.168.64.18:9931/eureka
+      defaultZone:                                http://frame:123456@39.102.43.179:9931/eureka/
+      #      defaultZone:                                http://frame:123456@192.168.64.18: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)启用主动失效,
   instance:
-    # 实例ID
-    # instance-id:                            ${spring.application.name}:${server.port}:${project.version}
-    # 优先使用IP地址方式进行注册服务
-    prefer-ip-address:                      true
+    #不加的话我看过eureka注册界面,是以docker容器的container id注册过去的,譬如container id为abcde,
+    #那么当访问该微服务时,eureka以http://abcde/xxx,去访问的,当然是访问不到该服务.
+    #配置下面的选项后,就会以内网ip加端口去访问就能访问到了。
+    prefer-ip-address: true
+    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
 
 #启用监控
 management:

+ 14 - 14
datacenter/src/main/resources/application-test.yml

@@ -28,27 +28,27 @@ server:
 
 spring:
   datasource:
-#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
-    url:                                jdbc:postgresql://datacenter:5432/datacenterlabsl
+    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://datacenter:5432/datacenterlabsl
 #    url:                                jdbc:postgresql://datacenter:5432/datacenter
     username:                           postgres
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
-  rabbitmq:
-    host: 192.168.100.108
-    port: 9936
-    username: pbsage
-    password: pbsage123
-    #虚拟host 可以不设置,使用server默认host
-    virtual-host: /adm
-
 #  rabbitmq:
-#    host: 192.168.64.15
+#    host: 192.168.100.108
 #    port: 9936
-#    username: admin
-#    password: brzj123456
+#    username: pbsage
+#    password: pbsage123
 #    #虚拟host 可以不设置,使用server默认host
-#    virtual-host: /test
+#    virtual-host: /adm
+
+  rabbitmq:
+    host: 192.168.64.15
+    port: 9936
+    username: admin
+    password: brzj123456
+    #虚拟host 可以不设置,使用server默认host
+    virtual-host: /test
 
 
   servlet:

+ 12 - 2
datacenter/src/main/resources/logback-spring.xml

@@ -37,13 +37,23 @@
         </encoder>
     </appender>
 
+<!--    &lt;!&ndash; 定义cn.sagacloud包的日志级别 &ndash;&gt;-->
+<!--    <logger name="com.persagy" level="debug" additivity="false">-->
+<!--        <appender-ref ref="STDOUT"/>-->
+<!--    </logger>-->
+
+<!--    &lt;!&ndash; 定义com.persagy包的日志级别 &ndash;&gt;-->
+<!--    <logger name="com.persagy" level="debug" additivity="false">-->
+<!--        <appender-ref ref="STDOUT"/>-->
+<!--    </logger>-->
+
     <!-- 定义cn.sagacloud包的日志级别 -->
-    <logger name="com.persagy" level="debug" additivity="false">
+    <logger name="com.persagy" level="ERROR" additivity="false">
         <appender-ref ref="STDOUT"/>
     </logger>
 
     <!-- 定义com.persagy包的日志级别 -->
-    <logger name="com.persagy" level="debug" additivity="false">
+    <logger name="com.persagy" level="ERROR" additivity="false">
         <appender-ref ref="STDOUT"/>
     </logger>
 

+ 1 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/services/jms/DataCenterEquipment.kt

@@ -306,7 +306,7 @@ class DataCenterEquipment {
         message.objName = "设备"
         message.opsName = ParamTools.operationType(message.type!!)
         val entity =
-            DClassDefService.select(SFilter.eq("projectId", equip.projectId!!), SFilter.eq("code", equip.classCode!!))
+            DClassDefService.select(SFilter.eq("code", equip.classCode!!))
                 .entity()
         if (entity!=null) {
             message.classCodeName = entity.name

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

@@ -5,8 +5,8 @@ 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.15:5432/datacenter
+#    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
     username:                           postgres
     #    password:                           persagy_2020qwe!@#

+ 15 - 15
datasyn/src/main/resources/application-test.yml

@@ -12,29 +12,29 @@ eureka:
 
 spring:
   datasource:
-#    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
-    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
+#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
     username:                           postgres
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
 
 
     #配置rabbitMq 服务器
-  rabbitmq:
-    host: 192.168.100.108
-    port: 9936
-    username: pbsage
-    password: pbsage123
-    #虚拟host 可以不设置,使用server默认host
-    virtual-host: /adm
-
 #  rabbitmq:
-#    host: 192.168.64.15
+#    host: 192.168.100.108
 #    port: 9936
-#    username: admin
-#    password: brzj123456
+#    username: pbsage
+#    password: pbsage123
 #    #虚拟host 可以不设置,使用server默认host
-#    virtual-host: /test
+#    virtual-host: /adm
+
+  rabbitmq:
+    host: 192.168.64.15
+    port: 9936
+    username: admin
+    password: brzj123456
+    #虚拟host 可以不设置,使用server默认host
+    virtual-host: /test
 
 
 saga:
@@ -49,7 +49,7 @@ mqtopid:
 
 custom:
   #true 代表eureka  false  代表 http
-  eurekaorhttp:                       false
+  eurekaorhttp:                       true
 
 # 服务名
 servicename:

+ 12 - 12
datasyn/src/main/resources/logback-spring.xml

@@ -32,26 +32,26 @@
         </encoder>
     </appender>
 
-    <!-- 定义cn.sagacloud包的日志级别 -->
-    <logger name="com.persagy" level="DEBUG" additivity="false">
-        <appender-ref ref="STDOUT"/>
-    </logger>
-
-    <!-- 定义com.persagy包的日志级别 -->
-    <logger name="com.persagy" level="DEBUG" additivity="false">
-        <appender-ref ref="STDOUT"/>
-    </logger>
-
 <!--    &lt;!&ndash; 定义cn.sagacloud包的日志级别 &ndash;&gt;-->
-<!--    <logger name="com.persagy" level="ERROR" additivity="false">-->
+<!--    <logger name="com.persagy" level="DEBUG" additivity="false">-->
 <!--        <appender-ref ref="STDOUT"/>-->
 <!--    </logger>-->
 
 <!--    &lt;!&ndash; 定义com.persagy包的日志级别 &ndash;&gt;-->
-<!--    <logger name="com.persagy" level="ERROR" additivity="false">-->
+<!--    <logger name="com.persagy" level="DEBUG" additivity="false">-->
 <!--        <appender-ref ref="STDOUT"/>-->
 <!--    </logger>-->
 
+    <!-- 定义cn.sagacloud包的日志级别 -->
+    <logger name="com.persagy" level="ERROR" additivity="false">
+        <appender-ref ref="STDOUT"/>
+    </logger>
+
+    <!-- 定义com.persagy包的日志级别 -->
+    <logger name="com.persagy" level="ERROR" additivity="false">
+        <appender-ref ref="STDOUT"/>
+    </logger>
+
 
 <!--    &lt;!&ndash; 定义cn.sagacloud包的日志级别 &ndash;&gt;-->
 <!--    <logger name="com.persagy" level="ERROR" additivity="false">-->

+ 1 - 1
equip-component/build.gradle

@@ -61,7 +61,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
equip-component/src/main/kotlin/com/persagy/server/models/ComponentProperty.kt

@@ -88,7 +88,7 @@ class ComponentProperty : BaseInfo(){
     /** 部件类型code */
     @Schema(description = "部件类型code")
     @Column(name = "class_code")
-    var classCode: String? = null
+    var category: String? = null
 
     /** 部件所在建筑id */
     @Schema(description = "部件所在建筑id")

+ 21 - 11
equip-component/src/main/kotlin/com/persagy/server/service/objects/EquipmentService.kt

@@ -748,7 +748,7 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
 //                            any.addAll(equipUpDateEnclosure.installDrawing!!)
 //                            equip!!.infos!![Opt.INSTALLDRAWING] = any
                         } else {
-                            equip!!.infos!![Opt.INSTALLDRAWING]
+                            equip!!.infos!![Opt.INSTALLDRAWING] = equipUpDateEnclosure.installDrawing!!
                         }
                     }
                     if (!equipUpDateEnclosure.installPic.isNullOrEmpty()){
@@ -1003,11 +1003,16 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
                         if (containsKey1) {
 
                             if (!equip.infos!![Opt.FanCharacterCurve].toString().isNullOrEmpty()&&equip.infos!![Opt.FanCharacterCurve].toString()!="null"){
-                                val gson = Gson()
-                                val type  = object : TypeToken<ArrayList<TaskPic>>() {}.getType()
-                                val list: ArrayList<TaskPic> = gson.fromJson(equip.infos!![Opt.FanCharacterCurve]!!.toJson(), type)
-                                list.addAll(equipUpDateEnclosure.fanCharacterCurve!!)
-                                equip!!.infos!![Opt.FanCharacterCurve] = list
+                                try {
+                                    val gson = Gson()
+                                    val type  = object : TypeToken<ArrayList<TaskPic>>() {}.getType()
+                                    val list: ArrayList<TaskPic> = gson.fromJson(equip.infos!![Opt.FanCharacterCurve]!!.toJson(), type)
+                                    list.addAll(equipUpDateEnclosure.fanCharacterCurve!!)
+                                    equip!!.infos!![Opt.FanCharacterCurve] = list
+                                } catch (e: Exception) {
+                                    e.printStackTrace()
+                                    equip!!.infos!![Opt.FanCharacterCurve] = equipUpDateEnclosure.fanCharacterCurve!!
+                                }
                             }else {
                                 equip!!.infos!![Opt.FanCharacterCurve] = equipUpDateEnclosure.fanCharacterCurve!!
                             }
@@ -1023,11 +1028,16 @@ object EquipmentService : Service<Equipment>(SMybatisDao(Equipment::class.java))
                         if (containsKey1) {
 
                             if (!equip.infos!![Opt.DesignIDGraph].toString().isNullOrEmpty()&&equip.infos!![Opt.DesignIDGraph].toString()!="null"){
-                                val gson = Gson()
-                                val type  = object : TypeToken<ArrayList<TaskPic>>() {}.getType()
-                                val list: ArrayList<TaskPic> = gson.fromJson(equip.infos!![Opt.DesignIDGraph]!!.toJson(), type)
-                                list.addAll(equipUpDateEnclosure.designIDGraph!!)
-                                equip!!.infos!![Opt.DesignIDGraph] = list
+                                try {
+                                    val gson = Gson()
+                                    val type  = object : TypeToken<ArrayList<TaskPic>>() {}.getType()
+                                    val list: ArrayList<TaskPic> = gson.fromJson(equip.infos!![Opt.DesignIDGraph]!!.toJson(), type)
+                                    list.addAll(equipUpDateEnclosure.designIDGraph!!)
+                                    equip!!.infos!![Opt.DesignIDGraph] = list
+                                } catch (e: Exception) {
+                                    e.printStackTrace()
+                                    equip!!.infos!![Opt.DesignIDGraph] = equipUpDateEnclosure.designIDGraph!!
+                                }
                             }else {
                                 equip!!.infos!![Opt.DesignIDGraph] = equipUpDateEnclosure.designIDGraph!!
                             }

+ 16 - 14
equip-component/src/main/resources/application-prod.yml

@@ -1,15 +1,4 @@
 
-# spring-cloud相关配置
-eureka:
-  client:                                   #客户端注册进eureka服务列表内
-    service-url:
-      defaultZone:                          http://eureka-service:8761/eureka
-
-  instance:
-    # 实例ID
-    # instance-id:                            ${spring.application.name}:${server.port}:${project.version}
-    # 优先使用IP地址方式进行注册服务
-    prefer-ip-address:                      true
 
 server:
   port: 8080
@@ -20,10 +9,23 @@ spring:
 #    username:                           postgres
 #    password:                           123qwe!@#
     url:                                jdbc:postgresql://172.17.100.16:5432/datacenter
-#    url:                                jdbc:postgresql://172.17.11.228:5432/datacenterlabsl
-#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
     username:                           postgres
-#    password:                           persagy_2020qwe!@#
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
 
+# spring-cloud相关配置
+eureka:
+  client:                                   #客户端注册进eureka服务列表内
+    service-url:
+      #      defaultZone:                          http://192.168.64.18:9931/eureka
+      defaultZone:                                http://frame:123456@39.102.43.179:9931/eureka/
+      #      defaultZone:                                http://frame:123456@192.168.64.18: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)启用主动失效,
+  instance:
+    #不加的话我看过eureka注册界面,是以docker容器的container id注册过去的,譬如container id为abcde,
+    #那么当访问该微服务时,eureka以http://abcde/xxx,去访问的,当然是访问不到该服务.
+    #配置下面的选项后,就会以内网ip加端口去访问就能访问到了。
+    prefer-ip-address: true
+    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}

+ 2 - 2
equip-component/src/main/resources/application-test.yml

@@ -20,8 +20,8 @@ spring:
 #    username:                           postgres
 #    password:                           123qwe!@#
 #    url:                                jdbc:postgresql://datacenter:5432/datacenter
-    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
-#    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
+#    url:                                jdbc:postgresql://192.168.64.15:5432/datacenter
+    url:                                jdbc:postgresql://192.168.64.14:5432/datacenterlabsl
 #    url:                                jdbc:postgresql://datacenter:5432/datacenterlabsl
     username:                           postgres
 #    password:                           persagy_2020qwe!@#

+ 1 - 1
message-center/build.gradle

@@ -64,7 +64,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

+ 14 - 9
message-center/src/main/resources/application-prod.yml

@@ -3,13 +3,18 @@
 eureka:
   client:                                   #客户端注册进eureka服务列表内
     service-url:
-      defaultZone:                          http://eureka-service:8761/eureka
-
+      #      defaultZone:                          http://192.168.64.18:9931/eureka
+      defaultZone:                                http://frame:123456@39.102.43.179:9931/eureka/
+      #      defaultZone:                                http://frame:123456@192.168.64.18: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)启用主动失效,
   instance:
-    # 实例ID
-    # instance-id:                            ${spring.application.name}:${server.port}:${project.version}
-    # 优先使用IP地址方式进行注册服务
-    prefer-ip-address:                      true
+    #不加的话我看过eureka注册界面,是以docker容器的container id注册过去的,譬如container id为abcde,
+    #那么当访问该微服务时,eureka以http://abcde/xxx,去访问的,当然是访问不到该服务.
+    #配置下面的选项后,就会以内网ip加端口去访问就能访问到了。
+    prefer-ip-address: true
+    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}
 
 #启用监控
 management:
@@ -34,9 +39,9 @@ spring:
     username:                           postgres
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
-  activemq:
-    broker-url:                         tcp://60.205.177.43:61616
-#    broker-url:                         tcp://172.17.100.16:61616
+#  activemq:
+#    broker-url:                         tcp://60.205.177.43:61616
+##    broker-url:                         tcp://172.17.100.16:61616
   servlet:
     multipart:
       max-request-size:                500MB        # 限制上传的多个文件的总大小

+ 2 - 2
message-center/src/main/resources/application.yml

@@ -3,13 +3,13 @@ server:
 
 spring:
     application:
-      name:                               messagecenter
+      name:                               message-center
     mvc:
       favicon:
         enabled:                          true
 
     jmx:
-      default-domain:                     messagecenter
+      default-domain:                     message-center
 
 
     datasource:

+ 1 - 1
scanbuilding/build.gradle

@@ -62,7 +62,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

+ 16 - 0
scanbuilding/src/main/resources/application-prod.yml

@@ -13,3 +13,19 @@ spring:
     password:                           cGVyc2FneV8yMDIwcXdlIUAj
 
 
+# spring-cloud相关配置
+eureka:
+  client:                                   #客户端注册进eureka服务列表内
+    service-url:
+      #      defaultZone:                          http://192.168.64.18:9931/eureka
+      defaultZone:                                http://frame:123456@39.102.43.179:9931/eureka/
+      #      defaultZone:                                http://frame:123456@192.168.64.18: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)启用主动失效,
+  instance:
+    #不加的话我看过eureka注册界面,是以docker容器的container id注册过去的,譬如container id为abcde,
+    #那么当访问该微服务时,eureka以http://abcde/xxx,去访问的,当然是访问不到该服务.
+    #配置下面的选项后,就会以内网ip加端口去访问就能访问到了。
+    prefer-ip-address: true
+    instance-id: ${spring.cloud.client.ip-address}:${spring.application.name}:${server.port}