From c4689398f2c6a076791ee29388aaf159dae4a6e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AF=85?= <97163845@qq.com> Date: Thu, 22 May 2025 14:36:09 +0800 Subject: [PATCH] =?UTF-8?q?ivs1800=E7=BA=A2=E5=A4=96=E4=BB=BB=E5=8A=A1?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/inspect/ivs/controller/IvsDeviceController.java | 5 +++-- .../com/inspect/job/mapper/PatrolDeviceStateMapper.java | 2 ++ .../src/main/java/com/inspect/job/task/JobMainTask.java | 9 ++++++++- .../resources/mapper/job/PatrolDeviceStateMapper.xml | 7 +++++++ .../patrol/controller/PatrolPresetPosController.java | 1 + 5 files changed, 21 insertions(+), 3 deletions(-) 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 8cbe756..851e1bb 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 @@ -57,6 +57,7 @@ public class IvsDeviceController { */ @PostMapping("/setHwConfig") public Response setHwConfig(@RequestBody TempConfiguration tempConfiguration) throws Exception { + log.info("[infra_1800] =======tempConfiguration: {}", tempConfiguration); JSONObject json = new JSONObject(); JSONObject configItem = new JSONObject(); List> alarmSettingListEx = new ArrayList<>(); @@ -83,7 +84,7 @@ public class IvsDeviceController { radiometryRule.put("enable", 1);//使能 radiometryRule.put("meterType", 3);//区域 radiometryRule.put("presetId", tempConfiguration.getPresetId());//传 预置位id - radiometryRule.put("ruleId", 12);//自己取最大没人用的 + radiometryRule.put("ruleId", tempConfiguration.getRuleId());//自己取最大没人用的 radiometryRule.put("samplePeriod", 3);// radiometryRule.put("name", tempConfiguration.getName());//传 定义一个名字 //设置localParam @@ -132,7 +133,7 @@ public class IvsDeviceController { log.info( "[infrared_1800] 获取红外温度 temper param: {}", temp); String cameraCode = temp.getCameraCode().split("#")[0]; //cameraCode摄像机编码 int presetId = temp.getPresetId(); //预设位ID - int ruleId = 12; //规则ID 暂时写死取12就行 + int ruleId = temp.getRuleId(); //规则ID 暂时写死取12就行 // int meterType = temp.getMeterType(); String requestMsg = "presetId=" + presetId + "&" + "ruleId=" + ruleId + "&" + "meterType=" + 3; //发送请求 diff --git a/inspect-job/src/main/java/com/inspect/job/mapper/PatrolDeviceStateMapper.java b/inspect-job/src/main/java/com/inspect/job/mapper/PatrolDeviceStateMapper.java index d3a42ae..021a949 100644 --- a/inspect-job/src/main/java/com/inspect/job/mapper/PatrolDeviceStateMapper.java +++ b/inspect-job/src/main/java/com/inspect/job/mapper/PatrolDeviceStateMapper.java @@ -5,6 +5,7 @@ import org.apache.ibatis.annotations.Mapper; import java.util.HashMap; import java.util.List; +import java.util.Map; @Mapper public interface PatrolDeviceStateMapper { @@ -19,4 +20,5 @@ public interface PatrolDeviceStateMapper { List selectEqpBookChannel(); void updateEqpBookChannel(EqpBookChannel eqpBookChannel); + Map selectPatrolPresetParam(Long pointId); } 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 75ac67f..c4e68cc 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 @@ -27,6 +27,7 @@ import com.inspect.job.domain.livesipb.RecordData; import com.inspect.job.domain.livesipb.Stream; import com.inspect.job.domain.task.*; import com.inspect.base.core.domain.maintain.MaintainRegion; +import com.inspect.job.mapper.PatrolDeviceStateMapper; import com.inspect.job.util.HttpClientUtil; import com.inspect.system.base.domain.SysDictData; @@ -113,18 +114,21 @@ public class JobMainTask { final SftpClient sftpClient; + final PatrolDeviceStateMapper patrolDeviceStateMapper; @Autowired public JobMainTask( ShaoXinBigModel shaoXinBigModel, TaskExecClient taskExecClient, RedisService redisService, XgiotInvokeClient remoteInvokeService, - SftpClient sftpClient) { + SftpClient sftpClient, + PatrolDeviceStateMapper patrolDeviceStateMapper) { this.shaoXinBigModel = shaoXinBigModel; this.taskExecClient = taskExecClient; this.redisService = redisService; this.remoteInvokeService = remoteInvokeService; this.sftpClient = sftpClient; + this.patrolDeviceStateMapper = patrolDeviceStateMapper; } @PostConstruct @@ -482,8 +486,11 @@ public class JobMainTask { log.info("[infra_1800] 红外处理新流程: prePointExec algSubtypeCode: {}", algSubtypeCode); String paramFileName; if(algSubtypeCode.contains(AlgConstants.INFRA_1800)) { + Map threshold = patrolDeviceStateMapper.selectPatrolPresetParam(presetPos.getPatrolPointId()); final String temperUrl = liveIVS_URL + "/api/v1/device/temper"; JSONObject temperParam = new JSONObject(); + temperParam.put("ruleId", threshold.get("preset_param_code")); + log.info("[infra_1800] =======ruleId: {}", threshold.get("preset_param_code")); temperParam.put("presetId", Integer.parseInt(presetPos.getPresetPosCode())); temperParam.put("cameraCode", presetPos.getChannelCode()); final String temperUrlRes = HttpClientUtils.sendPostAgain(temperUrl, temperParam.toString()); diff --git a/inspect-job/src/main/resources/mapper/job/PatrolDeviceStateMapper.xml b/inspect-job/src/main/resources/mapper/job/PatrolDeviceStateMapper.xml index 9399595..79695d1 100644 --- a/inspect-job/src/main/resources/mapper/job/PatrolDeviceStateMapper.xml +++ b/inspect-job/src/main/resources/mapper/job/PatrolDeviceStateMapper.xml @@ -115,4 +115,11 @@ where channel_id = #{channelId} + + \ No newline at end of file diff --git a/inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolPresetPosController.java b/inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolPresetPosController.java index 2000394..9a4b5bd 100644 --- a/inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolPresetPosController.java +++ b/inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolPresetPosController.java @@ -507,6 +507,7 @@ public class PatrolPresetPosController extends BaseController { final String temperUrl = liveSIPBUrl + "/api/v1/device/setHwConfig"; logger.info("=========temperUrl====={}", temperUrl); JSONObject temperParam = new JSONObject(); + temperParam.put("ruleId", Integer.parseInt(patrolPresetParam.getPresetParamCode())); //设置ruleId temperParam.put("presetId", patrolPresetPos.getPresetPosCode()); temperParam.put("name", patrolPresetParam.getMeasureName()); temperParam.put("cameraCode", patrolPresetPos.getChannelCode());