Browse Source

********************WX************************
修复问题

zhangweixin 4 years ago
parent
commit
db99e31500

+ 3 - 1
datacenter/build.gradle

@@ -55,7 +55,8 @@ dependencies {
     providedCompile group: "org.springframework.boot", name:"spring-boot-starter-tomcat", version: SPRING_BOOT_VERSION
     providedCompile group: "org.springframework.boot", name:"spring-boot-starter-tomcat", version: SPRING_BOOT_VERSION
     // spring boot 缓存
     // spring boot 缓存
     compile group:"org.springframework.boot", name:"spring-boot-starter-cache", version: SPRING_BOOT_VERSION
     compile group:"org.springframework.boot", name:"spring-boot-starter-cache", version: SPRING_BOOT_VERSION
-
+    // RabbitMQ
+    compile group: 'org.springframework.boot',    name: 'spring-boot-starter-amqp', version: SPRING_BOOT_VERSION
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // spring cloud 依赖
     // 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
@@ -69,6 +70,7 @@ dependencies {
     //https://mvnrepository.com/artifact/org.postgresql/postgresql
     //https://mvnrepository.com/artifact/org.postgresql/postgresql
 //    compile group: 'org.postgresql',    name: 'postgresql',     version: POSTGRESQL_VERSION
 //    compile group: 'org.postgresql',    name: 'postgresql',     version: POSTGRESQL_VERSION
 
 
+
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
     // RESTful API 文档生成工具
     // RESTful API 文档生成工具
     // https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui
     // https://mvnrepository.com/artifact/io.springfox/springfox-swagger-ui

+ 8 - 11
datacenter/src/main/resources/application-dev.yml

@@ -38,19 +38,16 @@ spring:
     username:                           postgres
     username:                           postgres
     password:                           persagy_2020qwe!@#
     password:                           persagy_2020qwe!@#
 
 
-  activemq:
-#    broker-url:                         tcp://192.168.20.225:61616
-
   servlet:
   servlet:
     multipart:
     multipart:
       max-request-size:                500MB        # 限制上传的多个文件的总大小
       max-request-size:                500MB        # 限制上传的多个文件的总大小
       max-file-size:                   500MB        # 限制单个文件的最大值
       max-file-size:                   500MB        # 限制单个文件的最大值
 
 
-  kafka:
-    bootstrap-servers:                      192.168.20.236:9092
-#    bootstrap-servers:                      127.0.0.1:9092
-
-#    bootstrap-servers:                      172.16.9.226:9092
-
-    consumer:
-      group-id:                             datacenter-consumer-group
+    #配置rabbitMq 服务器
+  rabbitmq:
+    host: 192.168.0.190
+    port: 5672
+    username: admin
+    password: admin
+      #虚拟host 可以不设置,使用server默认host
+    virtual-host: JCcccHost

+ 5 - 1
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/ShaftUtil.kt

@@ -229,7 +229,11 @@ object ShaftUtil {
     }
     }
 
 
     /**
     /**
-     * 竖井
+     * 竖井工具
+     *
+     * @param projectId     项目 id
+     * @param shaft         竖井对象
+     * @return 返回结果
      */
      */
     fun shaftTools(projectId: String,shaft: Shaft): ArrayList<HashMap<String,Any?>> {
     fun shaftTools(projectId: String,shaft: Shaft): ArrayList<HashMap<String,Any?>> {
         var list = ArrayList<HashMap<String,Any?>>()
         var list = ArrayList<HashMap<String,Any?>>()

+ 87 - 51
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/SpaceUtil.kt

@@ -516,56 +516,92 @@ object SpaceUtil {
         return zoneSpace
         return zoneSpace
     }
     }
 
 
-//    fun spaceTools(projectId: String,zoneSpace: ZoneSpace): ArrayList<HashMap<String,Any?>> {
-//        var list = ArrayList<HashMap<String,Any?>>()
-//        val hashMap = HashMap<String, Any?>()
-//        hashMap["id"] = zoneSpace.id
-//        hashMap["name"] = zoneSpace.name
-//        hashMap["projectId"] = projectId
-//        hashMap["objType"] = "space"
-//        hashMap["classCode"] = zoneSpace.classCode
-//        hashMap["zoneSpaceSequenceId"] = zoneSpace.zoneSpaceSequenceId
-//        if (!zoneSpace.localName.isNullOrEmpty()){
-//            hashMap["localName"] = zoneSpace.localName
-//        }
-//        if (!zoneSpace.localId.isNullOrEmpty()){
-//            hashMap["localId"] = zoneSpace.localId
-//        }
-//        if (!zoneSpace.defaultQRCode.isNullOrEmpty()){
-//            hashMap["defaultQRCode"] = zoneSpace.defaultQRCode
-//        }
-//        if (!zoneSpace.qRCodePic.isNullOrEmpty()){
-//            hashMap["qRCodePic"] = zoneSpace.qRCodePic
-//        }
-//        if (zoneSpace.roomSerial!=null&&zoneSpace.roomSerial!=0.0){
-//            hashMap["roomSerial"] = zoneSpace.roomSerial
-//        }
-//        if (!zoneSpace.roomFuncType.isNullOrEmpty()){
-//            hashMap["roomFuncType"] = zoneSpace.roomFuncType
-//        }
-//        if (!zoneSpace.bimId.isNullOrEmpty()){
-//            hashMap["bimId"] = zoneSpace.bimId
-//        }
-//        if (!zoneSpace.bimLocation.isNullOrEmpty()){
-//            hashMap["bimLocation"] = zoneSpace.bimLocation
-//        }
-//        if (!zoneSpace.outline.isNullOrEmpty()){
-//            hashMap["outline"] = zoneSpace.outline.toString()
-//        }
-//        if (zoneSpace.permanentPeopleNum!=null&&zoneSpace.permanentPeopleNum!=0){
-//            hashMap["permanentPeopleNum"] = zoneSpace.permanentPeopleNum
-//        }
-//        if (!zoneSpace.zoneSpaceIdentity.isNullOrEmpty()){
-//            hashMap["zoneSpaceIdentity"] = zoneSpace.zoneSpaceIdentity
-//        }
-//        if (!zoneSpace.infos.isNullOrEmpty()){
-//            for (key in zoneSpace.infos!!.keys){
-//                hashMap[key] = zoneSpace.infos!![key]
-//            }
-//        }
-//
-//        list.add(hashMap)
-//        return list
-//    }
+    /**
+     * 空间工具
+     *
+     * @param projectId     项目 id
+     * @param zoneSpace     空间对象
+     * @return 返回结果
+     */
+    fun spaceTools(projectId: String,zoneSpace: ZoneSpace): ArrayList<HashMap<String,Any?>> {
+        var list = ArrayList<HashMap<String,Any?>>()
+        val hashMap = HashMap<String, Any?>()
+        hashMap["id"] = zoneSpace.id
+        hashMap["name"] = zoneSpace.name
+        hashMap["projectId"] = projectId
+        hashMap["objType"] = "space"
+        hashMap["classCode"] = zoneSpace.classCode
+        if (!zoneSpace.localName.isNullOrEmpty()){
+            hashMap["localName"] = zoneSpace.localName
+        }
+        if (!zoneSpace.localId.isNullOrEmpty()){
+            hashMap["localId"] = zoneSpace.localId
+        }
+        if (!zoneSpace.defaultQRCode.isNullOrEmpty()){
+            hashMap["defaultQRCode"] = zoneSpace.defaultQRCode
+        }
+        if (!zoneSpace.qRCodePic.isNullOrEmpty()){
+            hashMap["qRCodePic"] = zoneSpace.qRCodePic
+        }
+        if (zoneSpace.roomSerial!=null&&zoneSpace.roomSerial!=0.0){
+            hashMap["roomSerial"] = zoneSpace.roomSerial
+        }
+        if (!zoneSpace.roomFuncType.isNullOrEmpty()){
+            hashMap["roomFuncType"] = zoneSpace.roomFuncType
+        }
+        if (!zoneSpace.bimId.isNullOrEmpty()){
+            hashMap["bimId"] = zoneSpace.bimId
+        }
+        if (!zoneSpace.bimLocation.isNullOrEmpty()){
+            hashMap["bimLocation"] = zoneSpace.bimLocation
+        }
+        if (!zoneSpace.outline.isNullOrEmpty()){
+            hashMap["outline"] = zoneSpace.outline.toString()
+        }
+        if (zoneSpace.permanentPeopleNum!=null&&zoneSpace.permanentPeopleNum!=0){
+            hashMap["permanentPeopleNum"] = zoneSpace.permanentPeopleNum
+        }
+        if (zoneSpace.depth!=null&&zoneSpace.depth!=0.0){
+            hashMap["depth"] = zoneSpace.depth
+        }
+        if (zoneSpace.width!=null&&zoneSpace.width!=0.0){
+            hashMap["width"] = zoneSpace.width
+        }
+        if (zoneSpace.buildArea!=null&&zoneSpace.buildArea!=0.0){
+            hashMap["buildArea"] = zoneSpace.buildArea
+        }
+        if (zoneSpace.netArea!=null&&zoneSpace.netArea!=0.0){
+            hashMap["netArea"] = zoneSpace.netArea
+        }
+        if (zoneSpace.height!=null&&zoneSpace.height!=0.0){
+            hashMap["height"] = zoneSpace.height
+        }
+        if (zoneSpace.elecCap!=null&&zoneSpace.elecCap!=0.0){
+            hashMap["elecCap"] = zoneSpace.elecCap
+        }
+        if (!zoneSpace.zoneOrientation.isNullOrEmpty()){
+            hashMap["zoneOrientation"] = zoneSpace.zoneOrientation
+        }
+        if (!zoneSpace.pollutionDegree.isNullOrEmpty()){
+            hashMap["pollutionDegree"] = zoneSpace.pollutionDegree
+        }
+        if (!zoneSpace.intro.isNullOrEmpty()){
+            hashMap["intro"] = zoneSpace.intro
+        }
+        if (!zoneSpace.projRoomFuncType.isNullOrEmpty()){
+            hashMap["projRoomFuncType"] = zoneSpace.projRoomFuncType
+        }
+        if (!zoneSpace.pic.isNullOrEmpty()){
+            hashMap["pic"] = zoneSpace.pic
+        }
+        if (!zoneSpace.infos.isNullOrEmpty()){
+            for (key in zoneSpace.infos!!.keys){
+                hashMap[key] = zoneSpace.infos!![key]
+            }
+        }
+
+        list.add(hashMap)
+        return list
+    }
 
 
 }
 }

