Browse Source

调试模型解析过程

lijie 3 years ago
parent
commit
308f0b9df5

+ 12 - 28
docker/dockerfiles/labsl/Dockerfile

@@ -1,36 +1,20 @@
 #构建此镜像的基础镜像
-FROM java:8-jre
+FROM tomcat:9.0-jdk8
 #指定作者名称
 MAINTAINER lijie<lijie@persagy.com>
-
-#定义标签属性
 LABEL tier=backend
-LABEL product=adm
-LABEL project=labsl
+LABEL product=bdtp
+LABEL project=persagy
 LABEL name=labsl
-
-#设置环境变量
-ENV JAVA_OPTS -Dfile.encoding=UTF-8 -Xms2048m -Xmx2048m
 ENV TZ Asia/Shanghai
-#ARG 可以接收docker build命令中以--build-arg 指定的参数
-ARG WORKER_HOME
-
-#执行的命令
-RUN apt-get install -y --no-install-recommends tzdata && rm -rf /var/lib/apt/lists/*
+ENV JAVA_OPTS -Dfile.encoding=UTF-8
+RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list && apt-get clean
+#RUN apt-get update || true && apt-get install -y --no-install-recommends tzdata nfs-common curl && rm -rf /var/lib/apt/lists/*
 RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime	&& echo 'Asia/Shanghai' > /etc/timezone
-
-RUN mkdir -p $WORKER_HOME/config
-
-#复制文件到容器内
-COPY *.jar $WORKER_HOME/app.jar
-COPY entrypoint.sh $WORKER_HOME/
-COPY version.txt $WORKER_HOME/
-COPY config $WORKER_HOME/config
-#设置工作目录
-WORKDIR $WORKER_HOME
-
-#查看上述复制的文件,是否复制成功
-RUN ls
-
-#启动执行
+RUN rm -rf webapps/*
+COPY *.war webapps/
+RUN unzip webapps/*.war -d webapps/ROOT
+RUN rm -rf webapps/*.war
+COPY entrypoint.sh .
+RUN chmod +x entrypoint.sh
 ENTRYPOINT ["sh","./entrypoint.sh"]

+ 7 - 1
docker/dockerfiles/labsl/entrypoint.sh

@@ -1,3 +1,9 @@
 #!/bin/bash
 echo "entrypoint run..."
-java -jar $JAVA_OPTS -Dserver.port=$SERVER_PORT -Deureka.client.service-url.defaultZone=$EUREKA_CLIENT_DEFAULT_ZONE -Dspring.cloud.config.profile=$SPRING_CLOUD_CONFIG_PROFILE -Dspring.cloud.config.uri=$SPRING_CLOUD_CONFIG_URI app.jar
+default_hosts(){
+echo "**********************start /etc/hosts*****************************************"
+	cat /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/config.properties
+ echo "********************************************end*****************************"
+}
+default_hosts
+sh bin/catalina.sh run

+ 12 - 6
labsl/src/main/resources/application.yml

@@ -39,17 +39,23 @@ spring:
     name: labsl
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://rm-2ze20ntn5y9ljsx147o.mysql.rds.aliyuncs.com:3306/labsl?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
-    username: root
-    password: zVmW58LaAtjIKbb
+#    url: jdbc:mysql://rm-2ze20ntn5y9ljsx147o.mysql.rds.aliyuncs.com:3306/labsl?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+#    username: root
+#    password: zVmW58LaAtjIKbb
+    url:                                jdbc:mysql://192.168.100.91:9934/labsl?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+    username:                           root
+    password:                           persagy@2021
 
   second-datasource:
     name: labsl
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://rm-2ze20ntn5y9ljsx147o.mysql.rds.aliyuncs.com:3306/qibaishi_gallery?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
-    username: root
-    password: zVmW58LaAtjIKbb
+#    url: jdbc:mysql://rm-2ze20ntn5y9ljsx147o.mysql.rds.aliyuncs.com:3306/qibaishi_gallery?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+#    username: root
+#    password: zVmW58LaAtjIKbb
+    url:                                jdbc:mysql://192.168.100.91:9934/qibaishi_gallery?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+    username:                           root
+    password:                           persagy@2021
 
   jackson:
     date-format:                        yyyy-MM-dd HH:mm:ss

+ 1 - 1
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/backstage/BackMainThread.kt

@@ -54,7 +54,7 @@ class BackMainThread {
      * 定时任务, 处理它们的状态, 当前未完成时, 不会执行下一个scheduled
      */
     //@Scheduled(cron = "0 0/1 * * * ?")
