Browse Source

ivs1800红外任务添加规则

master
王寅 7 months ago
parent
commit
c4689398f2
5 changed files with 21 additions and 3 deletions
  1. +3
    -2
      inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java
  2. +2
    -0
      inspect-job/src/main/java/com/inspect/job/mapper/PatrolDeviceStateMapper.java
  3. +8
    -1
      inspect-job/src/main/java/com/inspect/job/task/JobMainTask.java
  4. +7
    -0
      inspect-job/src/main/resources/mapper/job/PatrolDeviceStateMapper.xml
  5. +1
    -0
      inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolPresetPosController.java

+ 3
- 2
inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsDeviceController.java View File

@ -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<Map<String, Object>> 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;
//发送请求


+ 2
- 0
inspect-job/src/main/java/com/inspect/job/mapper/PatrolDeviceStateMapper.java View File

@ -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<EqpBookChannel> selectEqpBookChannel();
void updateEqpBookChannel(EqpBookChannel eqpBookChannel);
Map<String, String> selectPatrolPresetParam(Long pointId);
}

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

@ -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<String, String> 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());


+ 7
- 0
inspect-job/src/main/resources/mapper/job/PatrolDeviceStateMapper.xml View File

@ -115,4 +115,11 @@
where channel_id = #{channelId}
</update>
<select id="selectPatrolPresetParam" parameterType="Long" resultType="java.util.Map">
SELECT a.preset_param_code
FROM patrol_preset_param a, patrol_preset_pos b
WHERE a.preset_pos_id = b.preset_pos_id AND b.patrol_point_id = #{pointId}
limit 1
</select>
</mapper>

+ 1
- 0
inspect-main/inspect-main-video/src/main/java/com/inspect/patrol/controller/PatrolPresetPosController.java View File

@ -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());


Loading…
Cancel
Save