+ 45 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/models/tools/SystemUtil.kt

@@ -625,4 +625,49 @@ object SystemUtil {
         return generalSystem
         return generalSystem
     }
     }
 
 
+    /**
+     * 系统工具
+     *
+     * @param projectId         项目 id
+     * @param generalSystem     系统对象
+     * @return 返回结果
+     */
+    fun systemTools(projectId: String,generalSystem: GeneralSystem): ArrayList<HashMap<String,Any?>> {
+        var list = ArrayList<HashMap<String,Any?>>()
+        val hashMap = HashMap<String, Any?>()
+        hashMap["id"] = generalSystem.id
+        hashMap["name"] = generalSystem.name
+        hashMap["projectId"] = projectId
+        hashMap["objType"] = "generalSystem"
+        hashMap["classCode"] = generalSystem.classCode
+        if (!generalSystem.localName.isNullOrEmpty()){
+            hashMap["localName"] = generalSystem.localName
+        }
+        if (!generalSystem.localId.isNullOrEmpty()){
+            hashMap["localId"] = generalSystem.localId
+        }
+        if (!generalSystem.defaultQRCode.isNullOrEmpty()){
+            hashMap["defaultQRCode"] = generalSystem.defaultQRCode
+        }
+        if (!generalSystem.qRCodePic.isNullOrEmpty()){
+            hashMap["qRCodePic"] = generalSystem.qRCodePic
+        }
+        if (!generalSystem.cadId.isNullOrEmpty()){
+            hashMap["cadId"] = generalSystem.cadId
+        }
+        if (!generalSystem.bimId.isNullOrEmpty()){
+            hashMap["bimId"] = generalSystem.bimId
+        }
+        if (!generalSystem.infos.isNullOrEmpty()){
+            for (key in generalSystem.infos!!.keys){
+                hashMap[key] = generalSystem.infos!![key]
+            }
+        }
+
+        list.add(hashMap)
+        return list
+    }
+
+
+
 }
 }

