瀏覽代碼

********************WX***********************
同步关系

zhangweixin 4 年之前
父節點
當前提交
ebe814133a

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

@@ -366,7 +366,7 @@ class ObjectFromToControllers {
                                     equipSyn.floorId = hashMap["objTo"].toString()
                                 }
                             }
-                            if (equipSyn.buildingId.isNullOrEmpty()){
+                            if (equipSyn.buildingId.isNullOrEmpty()&&!equipSyn.floorId.isNullOrEmpty()){
                                 if (!equipSyn.floorId.isNullOrEmpty()){
                                     val floor = floorService.select(SFilter.eq("id", equipSyn.floorId!!)).entity()
                                     if (floor!=null){
@@ -391,6 +391,99 @@ class ObjectFromToControllers {
     }
 
     /**
+     * 直接拉取数据中台的整个项目下设备
+     */
+    @Operation(summary = "设备信息-数据中台存储到数据中心 - 直接获取项目下所有设备数据 ", description = "switch true  根据输入的项目 id  同步楼层,false 同步所有项目的 楼层")
+    @PostMapping(value = ["/equip-syn-All"])
+    fun equipSynAll(@RequestParam projectId: String,@RequestParam switch: Boolean = true,@RequestParam isBuildingFloor: Boolean = true): SBaseResponse {
+        return try {
+            if (switch) {
+                val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
+                val equipSynApi = EquipApi.equipSynApiAll(dictProject!!.groupCode!!,projectId)
+                logger.debug("数量 = ${equipSynApi.data?.size}")
+//                return  SBaseResponse(SResponseType.success)
+                val equipDataList = equipSynApi.data
+                for (equipData in equipDataList!!){
+                    val equipSyn = EquipUtil.equipSyns(projectId, dictProject!!.groupCode!!, equipData)
+                    logger.debug("设备=${equipSyn.toJson()}")
+                    if (isBuildingFloor){
+                        /** 查询建筑 */
+                        val equipInBuildingList = EquipApi.equipInBuilding(dictProject!!.groupCode!!,projectId, equipSyn.id!!)
+                        if (equipInBuildingList.size>0){
+                            val hashMap = equipInBuildingList[0]
+                            if (hashMap.containsKey("objTo")){
+                                equipSyn.buildingId = hashMap["objTo"].toString()
+                            }
+                        }
+                        /** 查询楼层 */
+                        val equipInFloorList = EquipApi.equipInFloor(dictProject!!.groupCode!!,projectId, equipSyn.id!!)
+                        if (equipInFloorList.size>0){
+                            val hashMap = equipInFloorList[0]
+                            if (hashMap.containsKey("objTo")){
+                                equipSyn.floorId = hashMap["objTo"].toString()
+                            }
+                        }
+                        if (equipSyn.buildingId.isNullOrEmpty()&&!equipSyn.floorId.isNullOrEmpty()){
+                            if (!equipSyn.floorId.isNullOrEmpty()){
+                                val floor = floorService.select(SFilter.eq("id", equipSyn.floorId!!)).entity()
+                                if (floor!=null){
+                                    equipSyn.buildingId = floor.buildingId
+                                }
+                            }
+                        }
+                    }
+                    equipmentService.replace(equipSyn)
+                }
+            } else {
+                val projectList = projectService.selectAll().exec()
+                for (project in projectList){
+                    val dictProject = dictProjectService.select(SFilter.eq("id", project.id!!)).entity()
+                    val equipSynApi = EquipApi.equipSynApiAll(dictProject!!.groupCode!!,project.id!!)
+                    val equipDataList = equipSynApi.data
+                    for (equipData in equipDataList!!){
+                        val equipSyn = EquipUtil.equipSyns(project.id!!, dictProject.groupCode!!, equipData)
+                        if (isBuildingFloor){
+                            /** 查询建筑 */
+                            val equipInBuildingList = EquipApi.equipInBuilding(dictProject.groupCode!!,project.id!!, equipSyn.id!!)
+                            if (equipInBuildingList.size>0){
+                                val hashMap = equipInBuildingList[0]
+                                if (hashMap.containsKey("objTo")){
+                                    equipSyn.buildingId = hashMap["objTo"].toString()
+                                }
+                            }
+                            /** 查询楼层 */
+                            val equipInFloorList = EquipApi.equipInFloor(dictProject.groupCode!!,project.id!!, equipSyn.id!!)
+                            if (equipInFloorList.size>0){
+                                val hashMap = equipInFloorList[0]
+                                if (hashMap.containsKey("objTo")){
+                                    equipSyn.floorId = hashMap["objTo"].toString()
+                                }
+                            }
+                            if (equipSyn.buildingId.isNullOrEmpty()){
+                                if (!equipSyn.floorId.isNullOrEmpty()){
+                                    val floor = floorService.select(SFilter.eq("id", equipSyn.floorId!!)).entity()
+                                    if (floor!=null){
+                                        equipSyn.buildingId = floor.buildingId
+                                    }
+                                }
+                            }
+                        }
+                        equipmentService.replace(equipSyn)
+                    }
+                }
+            }
+            SBaseResponse(SResponseType.success)
+        } catch (e: Exception) {
+            e.printStackTrace()
+            SBaseResponse(SResponseType.failure, e.message!!)
+        }
+    }
+
+
+
+
+
+    /**
      * 空间
      *
      * @param projectId         项目 id

+ 131 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/controllers/obj/TestControllers.kt

@@ -0,0 +1,131 @@
+/*
+ * *********************************************************************************************************************
+ *
+ *          !!
+ *        .F88X
+ *        X8888Y
+ *      .}888888N;
+ *        i888888N;        .:!              .I$WI:
+ *          R888888I      .'N88~            i8}+8Y&8"l8i$8>8W~'>W8}8]KW+8IIN"8&
+ *          .R888888I    .;N8888~          .X8'  "8I.!,/8"  !%NY8`"8I8~~8>,88I
+ *            +888888N;  .8888888Y                                  "&&8Y.}8,
+ *            ./888888N;  .R888888Y        .'}~    .>}'.`+>  i}!    "i'  +/'  .'i~  !11,.:">,  .~]!  .i}i
+ *              ~888888%:  .I888888l      .]88~`1/iY88Ii+1'.R$8$8]"888888888>  Y8$  W8E  X8E  W8888'188Il}Y88$*
+ *              18888888    E8888881    .]W%8$`R8X'&8%++N8i,8N%N8+l8%`  .}8N:.R$RE%N88N%N$K$R  188,FE$8%~Y88I
+ *            .E888888I  .i8888888'      .:$8I;88+`E8R:/8N,.>881.`$8E/1/]N8X.Y8N`"KF&&FK!'88*."88K./$88%RN888+~
+ *            8888888I  .,N888888~        ~88i"8W,!N8*.I88.}888%F,i$88"F88"  888:E8X.>88!i88>`888*.}Fl1]*}1YKi'
+ *          i888888N'      I888Y          ]88;/EX*IFKFK88X  K8R  .l8W  88Y  ~88}'88E&%8W.X8N``]88!.$8K  .:W8I
+ *        .i888888N;        I8Y          .&8$  .X88!  i881.:%888>I88  ;88]  +88+.';;;;:.Y88X  18N.,88l  .+88/
+ *      .:R888888I
+ *      .&888888I                                          Copyright (c) 2009-2020.  博锐尚格科技股份有限公司
+ *        ~8888'
+ *        .!88~                                                                     All rights reserved.
+ *
+ * *********************************************************************************************************************
+ */
+
+package com.persagy.server.syn.controllers.obj
+
+import com.persagy.base.extensions.toJson
+import com.persagy.database.SFilter
+import com.persagy.mybatis.SMybatisDao
+import com.persagy.server.datacenter.models.entities.dictnew.DictProject
+import com.persagy.server.datacenter.models.entities.objects.Equipment
+import com.persagy.server.datacenter.models.entities.objects.Floor
+import com.persagy.server.datacenter.models.entities.objects.Project
+import com.persagy.server.syn.models.api.obj.BuildingApi
+import com.persagy.server.syn.models.api.obj.EquipApi
+import com.persagy.server.syn.models.tools.EquipUtil
+import com.persagy.service.SBaseService
+import com.persagy.service.SObjectService
+import com.persagy.service.models.enums.SResponseType
+import com.persagy.service.models.responses.SBaseResponse
+import io.swagger.v3.oas.annotations.Operation
+import io.swagger.v3.oas.annotations.tags.Tag
+import org.slf4j.LoggerFactory
+import org.springframework.web.bind.annotation.PostMapping
+import org.springframework.web.bind.annotation.RequestMapping
+import org.springframework.web.bind.annotation.RequestParam
+import org.springframework.web.bind.annotation.RestController
+
+/**
+ * 测试
+ * @author wx  <zhangweixin@sagacloud.com>
+ * @date  2020/12/24 11:47
+ */
+@Tag(name = "0003、对象-中台到数据中心 - 测试")
+@RestController
+@RequestMapping("/test/object")
+class TestControllers {
+
+    companion object {
+        // 日志
+        private val logger = LoggerFactory.getLogger(ObjectFromToControllers::class.java)
+    } // Companion object
+    /** 字典项目服务 */
+    private val dictProjectService = SBaseService(SMybatisDao(DictProject::class.java))
+    /** 数据中心楼层服务 */
+    private val floorService = SObjectService(SMybatisDao(Floor::class.java))
+    /** 数据中心设备服务 */
+    private val equipmentService = SObjectService(SMybatisDao(Equipment::class.java))
+    /** 数据中心项目服务 */
+    private val projectService = SObjectService(SMybatisDao(Project::class.java))
+
+    /**
+     * 设备
+     *
+     * @param projectId         项目 id
+     * @param switch            开关
+     * @param isBuildingFloor   是否查询楼层
+     * @param page              页码
+     * @return 返回值
+     */
+    @Operation(summary = "设备信息-数据中台存储到数据中心 ", description = "switch true  根据输入的项目 id  同步楼层,false 同步所有项目的 楼层")
+    @PostMapping(value = ["/equip-syn-dan"])
+    fun equipSyn(@RequestParam projectId: String, @RequestParam isBuildingFloor: Boolean = true,@RequestParam id: String): SBaseResponse {
+        return try {
+
+                val dictProject = dictProjectService.select(SFilter.eq("id", projectId)).entity()
+//                val equipSynApi = EquipApi.equipSynApi(dictProject!!.groupCode!!,projectId, page)
+                val queryId = BuildingApi.queryId(dictProject?.groupCode!!, projectId!!, id!!)
+                    val equipSyn = EquipUtil.equipSyns(projectId, dictProject!!.groupCode!!, queryId[0])
+                    logger.debug("设备=${equipSyn.toJson()}")
+                    if (isBuildingFloor){
+                        /** 查询建筑 */
+                        val equipInBuildingList = EquipApi.equipInBuilding(dictProject!!.groupCode!!,projectId, equipSyn.id!!)
+                        if (equipInBuildingList.size>0){
+                            val hashMap = equipInBuildingList[0]
+                            if (hashMap.containsKey("objTo")){
+                                equipSyn.buildingId = hashMap["objTo"].toString()
+                            }
+                        }
+                        /** 查询楼层 */
+                        val equipInFloorList = EquipApi.equipInFloor(dictProject!!.groupCode!!,projectId, equipSyn.id!!)
+                        if (equipInFloorList.size>0){
+                            val hashMap = equipInFloorList[0]
+                            if (hashMap.containsKey("objTo")){
+                                equipSyn.floorId = hashMap["objTo"].toString()
+                            }
+                        }
+                        if (equipSyn.buildingId.isNullOrEmpty()){
+                            if (!equipSyn.floorId.isNullOrEmpty()){
+                                val floor = floorService.select(SFilter.eq("id", equipSyn.floorId!!)).entity()
+                                if (floor!=null){
+                                    equipSyn.buildingId = floor.buildingId
+                                }
+                            }
+                        }
+                    }
+                    equipmentService.replace(equipSyn)
+
+
+            SBaseResponse(SResponseType.success)
+        } catch (e: Exception) {
+            e.printStackTrace()
+            SBaseResponse(SResponseType.failure, e.message!!)
+        }
+    }
+
+
+
+}

+ 22 - 0
datasyn/src/main/kotlin/com/persagy/server/syn/models/api/obj/EquipApi.kt

@@ -74,6 +74,26 @@ object EquipApi {
         }
         return postObject
     }
+    /**
+     * 获取中台设备数据
+     *
+     * @param projectId     项目 id
+     * @param page          页码
+     * @return 返回值
+     */
+    fun equipSynApiAll(groupCode: String,projectId: String): MiddleGroundDataRespose{
+        val url = "${opts.dataPlatform}/rwd/instance/object/query?groupCode=$groupCode&projectId=${projectId}"
+        val jsonObject = JSONObject()
+        val jsonObject2 = JSONObject()
+        jsonObject2["objType"] = "equipment"
+        jsonObject2["valid"] = 1
+        jsonObject["criteria"] = jsonObject2
+        val postObject = SHttpUtil.postObject<MiddleGroundDataRespose>(url, jsonObject)
+        if (postObject.result == "success"&&!postObject.data.isNullOrEmpty()) {
+            return postObject
+        }
+        return postObject
+    }
 
     /**
      * 获取设备和楼层的关系
@@ -171,6 +191,8 @@ object EquipApi {
     fun  updateObj(groupCode: String,projectId: String, listObj: ArrayList<HashMap<String,Any?>>): Boolean {
         val url = "${opts.dataPlatform}/rwd/instance/object/update?groupCode=$groupCode&projectId=${projectId}&appId=datacenter"
 //        val buildingTools = FloorUtil.floorTools(projectId, floor)
+        logger.debug("设备创建url = ${url}")
+        logger.debug("设备创建boby = ${listObj.toJson()}")
         val postObject = SHttpUtil.postObject<MiddleGroundDataRespose>(url, listObj)
         if (postObject.result == "success") {
             return true

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

@@ -2361,6 +2361,7 @@ object EquipUtil {
      * 设备转换
      */
     fun equipSyns(projectId: String,groupCode: String, mapObj: HashMap<String, Any?>): Equipment {
+        val equipment = Equipment()
         /** 查建楼层型字典 */
         val dictDefFuncIdList = dictDefFuncIdService.select(SFilter.eq("groupCode", groupCode),SFilter.eq("projectId", projectId), SFilter.eq("classCode", mapObj["classCode"].toString())).exec()
         val mapEx = HashMap<String, Any?>()
@@ -2372,114 +2373,173 @@ object EquipUtil {
             mapCode[explainProject.code!!] = explainProject.category
         }
         logger.debug("打印= ${mapObj.toJson()}")
-        val equipment = Equipment()
+
         equipment.projectId = projectId
         equipment.classCode = mapObj["classCode"].toString()
-        for (key in mapObj.keys) {
-            val containsKey = mapEx.containsKey(key)
-            if (containsKey){
-                if (key != "id"&& key!="name"&&key!="localId"&&key!="localName"&&key!="defaultQRCode"
-                    &&key!="qRCodePic"&&key!="rfId"&&key!="cadId"&&key!="bimFamilyName"&&key!="bimFamilySymbol"
-                    &&key!="bimTypeId"&&key!="bimId"&&key!="bimLocation"&&key!="equipSerial"){
-                    val containsKey1 = mapCode.containsKey(key)
-                    if (containsKey1){
-                        val any = mapCode[key].toString()
-                        if (any == "STATIC"){
-                            when(mapEx[key].toString()) {
-                                "INTEGER" -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+        equipment.id =  mapObj["id"]!!.toString()
+        equipment.name =  mapObj["name"]!!.toString()
+        val containsKey2 = mapObj.containsKey("localId")
+        if (containsKey2) {
+            equipment.localId =  mapObj["localId"]!!.toString()
+        }
+        val containsKey3 = mapObj.containsKey("localId")
+        if (containsKey3) {
+            equipment.localName =  mapObj["localName"]!!.toString()
+       }
+        val containsKey4 = mapObj.containsKey("defaultQRCode")
+        if (containsKey4) {
+            equipment.defaultQRCode =  mapObj["defaultQRCode"]!!.toString()
+        }
+        val containsKey5 = mapObj.containsKey("rfId")
+        if (containsKey5) {
+            equipment.rfId =  mapObj["rfId"]!!.toString()
+        }
+        val containsKey6 = mapObj.containsKey("cadId")
+        if (containsKey6) {
+            equipment.cadId =  mapObj["cadId"]!!.toString()
+        }
+        val containsKey7 = mapObj.containsKey("cADID")
+        if (containsKey7) {
+            equipment.cadId =  mapObj["cADID"]!!.toString()
+        }
+        val containsKey8 = mapObj.containsKey("bimFamilyName")
+        if (containsKey8) {
+            equipment.bimFamilyName =  mapObj["bimFamilyName"]!!.toString()
+        }
+        val containsKey9 = mapObj.containsKey("bimFamilySymbol")
+        if (containsKey9) {
+            equipment.bimFamilySymbol =  mapObj["bimFamilySymbol"]!!.toString()
+        }
+        val containsKey10 = mapObj.containsKey("bimTypeId")
+        if (containsKey10) {
+            equipment.bimTypeId =  mapObj["bimTypeId"]!!.toString()
+        }
+        val containsKey11 = mapObj.containsKey("bimId")
+        if (containsKey11) {
+            equipment.bimId =  mapObj["bimId"]!!.toString()
+        }
+        val containsKey12 = mapObj.containsKey("bimLocation")
+        if (containsKey12) {
+            equipment.bimLocation =  mapObj["bimLocation"]!!.toString()
+        }
+        val containsKey13 = mapObj.containsKey("equipSerial")
+        if (containsKey13) {
+            equipment.equipSerial =  mapObj["equipSerial"]!!.toString().toDoubleOrNull()
+        }
+
+        try {
+            for (key in mapObj.keys) {
+                val containsKey = mapEx.containsKey(key)
+                if (containsKey){
+                    if (key != "id"&& key!="name"&&key!="localId"&&key!="localName"&&key!="defaultQRCode"
+                        &&key!="qRCodePic"&&key!="rfId"&&key!="cadId"&&key!="bimFamilyName"&&key!="bimFamilySymbol"
+                        &&key!="bimTypeId"&&key!="bimId"&&key!="bimLocation"&&key!="equipSerial"){
+                        val containsKey1 = mapCode.containsKey(key)
+                        if (containsKey1){
+                            val any = mapCode[key].toString()
+                            if (any == "STATIC"){
+                                when(mapEx[key].toString()) {
+                                    "INTEGER" -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toInt()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toInt()
-                                }
-                                "DOUBLE" -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+                                    "DOUBLE" -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toString().toDoubleOrNull()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toString().toDoubleOrNull()
-                                }
-                                "BOOLEAN" -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+                                    "BOOLEAN" -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toString().toBoolean()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toString().toBoolean()
-                                }
-                                "STRING" -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+                                    "STRING" -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toString()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toString()
-                                }
-                                "DATETIME" -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+                                    "DATETIME" -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toString()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toString()
-                                }
-                                "ATTACHMENT" -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+                                    "ATTACHMENT" -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toString()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toString()
-                                }
-                                "OBJECT" -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+                                    "OBJECT" -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toString()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toString()
-                                }
-                                "ENUM" -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+                                    "ENUM" -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toString()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toString()
-                                }
-                                "MENUM" -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+                                    "MENUM" -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toString()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toString()
-                                }
-                                else -> {
-                                    if (equipment.infos.isNullOrEmpty()){
-                                        equipment.infos = HashMap<String,Any?>()
+                                    else -> {
+                                        if (equipment.infos.isNullOrEmpty()){
+                                            equipment.infos = HashMap<String,Any?>()
+                                        }
+                                        equipment.infos!![key] = mapObj[key]!!.toString()
                                     }
-                                    equipment.infos!![key] = mapObj[key]!!.toString()
                                 }
+                            }else{
+                                if (equipment.infos.isNullOrEmpty()){
+                                    equipment.infos = HashMap<String,Any?>()
+                                }
+                                equipment.infos!![key] = mapObj[key]!!.toString()
                             }
-                        }else{
-                            if (equipment.infos.isNullOrEmpty()){
-                                equipment.infos = HashMap<String,Any?>()
+                        }
+
+                    } else {
+                        try {
+                            when(key) {
+                                "id" -> equipment.id =  mapObj[key]!!.toString()
+                                "name" -> equipment.name =  mapObj[key]!!.toString()
+                                "localId" -> equipment.localId =  mapObj[key]!!.toString()
+                                "localName" -> equipment.localName =  mapObj[key]!!.toString()
+                                "defaultQRCode" -> equipment.defaultQRCode =  mapObj[key]!!.toString()
+                                "qRCodePic" -> equipment.qRCodePic =  mapObj[key]!!.toString()
+                                "rfId" -> equipment.rfId =  mapObj[key]!!.toString()
+                                "cadId" -> equipment.cadId =  mapObj[key]!!.toString()
+                                "bimFamilyName" -> equipment.bimFamilyName =  mapObj[key]!!.toString()
+                                "bimFamilySymbol" -> equipment.bimFamilySymbol =  mapObj[key]!!.toString()
+                                "bimTypeId" -> equipment.bimTypeId =  mapObj[key]!!.toString()
+                                "bimId" -> equipment.bimId =  mapObj[key]!!.toString()
+                                "bimLocation" -> equipment.bimLocation =  mapObj[key]!!.toString()
+                                "equipSerial" -> equipment.equipSerial =  mapObj[key]!!.toString().toDoubleOrNull()
                             }
-                            equipment.infos!![key] = mapObj[key]!!.toString()
+                        } catch (e: Exception) {
+                            e.printStackTrace()
                         }
                     }
 
                 } else {
-                    when(key) {
-                        "id" -> equipment.id =  mapObj[key]!!.toString()
-                        "name" -> equipment.name =  mapObj[key]!!.toString()
-                        "localId" -> equipment.localId =  mapObj[key]!!.toString()
-                        "localName" -> equipment.localName =  mapObj[key]!!.toString()
-                        "defaultQRCode" -> equipment.defaultQRCode =  mapObj[key]!!.toString()
-                        "qRCodePic" -> equipment.qRCodePic =  mapObj[key]!!.toString()
-                        "rfId" -> equipment.rfId =  mapObj[key]!!.toString()
-                        "cadId" -> equipment.cadId =  mapObj[key]!!.toString()
-                        "bimFamilyName" -> equipment.bimFamilyName =  mapObj[key]!!.toString()
-                        "bimFamilySymbol" -> equipment.bimFamilySymbol =  mapObj[key]!!.toString()
-                        "bimTypeId" -> equipment.bimTypeId =  mapObj[key]!!.toString()
-                        "bimId" -> equipment.bimId =  mapObj[key]!!.toString()
-                        "bimLocation" -> equipment.bimLocation =  mapObj[key]!!.toString()
-                        "equipSerial" -> equipment.equipSerial =  mapObj[key]!!.toString().toDoubleOrNull()
-                    }
+    //                if (equipment.infos.isNullOrEmpty()){
+    //                    equipment.infos = HashMap<String,Any?>()
+    //                }
+    //                equipment.infos!![key] =  mapObj[key]!!.toString()
                 }
-
-            } else {
-//                if (equipment.infos.isNullOrEmpty()){
-//                    equipment.infos = HashMap<String,Any?>()
-//                }
-//                equipment.infos!![key] =  mapObj[key]!!.toString()
             }
+        } catch (e: Exception) {
+            e.printStackTrace()
         }
 
         return equipment

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

@@ -51,7 +51,7 @@ class EquipinSpaceSync {
                             SFilter.eq("projectId", synchronousMessageRel.projectId!!),
                             SFilter.eq("id", synchronousMessageRel.fromId!!)
                         ).entity()
-                        toJsonObjArray= Configure.toJsonObjList(graphCode, relCode, synchronousMessageRel.fromId!!,fromIds,zoneSpace?.classCode)
+                        toJsonObjArray= Configure.toJsonObjFromList(graphCode, relCode,fromIds, synchronousMessageRel.fromId!!,zoneSpace?.classCode)
                 } else {
                         val zoneSpace = zoneSpaceService.select(
                             SFilter.eq("projectId", synchronousMessageRel.projectId!!),

+ 1 - 2
datasyn/src/main/kotlin/com/persagy/server/syn/task/SchedulerTask.kt

@@ -29,7 +29,6 @@ package com.persagy.server.syn.task
 import com.persagy.server.syn.jms.MessageProcessing
 import org.slf4j.LoggerFactory
 import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.scheduling.annotation.Scheduled
 import org.springframework.stereotype.Service
 
 /**
@@ -53,7 +52,7 @@ class SchedulerTask {
     //cron表达式:每隔5秒执行一次
 //    @Scheduled(cron = "0 */3 * * * ?")
 //    @Scheduled(cron="0/30 * *  * * ? ")   //每5秒执行一次
-    @Scheduled(cron = "0 */1 * * * ?")
+//    @Scheduled(cron = "0 */1 * * * ?")
     fun scheduled() {
         logger.info("同步数据中心任务开始至中台")
         messageProcessing.syncDataCenter()

+ 1 - 2
datasyn/src/main/kotlin/com/persagy/server/syn/task/SchedulerTaskRel.kt

@@ -29,7 +29,6 @@ package com.persagy.server.syn.task
 import com.persagy.server.syn.jms.MessageProcessing
 import org.slf4j.LoggerFactory
 import org.springframework.beans.factory.annotation.Autowired
-import org.springframework.scheduling.annotation.Scheduled
 import org.springframework.stereotype.Service
 
 /**
@@ -53,7 +52,7 @@ class SchedulerTaskRel {
     //cron表达式:每隔5秒执行一次
 //    @Scheduled(cron = "0 */3 * * * ?")
 //    @Scheduled(cron="0/5 * *  * * ? ")   //每5秒执行一次
-    @Scheduled(cron = "0 */1 * * * ?")
+//    @Scheduled(cron = "0 */1 * * * ?")
     fun scheduled() {
         logger.info("同步数据中心任务开始至数据中台-关系数据")
         messageProcessing.syncDataCenterRel()