Browse Source

fix bug:
1.修复阿里云安全漏洞
2.日志中加上skywalking的traceId

lijie 2 years ago
parent
commit
e079520140

+ 3 - 1
gradle.properties

@@ -138,4 +138,6 @@ PLANTUML_VERSION = 1.0.24
 DIGITAL_START_VERSION = 1.0.0
 
 
-PERSAGY_INTERGERT_VERSION = 1.0.0
+PERSAGY_INTERGERT_VERSION = 1.0.0
+
+APM_SKYWALKING_VERSION = 8.3.0

+ 6 - 5
labsl/build.gradle

@@ -49,7 +49,7 @@ dependencies {
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // spring cloud 依赖
-    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-eureka-client', version:  SPRING_CLOUD_CONFIG_VERSION
+    // compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-eureka-client', version:  SPRING_CLOUD_CONFIG_VERSION
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
@@ -60,10 +60,11 @@ dependencies {
     compile group: 'org.springdoc', name: 'springdoc-openapi-ui', version: SPRING_DOC_VERSION
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // Sybotan依赖
-
-    compile group: "com.persagy", name: "persagy-kotlin-base", version: PERSAGY_KOTLIN_VERSION
+    compile group: "com.alibaba", name: "fastjson", version: FAST_JSON_VERSION
+    compile(group: "com.persagy", name: "persagy-kotlin-base", version: PERSAGY_KOTLIN_VERSION){exclude group: 'com.alibaba',module:'fastjson'}
     compile group: "com.persagy", name: "persagy-kotlin-database", version: PERSAGY_KOTLIN_VERSION
-    compile group: "com.persagy", name: "persagy-kotlin-mybatis", version: PERSAGY_KOTLIN_VERSION
+    compile(group: "com.persagy", name: "persagy-kotlin-mybatis", version: PERSAGY_KOTLIN_VERSION) {exclude group: 'org.mybatis',module:'mybatis'}
+    compile group: "org.mybatis", name: "mybatis", version: MYBATIS_CORE_VERSION
     compile group: "com.persagy", name: "persagy-kotlin-mysql", version: PERSAGY_KOTLIN_VERSION
     compile group: "com.persagy", name: "persagy-service-base", version: PERSAGY_SERVICE_VERSION
     compile group: "com.persagy", name: "persagy-service-mybatis", version: PERSAGY_SERVICE_VERSION
@@ -76,7 +77,7 @@ dependencies {
     compile group: "org.testng", name: "testng", version: TESTNG_VERSION
     // Log 工具
     compile group: "org.projectlombok", name: "lombok", version: LOMBOK_VERSION
-
+    compile group: 'org.apache.skywalking', name: 'apm-toolkit-logback-1.x', version: APM_SKYWALKING_VERSION
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 

+ 4 - 2
labsl/src/main/resources/logback-spring.xml

@@ -21,8 +21,10 @@
 <configuration scan="true" debug="false">
     <contextName>scanbuilding</contextName>
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
+                <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread])  %green([%tid]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+            </layout>
         </encoder>
     </appender>
 

+ 1 - 0
meiku/build.gradle

@@ -100,6 +100,7 @@ dependencies {
     compile group: "org.testng", name: "testng", version: TESTNG_VERSION
     // Log 工具
     compile group: "org.projectlombok", name: "lombok", version: LOMBOK_VERSION
+    compile group: 'org.apache.skywalking', name: 'apm-toolkit-logback-1.x', version: APM_SKYWALKING_VERSION
     // spring cloud 依赖
     // compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-eureka-client', version:  SPRING_CLOUD_CONFIG_VERSION
 

+ 4 - 2
meiku/src/main/resources/logback-spring.xml

@@ -21,8 +21,10 @@
 <configuration scan="true" debug="false">
     <contextName>scanbuilding</contextName>
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
+                <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread])  %green([%tid]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+            </layout>
         </encoder>
     </appender>
 

+ 6 - 5
message-center/build.gradle

@@ -96,18 +96,19 @@ dependencies {
 //    compile group: "com.sybotan", name: "sybotan-service-base", version: SYBOTAN_SERVICE_VERSION
 //    compile group: "com.sybotan", name: "sybotan-service-mybatis", version: SYBOTAN_SERVICE_VERSION
 
-
-    compile group: "com.persagy", name: "persagy-kotlin-base", version: PERSAGY_KOTLIN_VERSION
+    compile group: "com.alibaba", name: "fastjson", version: FAST_JSON_VERSION
+    compile(group: "com.persagy", name: "persagy-kotlin-base", version: PERSAGY_KOTLIN_VERSION){exclude group: 'com.alibaba',module:'fastjson'}
     compile group: "com.persagy", name: "persagy-kotlin-database", version: PERSAGY_KOTLIN_VERSION
-    compile group: "com.persagy", name: "persagy-kotlin-mybatis", version: PERSAGY_KOTLIN_VERSION
+    compile(group: "com.persagy", name: "persagy-kotlin-mybatis", version: PERSAGY_KOTLIN_VERSION) {exclude group: 'org.mybatis',module:'mybatis'}
+    compile group: "org.mybatis", name: "mybatis", version: MYBATIS_CORE_VERSION
     compile group: "com.persagy", name: "persagy-kotlin-mysql", version: PERSAGY_KOTLIN_VERSION
     compile group: "com.persagy", name: "persagy-service-base", version: PERSAGY_SERVICE_VERSION
     compile group: "com.persagy", name: "persagy-service-mybatis", version: PERSAGY_SERVICE_VERSION
     compile group: "com.persagy", name: "persagy-service-mysql", version: PERSAGY_SERVICE_VERSION
     compile group: "com.persagy", name: "dmp-digital-starter", version: DIGITAL_START_VERSION
-
+    compile group: 'org.apache.skywalking', name: 'apm-toolkit-logback-1.x', version: APM_SKYWALKING_VERSION
     // spring cloud 依赖
-    compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-eureka-client', version:  SPRING_CLOUD_CONFIG_VERSION
+    // compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-eureka-client', version:  SPRING_CLOUD_CONFIG_VERSION
 
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // 数据中心依赖

+ 4 - 2
message-center/src/main/resources/logback-spring.xml

@@ -27,8 +27,10 @@
 <configuration scan="true" debug="false">
     <contextName>messagecenter</contextName>
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
+                <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread])  %green([%tid]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+            </layout>
         </encoder>
     </appender>
 

+ 1 - 0
revit-algorithm/build.gradle

@@ -138,6 +138,7 @@ dependencies {
 
     // http://47.93.132.139:8081/nexus/content/repositories/persagy/
     compile group: 'org.geotools', name: 'gt-main', version: '25.2'
+    compile group: 'org.apache.skywalking', name: 'apm-toolkit-logback-1.x', version: APM_SKYWALKING_VERSION
 
     // 数据中心依赖
     compile project(":old-data-core")

+ 2 - 4
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/backstage/sync/SyncEquipment.kt

@@ -2,18 +2,16 @@ package cn.sagacloud.server.algorithm.backstage.sync
 
 import cn.sagacloud.server.algorithm.backstage.model.datacenter.DCEquipment
 import cn.sagacloud.server.algorithm.backstage.model.datacenter.DCFloor
-import cn.sagacloud.server.algorithm.services.datacenter.DataCenterService
 import cn.sagacloud.server.algorithm.models.entities.Equipment
 import cn.sagacloud.server.algorithm.models.jsonAnalyzer.Point
 import cn.sagacloud.server.algorithm.models.modelFile.FloorModel
 import cn.sagacloud.server.algorithm.services.BaseDataService
 import cn.sagacloud.server.algorithm.services.CommonService
+import cn.sagacloud.server.algorithm.services.datacenter.DataCenterService
 import com.sybotan.database.SFilter
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.context.annotation.Scope
 import org.springframework.stereotype.Component
-import kotlin.collections.ArrayList
-import kotlin.collections.HashMap
 
 
 /**
@@ -157,7 +155,7 @@ class SyncEquipment : SyncObject{
             dcEquip.localName = it.value.localName
             dcEquip.localId = it.value.localId
             dcEquip.bimId = it.key
-//            dcEquip.floorId = dcFloor!!.id
+            //dcEquip.floorId = dcFloor!!.id
             dcEquip.familyName = it.value.familyName
             dcEquip.familySymbol = it.value.familySymbol
             dcEquip.modelId = it.value.modelId

+ 8 - 3
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/common/utils/SpaceAffectUtil.kt

@@ -22,7 +22,6 @@ import org.locationtech.jts.geom.GeometryFactory
 import org.locationtech.jts.geom.LinearRing
 import org.locationtech.jts.geom.Polygon
 import org.slf4j.LoggerFactory
-import org.springframework.beans.BeanUtils
 import org.springframework.beans.factory.annotation.Autowired
 import org.springframework.stereotype.Component
 import java.util.*
@@ -173,8 +172,14 @@ class SpaceAffectUtil {
             try {
                 ring = createRing(geometryFactory,list)
             }catch (ingroed:IllegalArgumentException){
-                val newPoint=Point()
-                BeanUtils.copyProperties(list!![0],newPoint)
+                if (list.isNullOrEmpty()){
+                    return null
+                }
+                val first = list[0]
+                val newPoint = Point()
+                newPoint.x=first.x
+                newPoint.y=first.y
+                newPoint.z=first.z
                 list.add(newPoint)
                 ring = createRing(geometryFactory,list)
             }

+ 13 - 13
revit-algorithm/src/main/resources-dev/application.yml

@@ -21,12 +21,12 @@ spring:
 #    url:                                jdbc:mysql://rm-2ze20ntn5y9ljsx147o.mysql.rds.aliyuncs.com:3306/revit?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
 #    username:                           root
 #    password:                           zVmW58LaAtjIKbb
-#    url:                                jdbc:mysql://192.168.100.91:9934/revit?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
-#    username:                           root
-#    password:                           persagy@2021
-    url:                                jdbc:mysql://cd-cdb-nboe1rje.sql.tencentcdb.com:61955/revit?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+    url:                                jdbc:mysql://192.168.100.91:9934/revit?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
     username:                           root
-    password:                           Bdtp@1qaz@WSX
+    password:                           persagy@2021
+#    url:                                jdbc:mysql://cd-cdb-nboe1rje.sql.tencentcdb.com:61955/revit?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+#    username:                           root
+#    password:                           Bdtp@1qaz@WSX
 
   second_datasource:
     name:                               revit-algorithm
@@ -35,12 +35,12 @@ spring:
 #    url:                                jdbc:mysql://rm-2ze20ntn5y9ljsx147o.mysql.rds.aliyuncs.com:3306/revit_calc?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
 #    username:                           root
 #    password:                           zVmW58LaAtjIKbb
-#    url:                                jdbc:mysql://192.168.100.91:9934/revit_calc?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
-#    username:                           root
-#    password:                           persagy@2021
-    url:                                jdbc:mysql://cd-cdb-nboe1rje.sql.tencentcdb.com:61955/revit_calc?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+    url:                                jdbc:mysql://192.168.100.91:9934/revit_calc?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
     username:                           root
-    password:                           Bdtp@1qaz@WSX
+    password:                           persagy@2021
+#    url:                                jdbc:mysql://cd-cdb-nboe1rje.sql.tencentcdb.com:61955/revit_calc?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+#    username:                           root
+#    password:                           Bdtp@1qaz@WSX
 
   jackson:
     date-format:                        yyyy-MM-dd HH:mm:ss
@@ -93,7 +93,7 @@ properties:
   fileService:
     # 基本属性
     # url:                               http://api.sagacloud.cn/dp-auxiliary/image-service/ # http://47.93.33.207:28888/image-service/ #http://adm.sagacloud.cn/image-service/
-    url:                               http://localhost:8080/ # http://47.93.33.207:28888/image-service/ #http://adm.sagacloud.cn/image-service/
+    url:                               http://common.ysbdtp.com/image-service/ # http://47.93.33.207:28888/image-service/ #http://adm.sagacloud.cn/image-service/
     #url:                               http://image-service:8080/
     systemId: revit
     secret: 63afbef6906c342b
@@ -120,7 +120,7 @@ properties:
 
   scheduler:
     #url:                               http://82.157.26.241:8080/
-    url:                               http://127.0.0.1:8877/
+    url:                               http://develop.ysbdtp.com/scheduler
     createTask:                        ${properties.scheduler.url}task/create
     queryTask:                         ${properties.scheduler.url}task/query
     queryTaskResult:                   ${properties.scheduler.url}result/query
@@ -165,6 +165,6 @@ properties:
     doorCreate: ${properties.datacenter.url}door/create_ignore
 
   message:
-    url: http://127.0.0.1:8879/
+    url: http://develop.ysbdtp.com/message-center
     # 发送消息接口
     createPath: ${properties.message.url}message/create

+ 4 - 2
revit-algorithm/src/main/resources-dev/logback-spring.xml

@@ -22,8 +22,10 @@
     <contextName>revit-algorithm</contextName>
     <springProperty name="LOG_LEVEL" scope="context" source="persagy.bdtp.logging.level" defaultValue="INFO"/>
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
+                <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread])  %green([%tid]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+            </layout>
         </encoder>
     </appender>
 

+ 4 - 2
revit-algorithm/src/main/resources-prod/logback-spring.xml

@@ -21,8 +21,10 @@
 <configuration scan="true" debug="false">
     <contextName>revit-algorithm</contextName>
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
+                <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread])  %green([%tid]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+            </layout>
         </encoder>
     </appender>
 

+ 4 - 2
revit-algorithm/src/main/resources-test/logback-spring.xml

@@ -21,8 +21,10 @@
 <configuration scan="true" debug="false">
     <contextName>revit-algorithm</contextName>
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
+                <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread])  %green([%tid]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+            </layout>
         </encoder>
     </appender>
 

+ 2 - 0
scanbuilding/build.gradle

@@ -116,6 +116,8 @@ dependencies {
     compile group: "org.projectlombok", name: "lombok", version: LOMBOK_VERSION
 
     compile group: "org.geotools", name: "gt-main", version: 25.2
+
+    compile group: 'org.apache.skywalking', name: 'apm-toolkit-logback-1.x', version: APM_SKYWALKING_VERSION
 //    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
 //    // 二维码与条形码
 //    // https://mvnrepository.com/artifact/com.google.zxing/core

+ 4 - 2
scanbuilding/src/main/resources/logback-spring.xml

@@ -27,8 +27,10 @@
 <configuration scan="true" debug="false">
     <contextName>scanbuilding</contextName>
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
+                <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread])  %green([%tid]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+            </layout>
         </encoder>
     </appender>
 

+ 2 - 0
scheduler/build.gradle

@@ -129,6 +129,8 @@ dependencies {
     // https://mvnrepository.com/artifact/com.fasterxml.uuid/java-uuid-generator
     compile group: 'com.fasterxml.uuid', name: 'java-uuid-generator', version: '3.2.0'
 
+    compile group: 'org.apache.skywalking', name: 'apm-toolkit-logback-1.x', version: APM_SKYWALKING_VERSION
+
 }
 
 //dependencyManagement {

+ 4 - 2
scheduler/src/main/resources/logback-spring.xml

@@ -21,8 +21,10 @@
 <configuration scan="true" debug="false">
     <contextName>datacenter</contextName>
     <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
-        <encoder>
-            <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
+            <layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
+                <pattern>%red(%d{yyyy-MM-dd HH:mm:ss}) %green([%thread])  %green([%tid]) %highlight(%-5level) %boldMagenta(%logger{10}) - %cyan(%msg%n)</pattern>
+            </layout>
         </encoder>
     </appender>