Browse Source

job转动摄像头改为5s 易达红外修改

master
王寅 6 months ago
parent
commit
c26841cada
3 changed files with 38 additions and 32 deletions
  1. +35
    -29
      inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java
  2. +1
    -1
      inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java
  3. +2
    -2
      inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml

+ 35
- 29
inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.inspect.base.core.constant.Color; import com.inspect.base.core.constant.Color;
import com.inspect.base.core.domain.Response; 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.base.feign.view.SipbDeviceListView;
import com.inspect.ivs.constant.IvsConst; import com.inspect.ivs.constant.IvsConst;
import com.inspect.ivs.domain.Temp; import com.inspect.ivs.domain.Temp;
@ -20,7 +21,6 @@ import com.inspect.ivs.vo.IvsDevChanSnapVo;
import java.io.*; import java.io.*;
import java.util.*; import java.util.*;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpResponse; import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.CloseableHttpClient;
@ -81,23 +81,26 @@ public class IvsDeviceController {
ruleItem.put("alarmSettingList", alarmSettingListEx);//写死 ruleItem.put("alarmSettingList", alarmSettingListEx);//写死
radiometryRuleExList.add(ruleItem); radiometryRuleExList.add(ruleItem);
// 遍历 FastJSON JSONArray // 遍历 FastJSON JSONArray
for (Object obj : radiometryRuleExListOrginl) {
if (obj instanceof JSONObject) {
JSONObject jsonObject = (JSONObject) obj;
Map<String, Object> map = new HashMap<>();
// FastJSON JSONObject 可以直接转换为 Map
map = jsonObject.getInnerMap(); // 直接获取内部 Map
// 或者逐个处理 key-value更安全
for (Map.Entry<String, Object> 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<String, Object> map = new HashMap<>();
// FastJSON JSONObject 可以直接转换为 Map
map = jsonObject.getInnerMap(); // 直接获取内部 Map
// 或者逐个处理 key-value更安全
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
map.put(entry.getKey(), entry.getValue());
}
radiometryRuleExList.add(map);
} else if (obj instanceof String) {
// 处理基本类型如果 JSONArray 中包含字符串等
Map<String, Object> map = Collections.singletonMap("value", obj);
radiometryRuleExList.add(map);
} }
radiometryRuleExList.add(map);
} else if (obj instanceof String) {
// 处理基本类型如果 JSONArray 中包含字符串等
Map<String, Object> map = Collections.singletonMap("value", obj);
radiometryRuleExList.add(map);
} }
} }
// 设置 configItem // 设置 configItem
configItem.put("radiometryRuleExList", radiometryRuleExList); configItem.put("radiometryRuleExList", radiometryRuleExList);
List<Map<String, Object>> radiometryRuleList = new ArrayList<>(); List<Map<String, Object>> radiometryRuleList = new ArrayList<>();
@ -132,23 +135,26 @@ public class IvsDeviceController {
radiometryRuleList.add(radiometryRule); radiometryRuleList.add(radiometryRule);
// 遍历 FastJSON JSONArray // 遍历 FastJSON JSONArray
for (Object obj : radiometryRuleListOrginl) {
if (obj instanceof JSONObject) {
JSONObject jsonObject = (JSONObject) obj;
Map<String, Object> map = new HashMap<>();
// FastJSON JSONObject 可以直接转换为 Map
map = jsonObject.getInnerMap(); // 直接获取内部 Map
// 或者逐个处理 key-value更安全
for (Map.Entry<String, Object> 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<String, Object> map = new HashMap<>();
// FastJSON JSONObject 可以直接转换为 Map
map = jsonObject.getInnerMap(); // 直接获取内部 Map
// 或者逐个处理 key-value更安全
for (Map.Entry<String, Object> entry : jsonObject.entrySet()) {
map.put(entry.getKey(), entry.getValue());
}
radiometryRuleList.add(map);
} else if (obj instanceof String) {
// 处理基本类型如果 JSONArray 中包含字符串等
Map<String, Object> map = Collections.singletonMap("value", obj);
radiometryRuleList.add(map);
} }
radiometryRuleList.add(map);
} else if (obj instanceof String) {
// 处理基本类型如果 JSONArray 中包含字符串等
Map<String, Object> map = Collections.singletonMap("value", obj);
radiometryRuleList.add(map);
} }
} }
configItem.put("radiometryRuleList", radiometryRuleList); configItem.put("radiometryRuleList", radiometryRuleList);
json.put("deviceCode", tempConfiguration.getCameraCode().split("#")[0]);// json.put("deviceCode", tempConfiguration.getCameraCode().split("#")[0]);//
json.put("configType", 500);//写死500 json.put("configType", 500);//写死500


+ 1
- 1
inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java View File

@ -394,7 +394,7 @@ public class JobMainTask {
boolean noError = setCameraToPreset(presetPos); boolean noError = setCameraToPreset(presetPos);
if ("prod".equals(activeProfile) && noError) { if ("prod".equals(activeProfile) && noError) {
log.info("setCameraToPreset no error, delay 20 seconds"); log.info("setCameraToPreset no error, delay 20 seconds");
myDelay(20000);
myDelay(5000);
} else { } else {
log.info("setCameraToPreset has error, delay 2 seconds"); log.info("setCameraToPreset has error, delay 2 seconds");
myDelay(2000); myDelay(2000);


+ 2
- 2
inspect-main/inspect-main-task/src/main/resources/mapper/task/PatrolResultMapper.xml View File

@ -975,8 +975,8 @@
<result property="deviceName" column="device_name"/> <result property="deviceName" column="device_name"/>
<result property="mainDevId" column="main_dev_id"/> <result property="mainDevId" column="main_dev_id"/>
<result property="mainDevName" column="main_dev_name"/> <result property="mainDevName" column="main_dev_name"/>
<result property="componentId" column="component_name"/>
<result property="componentName" column="component_id"/>
<result property="componentId" column="component_id"/>
<result property="componentName" column="component_name"/>
<result property="value" column="value"/> <result property="value" column="value"/>
<result property="unit" column="unit"/> <result property="unit" column="unit"/>
<result property="recognitionType" column="recognition_type"/> <result property="recognitionType" column="recognition_type"/>


Loading…
Cancel
Save