Procházet zdrojové kódy

下发控制保存日志判断对象类型和所属场景属性是否存在

lirong před 2 roky
rodič
revize
02dfbbd4be

+ 12 - 4
ibms-data-sdk/src/main/java/com/persagy/ibms/data/sdk/util/ControlUtil.java

@@ -228,8 +228,16 @@ public class ControlUtil {
                 Object ibmsSceneCode = sdo.get("ibmsSceneCode").value_prim.value;
                 Object ibmsClassCode = sdo.get("ibmsClassCode").value_prim.value;
                 String classCode = (String) sdo.get("classCode").value_prim.value;
-                Object ibmsSceneName = sdo.get("所属场景").value_prim.value;
-                Object ibmsClassName = sdo.get("对象类型").value_prim.value;
+                Object ibmsSceneName=null;
+                Object ibmsClassName=null;
+                if(sdo.getClass().getName().equals("所属场景"))
+                {
+                    ibmsSceneName = sdo.get("所属场景").value_prim.value;
+                }
+                if(sdo.getClass().getName().equals("对象类型"))
+                {
+                    ibmsClassName = sdo.get("对象类型").value_prim.value;
+                }
                 List<SceneDataObject> infoList = RepositoryContainer.instance.infoArrayDic.get(classCode).set;
                 postParam.put("deviceName", ibmsxianshimingcheng);
                 postParam.put("deviceCode", ibmsxianshibianma);
@@ -351,7 +359,7 @@ public class ControlUtil {
         String post_url = Constant.zkt_monitor_url + "/operatorLog/save";
         System.out.println("保存日志url:" + post_url);
         System.out.println("保存日志boby:" + postParam.toJSONString());
-        String post_result = HttpClientUtil.instance("zkt_control").post(post_url, postParam.toJSONString());
+        String post_result = HttpClientUtil.instance("zkt_monitor").post(post_url, postParam.toJSONString());
         JSONObject result = JSON.parseObject(post_result);
         log.debug(result.toJSONString());
     }
@@ -361,7 +369,7 @@ public class ControlUtil {
         String post_url = Constant.zkt_monitor_url + "/operatorLog/saveBatch";
         System.out.println("保存日志url:" + post_url);
         System.out.println("保存日志boby:" + postParam.toJSONString());
-        String post_result = HttpClientUtil.instance("zkt_control").post(post_url, postParam.toJSONString());
+        String post_result = HttpClientUtil.instance("zkt_monitor").post(post_url, postParam.toJSONString());
         JSONObject result = JSON.parseObject(post_result);
         log.debug(result.toJSONString());
     }