diff --git a/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java b/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java index 2dd4f56..be664ab 100644 --- a/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java +++ b/inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java @@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.inspect.base.core.constant.Color; import com.inspect.base.core.domain.Response; +import com.inspect.base.core.utils.StringUtils; import com.inspect.ivs.base.feign.view.SipbDeviceListView; import com.inspect.ivs.constant.IvsConst; import com.inspect.ivs.domain.Temp; @@ -20,7 +21,6 @@ import com.inspect.ivs.vo.IvsDevChanSnapVo; import java.io.*; import java.util.*; -import org.apache.commons.lang3.StringUtils; import org.apache.http.HttpResponse; import org.apache.http.client.methods.HttpGet; import org.apache.http.impl.client.CloseableHttpClient; @@ -81,23 +81,26 @@ public class IvsDeviceController { ruleItem.put("alarmSettingList", alarmSettingListEx);//写死 radiometryRuleExList.add(ruleItem); // 遍历 FastJSON 的 JSONArray - for (Object obj : radiometryRuleExListOrginl) { - if (obj instanceof JSONObject) { - JSONObject jsonObject = (JSONObject) obj; - Map map = new HashMap<>(); - // FastJSON 的 JSONObject 可以直接转换为 Map - map = jsonObject.getInnerMap(); // 直接获取内部 Map - // 或者逐个处理 key-value(更安全) - for (Map.Entry entry : jsonObject.entrySet()) { - map.put(entry.getKey(), entry.getValue()); + if(StringUtils.isNotNull(radiometryRuleExListOrginl)){ + for (Object obj : radiometryRuleExListOrginl) { + if (obj instanceof JSONObject) { + JSONObject jsonObject = (JSONObject) obj; + Map map = new HashMap<>(); + // FastJSON 的 JSONObject 可以直接转换为 Map + map = jsonObject.getInnerMap(); // 直接获取内部 Map + // 或者逐个处理 key-value(更安全) + for (Map.Entry entry : jsonObject.entrySet()) { + map.put(entry.getKey(), entry.getValue()); + } + radiometryRuleExList.add(map); + } else if (obj instanceof String) { + // 处理基本类型(如果 JSONArray 中包含字符串等) + Map map = Collections.singletonMap("value", obj); + radiometryRuleExList.add(map); } - radiometryRuleExList.add(map); - } else if (obj instanceof String) { - // 处理基本类型(如果 JSONArray 中包含字符串等) - Map map = Collections.singletonMap("value", obj); - radiometryRuleExList.add(map); } } + // 设置 configItem configItem.put("radiometryRuleExList", radiometryRuleExList); List> radiometryRuleList = new ArrayList<>(); @@ -132,23 +135,26 @@ public class IvsDeviceController { radiometryRuleList.add(radiometryRule); // 遍历 FastJSON 的 JSONArray - for (Object obj : radiometryRuleListOrginl) { - if (obj instanceof JSONObject) { - JSONObject jsonObject = (JSONObject) obj; - Map map = new HashMap<>(); - // FastJSON 的 JSONObject 可以直接转换为 Map - map = jsonObject.getInnerMap(); // 直接获取内部 Map - // 或者逐个处理 key-value(更安全) - for (Map.Entry entry : jsonObject.entrySet()) { - map.put(entry.getKey(), entry.getValue()); + if(StringUtils.isNotNull(radiometryRuleListOrginl)){ + for (Object obj : radiometryRuleListOrginl) { + if (obj instanceof JSONObject) { + JSONObject jsonObject = (JSONObject) obj; + Map map = new HashMap<>(); + // FastJSON 的 JSONObject 可以直接转换为 Map + map = jsonObject.getInnerMap(); // 直接获取内部 Map + // 或者逐个处理 key-value(更安全) + for (Map.Entry entry : jsonObject.entrySet()) { + map.put(entry.getKey(), entry.getValue()); + } + radiometryRuleList.add(map); + } else if (obj instanceof String) { + // 处理基本类型(如果 JSONArray 中包含字符串等) + Map map = Collections.singletonMap("value", obj); + radiometryRuleList.add(map); } - radiometryRuleList.add(map); - } else if (obj instanceof String) { - // 处理基本类型(如果 JSONArray 中包含字符串等) - Map map = Collections.singletonMap("value", obj); - radiometryRuleList.add(map); } } + configItem.put("radiometryRuleList", radiometryRuleList); json.put("deviceCode", tempConfiguration.getCameraCode().split("#")[0]);//传 json.put("configType", 500);//写死500 diff --git a/inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java b/inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java index cce56ce..a321c5c 100644 --- a/inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java +++ b/inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java @@ -394,7 +394,7 @@ public class JobMainTask { boolean noError = setCameraToPreset(presetPos); if ("prod".equals(activeProfile) && noError) { log.info("setCameraToPreset no error, delay 20 seconds"); - myDelay(20000); + myDelay(5000); } else { log.info("setCameraToPreset has error, delay 2 seconds"); myDelay(2000); diff --git a/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml b/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml index f6a5f54..9b33f70 100644 --- a/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml +++ b/inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml @@ -975,8 +975,8 @@ - - + +