Browse Source

/*纠偏算法逻辑完成:在进行第一步转到预置位和第二部下发纠偏指令成功以后调用第三步:保存预置位当前纠偏配置。*/

master
htjcAdmin 2 days ago
parent
commit
e588020998
3 changed files with 34 additions and 1 deletions
  1. +20
    -1
      inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsControlController.java
  2. +1
    -0
      inspect-ivs/src/main/java/com/inspect/ivs/vo/IvsPresetExVo.java
  3. +13
    -0
      inspect-main/inspect-main-task/src/main/java/com/inspect/task/service/impl/PatrolTaskServiceImpl.java

+ 20
- 1
inspect-ivs/src/main/java/com/inspect/ivs/controller/IvsControlController.java View File

@ -113,7 +113,26 @@ public class IvsControlController {
ivsPresetVo.getCameraCode());
ivsPresetVo.setUUID(uuid);
return ivsResourceRetryableDelegate.gotoSnapshotPresetExRetryable(version, ivsPresetVo);
} else {
} else if (command.equals("correctionSet")) {
JSONObject ptzPresetInfo = new JSONObject();
ptzPresetInfo.put("presetIndex", Integer.parseInt(ivsPresetVo.getPreset()));
ptzPresetInfo.put("presetName", ivsPresetVo.getName());
JSONObject paramJsonPreSet = new JSONObject();
paramJsonPreSet.put("cameraCode", ivsPresetVo.getCode());
paramJsonPreSet.put("ptzPresetInfo", ptzPresetInfo);
log.info("PRESET_EX CORRECTION_SET cameraCode: {}, preset: {}, name: {}, paramBody: {}",
ivsPresetVo.getCameraCode(),
ivsPresetVo.getPreset(),
ivsPresetVo.getName(),
paramJsonPreSet.toJSONString());
IvsPresetView ivsPresetView = ivsCommonService.postJson(ivsResourceRetryableDelegate.getLabel(),
paramJsonPreSet,
IvsConst.URI_PRESET_SET,
IvsPresetView.class);
log.info("PRESET_EX CORRECTION_SET RES: {}", ivsPresetView);
return Response.ok(ivsPresetView);
}else {
return Response.ok();
}
}


+ 1
- 0
inspect-ivs/src/main/java/com/inspect/ivs/vo/IvsPresetExVo.java View File

@ -7,6 +7,7 @@ import lombok.Setter;
@Setter
public class IvsPresetExVo extends IvsVo {
private String command;
private String preset;
private String controlCode;
private String controlPara1;
private String controlPara2;


+ 13
- 0
inspect-main/inspect-main-task/src/main/java/com/inspect/task/service/impl/PatrolTaskServiceImpl.java View File

@ -204,6 +204,19 @@ public class PatrolTaskServiceImpl implements IPatrolTaskService {
log.info("controller correctionAlgorithm correction param: {}", param);
try {
HttpClientUtils.get(url, param);
Thread.sleep(5000);
// 保存预置位
final String url3 = "http://199.199.199.154:9906" + "/api/v1/control/presetEx";
final String param3 = "command=correctionSet"
+ "&code=" + channelCode
+ "&preset=" + presetPosCode
+ "&name=" + URLEncoder.encode(presetPosName, ("UTF-8"))
;
try {
HttpClientUtils.get(url3, param3);
} catch (Exception e) {
log.info("controller correctionAlgorithm url3 execute exception: {}", e.getMessage());
}
} catch (Exception e) {
log.info("controller correctionAlgorithm HttpClientUtils.get execute exception: {}", e.getMessage());
}


Loading…
Cancel
Save