ScenePluginUtil.java 717 B

123456789101112131415161718
  1. package com.fdkankan.contro.util;
  2. import com.alibaba.fastjson.JSONObject;
  3. import com.fdkankan.common.constant.CommonStatus;
  4. import com.fdkankan.contro.constant.ScenePlugin;
  5. public class ScenePluginUtil {
  6. public static boolean hasOBPlugin(JSONObject dataFdage) {
  7. return dataFdage.getJSONArray("plugin")
  8. .stream()
  9. .map(obj -> ((JSONObject) obj).getString("name"))
  10. .anyMatch(name -> name != null && name.startsWith(ScenePlugin.OB.code()))//新的app版本是以数组元素的结构记录插件
  11. || dataFdage.getIntValue("zxState") == CommonStatus.YES.code().intValue();//旧版本app以zxState字段标识是否使用了知像光电插件
  12. }
  13. }