فهرست منبع

**************************************万达adm*********************************************
修改关系同步

zhangweixin 4 سال پیش
والد
کامیت
8755ef80a8

+ 11 - 8
datasyn/src/main/kotlin/com/persagy/server/datacenter/syn/controllers/obj/ObjectToFromController.kt

@@ -164,18 +164,21 @@ class ObjectToFromController {
                 val createObj =
                     EquipApi.createObj(dictProject!!.groupCode!!, projectId, EquipUtil.equipTools(projectId, equip))
                 if (!createObj) {
-                    val updateObj =
-                        EquipApi.updateObj(dictProject!!.groupCode!!, projectId, EquipUtil.equipTools(projectId, equip))
-                    if (!updateObj) {
-                        logger.debug("设备更新失败:${equip.toJson()}")
-                    }
+
+                }
+                val updateObj =
+                    EquipApi.updateObj(dictProject!!.groupCode!!, projectId, EquipUtil.equipTools(projectId, equip))
+                if (!updateObj) {
+                    logger.debug("设备更新失败:${equip.toJson()}")
                 }
                 if (!equip.buildingId.isNullOrEmpty()) {
                     val toJsonObjArray =
                         Configure.toJsonObjArray("MechInArch", "Eq2Bd", equip.id!!, equip.buildingId!!)
-                    val toJsonObjArray2 =
-                        Configure.toJsonObjArray("MechInArch", "Eq2Fl", equip.id!!, equip.floorId!!)
-                    toJsonObjArray.add(toJsonObjArray2[0])
+                    if (!equip.floorId.isNullOrEmpty()){
+                        val toJsonObjArray2 =
+                            Configure.toJsonObjArray("MechInArch", "Eq2Fl", equip.id!!, equip.floorId!!)
+                        toJsonObjArray.add(toJsonObjArray2[0])
+                    }
                     val createRel = EquipApi.createRel(dictProject.groupCode!!, projectId, toJsonObjArray)
                     if (!createRel){
                         logger.debug("设备和楼层的关系失败:${equip.toJson()}")

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

@@ -324,7 +324,7 @@ class RelToFromController {
             if (rEq2SpList.size>0) {
                 for (rEq2Sp in rEq2SpList) {
                     if (isDel) {
-                        val toJsonObj = Configure.toJsonObj(graphCode, type, rEq2Sp.id1!!, null)
+                        val toJsonObj = Configure.toJsonObj(graphCode, type, rEq2Sp.id1!!, rEq2Sp.id2)
                         EquipApi.delRel(dictProject!!.groupCode!!, projectId,toJsonObj)
                     }
                     val toJsonObjArray =