-    @Scheduled(fixedRate = 1000 * 60 * 2, initialDelay = 1000)
+    @Scheduled(fixedRate = 1000 * 60 * 3, initialDelay = 1000)
     fun run() {
         if(states.isEmpty()) {
 //            states.addAll(arrayListOf(state31, state3))

+ 9 - 0
revit-algorithm/src/main/kotlin/cn/sagacloud/server/algorithm/services/json/RevitIdAnalyzer.kt

@@ -2,8 +2,10 @@ package cn.sagacloud.server.algorithm.services.json
 
 import cn.sagacloud.server.algorithm.models.entities.BaseComponent
 import cn.sagacloud.server.algorithm.models.entities.Connector
+import cn.sagacloud.server.algorithm.models.entities.Pipe
 import cn.sagacloud.server.algorithm.models.jsonAnalyzer.AllComponents
 import cn.sagacloud.server.algorithm.models.jsonAnalyzer.BaseObj
+import cn.sagacloud.server.algorithm.models.jsonAnalyzer.Parameter
 import cn.sagacloud.server.algorithm.services.CommonService
 import com.sybotan.database.SFilter
 import com.sybotan.service.SObjectService
@@ -40,6 +42,13 @@ object RevitIdAnalyzer {
             obj.modelId = baseObj.modelId
             if(obj.revitId != null && obj.revitId!!.isNotEmpty())
                 revitIdMap[obj.revitId!!] = obj
+            if (obj as? Pipe!=null && (obj as? Pipe)?.parameters!=null){
+                (obj as? Pipe)?.parameters!!.forEach { parameter: Parameter ->
+                    run {
+                        parameter.value = parameter.value!!.replace("\'", "")
+                    }
+                }
+            }
         }
         service.delete(SFilter.and(SFilter.eq("modelId", baseObj.modelId!!), SFilter.eq("elementType", elementType)))
         val create = SCreateRequest<BaseComponent>()

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

@@ -1,6 +1,6 @@
 ###############################################################################################################
 server:
-  port: 8080
+  port: 8878
   tomcat:
     basedir:                            /mnt/harddisk/saga/tomcatTemp
 
@@ -111,7 +111,8 @@ properties:
     mergeMultipartUpload:              ${properties.fileService.url}common/merge_multipart${properties.fileService.suffixWithSecret}&uploadId=
 
   scheduler:
-    url:                               http://82.157.26.241:8080/
+    #url:                               http://82.157.26.241:8080/
+    url:                               http://127.0.0.1:8877/
     createTask:                        ${properties.scheduler.url}task/create
     queryTask:                         ${properties.scheduler.url}task/query
     queryTaskResult:                   ${properties.scheduler.url}result/query
@@ -120,7 +121,7 @@ properties:
 
   datacenter:
     #url:                                http://39.105.112.36/datacenter/
-    url:                                http://localhost:8876/
+    url:                                http://127.0.0.1:8876/
     # 设备相关接口
     equipCreate: ${properties.datacenter.url}object/equip/create
     equipDelete: ${properties.datacenter.url}object/equip/delete

+ 7 - 5
scheduler/src/main/resources-dev/application.yml

@@ -18,7 +18,7 @@
 ###############################################################################################################
 
 server:
-  port: 8080
+  port: 8877
 #  ssl:
 #    key-store:                          classpath:keystore.key
 #    key-store-password:                 20090421
@@ -39,10 +39,12 @@ spring:
     name: scheduler_str
     type: com.alibaba.druid.pool.DruidDataSource
     driver-class-name: com.mysql.cj.jdbc.Driver
-    url: jdbc:mysql://rm-2ze20ntn5y9ljsx147o.mysql.rds.aliyuncs.com:3306/scheduler_str?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
-    username: root
-    password: zVmW58LaAtjIKbb
-
+#    url: jdbc:mysql://rm-2ze20ntn5y9ljsx147o.mysql.rds.aliyuncs.com:3306/scheduler_str?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+#    username: root
+#    password: zVmW58LaAtjIKbb
+    url:                                jdbc:mysql://192.168.100.91:9934/scheduler_str?allowMultiQueries=true&serverTimezone=UTC&useUnicode=true&useSSL=false&characterEncoding=UTF-8
+    username:                           root
+    password:                           persagy@2021
   jackson:
     date-format:                        yyyy-MM-dd HH:mm:ss
     time-zone:                          Asia/Shanghai