+ 1 - 1
labsl/src/main/kotlin/com/persagy/server/labsl/models/entities/Node.kt

@@ -52,7 +52,7 @@ open class Node : SBaseEntity(), Serializable {
     /** 节点类型(image / zone) */
     /** 节点类型(image / zone) */
     @ApiModelProperty(value = "节点类型(image / zone)")
     @ApiModelProperty(value = "节点类型(image / zone)")
     @Column(name = "type")
     @Column(name = "type")
-    var type: Int? = null
+    var type: String? = null
 
 
     /** 位置信息 */
     /** 位置信息 */
     @ApiModelProperty(value = "位置信息")
     @ApiModelProperty(value = "位置信息")

+ 1 - 1
labsl/src/main/kotlin/com/persagy/server/labsl/models/entities/pub/NodePub.kt

@@ -54,7 +54,7 @@ class NodePub : SBaseEntity(), Serializable {
     /** 节点类型(image / zone) */
     /** 节点类型(image / zone) */
     @ApiModelProperty(value = "节点类型(image / zone)")
     @ApiModelProperty(value = "节点类型(image / zone)")
     @Column(name = "type")
     @Column(name = "type")
-    var type: Int? = null
+    var type: String? = null
 
 
     /** 位置信息 */
     /** 位置信息 */
     @ApiModelProperty(value = "位置信息")
     @ApiModelProperty(value = "位置信息")

+ 3 - 3
labsl/src/main/kotlin/com/persagy/server/labsl/services/GraphService.kt

@@ -84,7 +84,7 @@ object GraphService : SObjectService<Graph>(SMybatisDao(Graph::class.java)) {
         if (graph.graphId.isNullOrEmpty()){
         if (graph.graphId.isNullOrEmpty()){
             graph.graphId = UUID.randomUUID().toString().replace("-", "")
             graph.graphId = UUID.randomUUID().toString().replace("-", "")
         }
         }
-        graph.projectId = projectId
+        graph.projectId = projectId!!
         /** 清除以前的版本 */
         /** 清除以前的版本 */
         delOldData(graph)
         delOldData(graph)
         /** 版本号 */
         /** 版本号 */
@@ -131,7 +131,7 @@ object GraphService : SObjectService<Graph>(SMybatisDao(Graph::class.java)) {
                                 anchor.anchorId = UUID.randomUUID().toString().replace("-", "")
                                 anchor.anchorId = UUID.randomUUID().toString().replace("-", "")
                             }
                             }
                             val insertAnchor = AnchorService.insert(anchor)
                             val insertAnchor = AnchorService.insert(anchor)
-                            if (insertAnchor) {
+                            if (!insertAnchor) {
                                 // 事务回滚
                                 // 事务回滚
                                 backTransaction()
                                 backTransaction()
                                 sCreateResponse.result = SResponseType.failure
                                 sCreateResponse.result = SResponseType.failure
@@ -206,7 +206,7 @@ object GraphService : SObjectService<Graph>(SMybatisDao(Graph::class.java)) {
         /** 项目id */
         /** 项目id */
         val projectId = SPageContext.getHeader("projectId")
         val projectId = SPageContext.getHeader("projectId")
         val graph1 = Graph()
         val graph1 = Graph()
-        graph1.projectId = projectId
+        graph1.projectId = projectId!!
         graph1.id = graphPub.id
         graph1.id = graphPub.id
         graph1.graphId = graphPub.graphId
         graph1.graphId = graphPub.graphId
         /** 查询草稿箱 */
         /** 查询草稿箱 */